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

Add option to override Azure API type #189

Merged
merged 1 commit into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ interpreter.api_key = "your_openai_api_key"
interpreter.azure_api_base = "your_azure_api_base"
interpreter.azure_api_version = "your_azure_api_version"
interpreter.azure_deployment_name = "your_azure_deployment_name"
interpreter.azure_api_type = "azure"
```

### Debug mode
Expand Down
4 changes: 3 additions & 1 deletion interpreter/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def __init__(self):
self.azure_api_base = None
self.azure_api_version = None
self.azure_deployment_name = None
self.azure_api_type = "azure"

# Get default system message
here = os.path.abspath(os.path.dirname(__file__))
Expand Down Expand Up @@ -278,6 +279,7 @@ def verify_api_key(self):
self.azure_api_base = os.environ['AZURE_API_BASE']
self.azure_api_version = os.environ['AZURE_API_VERSION']
self.azure_deployment_name = os.environ['AZURE_DEPLOYMENT_NAME']
self.azure_api_type = os.environ.get('AZURE_API_TYPE', 'azure')
else:
# This is probably their first time here!
print('', Markdown("**Welcome to Open Interpreter.**"), '')
Expand Down Expand Up @@ -310,7 +312,7 @@ def verify_api_key(self):
time.sleep(2)
print(Rule(style="white"))

openai.api_type = "azure"
openai.api_type = self.azure_api_type
openai.api_base = self.azure_api_base
openai.api_version = self.azure_api_version
openai.api_key = self.api_key
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "open-interpreter"
packages = [
{include = "interpreter"},
]
version = "0.1.1"
version = "0.1.2"
description = "Let language models run code locally."
authors = ["Killian Lucas <killian@drinkwater.ai>"]
readme = "README.md"
Expand Down