Skip to content
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

feat: add AZURE_API_KEY that falls back to OPENAI_API_KEY #135

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

jordanbtucker
Copy link
Collaborator

The --use-azure flag coopts the OPENAI_API_KEY environment variable. This makes it impossible to have an OpenAI configuration and an Azure configuration on the same machine without swapping the OPENAI_API_KEY environment variable.

This PR adds support for a new environment variable AZURE_API_KEY that falls back to OPENAI_API_KEY if not found.

# Use OpenAI
OPENAI_API_KEY=key interpreter

# Use Azure
AZURE_API_KEY=key AZURE_API_BASE=base AZURE_API_VERSION=version AZURE_DEPLOYMENT_NAME=name interpreter --use-azure

# Use Azure but fallback to OPENAI_API_KEY for backward compatibilty
OPENAI_API_KEY=key AZURE_API_BASE=base AZURE_API_VERSION=version AZURE_DEPLOYMENT_NAME=name interpreter --use-azure

Copy link
Collaborator

@KillianLucas KillianLucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jordanbtucker, excellent work.

@KillianLucas KillianLucas merged commit 07f1cda into OpenInterpreter:main Sep 7, 2023
@pikkst
Copy link

pikkst commented Sep 9, 2023

how can i reset openai_api_key if you have already saved it?

@jordanbtucker
Copy link
Collaborator Author

jordanbtucker commented Sep 9, 2023

@pikkst It's an environment variable, so it's going to depend on your OS.

https://www3.ntu.edu.sg/home/ehchua/programming/howto/Environment_Variables.html

@pikkst
Copy link

pikkst commented Sep 15, 2023 via email

joshuavial pushed a commit to joshuavial/open-interpreter that referenced this pull request Sep 15, 2023
feat: add AZURE_API_KEY that falls back to OPENAI_API_KEY
joshuavial pushed a commit to joshuavial/open-interpreter that referenced this pull request Nov 16, 2023
feat: add AZURE_API_KEY that falls back to OPENAI_API_KEY
Former-commit-id: 07f1cda
Former-commit-id: c5d546c529eedbd4fc46d06d2f5886c3d95eb2d4
Former-commit-id: 6df1583940146733f8e60c142cd08fed48f802c1 [formerly 8e29866d236c2c32a453e4f2e60d9fcc85e67c43]
Former-commit-id: f3ca035693e5b966338443e9e3b8cb7473f39938
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants