-
Notifications
You must be signed in to change notification settings - Fork 1.9k
API key from Env Var support #6178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
…ssage Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
…viders Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
setApiKeyUseEnvVar={(value: boolean) => setApiConfigurationField("openAiNativeApiKeyUseEnvVar", value)} | ||
apiKeyLabel={t("settings:providers.openAiNativeApiKey")} | ||
getApiKeyUrl="https://platform.openai.com/api-keys" | ||
getApiKeyLabel={t("settings:providers.getopenAiNativeApiKey")} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typographical error: The translation key "settings:providers.getopenAiNativeApiKey" appears to have a lower-case 'o'. Should it be "settings:providers.getOpenAiNativeApiKey" to maintain consistency with other key naming?
getApiKeyLabel={t("settings:providers.getopenAiNativeApiKey")} | |
getApiKeyLabel={t("settings:providers.getOpenAiNativeApiKey")} |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Signed-off-by: Geoff Wilson <geoff@gr-oss.io>
Related GitHub Issue
Closes: #4337
Description
This PR adds support for obtaining API keys from the environment. A checkbox is added to each configuration that allows inputting an API key -- when checked, a given environment variable (eg,
OPEN_AI_API_KEY
, etc) is consulted for the key and the user is not required to provide one in the configuration. Env Var key is predictable but not editable.Additionally, added an option to generate placeholder translation keys in supported locale files. Was useful in an earlier iteration but not used now (no new translations).
Test Procedure
I tested this using VS Code run configurations, where the expected environment variable could be provided or omitted.
Pre-Submission Checklist
A documentation update is advised, to describe environment variable usage to supply API keys.
Screenshots / Videos
Documentation Updates
Additional Notes
Get in Touch
Important
Adds support for using environment variables for API keys across multiple providers, updates UI components to reflect this, and enhances testing and translation capabilities.
anthropic
,glama
,openrouter
,openai
,gemini
,mistral
,deepseek
,unbound
,requesty
,xai
,groq
,chutes
,litellm
inprovider-settings.ts
.validateModelsAndKeysProvided()
invalidate.ts
to check for environment variable usage for API keys.ApiKey
component inApiKey.tsx
to handle API key input and environment variable toggle.Anthropic.tsx
,Chutes.tsx
,DeepSeek.tsx
, etc., to use the newApiKey
component.index.spec.ts
andApiKey.spec.tsx
.--create-missing
option infind-missing-translations.js
for generating placeholder translation keys.This description was created by
for f154eb2. You can customize this summary. It will automatically update as commits are pushed.