We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae6aa20 commit c7112abCopy full SHA for c7112ab
balrog/utils.py
@@ -205,8 +205,11 @@ def setup_environment(
205
original_cwd (str, optional): Original working directory. Defaults to "".
206
"""
207
secrets = load_secrets(os.path.join(original_cwd, "SECRETS"))
208
- genai.configure(api_key=secrets[gemini_tag])
209
- os.environ["ANTHROPIC_API_KEY"] = secrets[anthropic_tag]
210
- os.environ["OPENAI_API_KEY"] = secrets[openai_tag]
+ if secrets[gemini_tag]:
+ genai.configure(api_key=secrets[gemini_tag])
+ if secrets[anthropic_tag]:
211
+ os.environ["ANTHROPIC_API_KEY"] = secrets[anthropic_tag]
212
+ if secrets[openai_tag]:
213
+ os.environ["OPENAI_API_KEY"] = secrets[openai_tag]
214
if organization is not None:
215
openai.organization = secrets[organization]
0 commit comments