Skip to content

Commit

Permalink
2023-03-15-preview as default (openai#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmurtz-msft authored and davedittrich committed Nov 14, 2023
1 parent ea6bcd8 commit ad4752b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ import openai
openai.api_type = "azure"
openai.api_key = "..."
openai.api_base = "https://example-endpoint.openai.azure.com"
openai.api_version = "2022-12-01"
openai.api_version = "2023-03-15-preview"

# create a completion
completion = openai.Completion.create(engine="deployment-name", prompt="Hello world")
completion = openai.Completion.create(deployment_id="deployment-name", prompt="Hello world")

# print the completion
print(completion.choices[0].text)
Expand Down Expand Up @@ -116,7 +116,7 @@ token = default_credential.get_token("https://cognitiveservices.azure.com/.defau
openai.api_type = "azure_ad"
openai.api_key = token.token
openai.api_base = "https://example-endpoint.openai.azure.com/"
openai.api_version = "2022-12-01"
openai.api_version = "2023-03-15-preview"

# ...
```
Expand Down
2 changes: 1 addition & 1 deletion openai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
api_base = os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1")
api_type = os.environ.get("OPENAI_API_TYPE", "open_ai")
api_version = (
"2022-12-01" if api_type in ("azure", "azure_ad", "azuread") else None
"2023-03-15-preview" if api_type in ("azure", "azure_ad", "azuread") else None
)
verify_ssl_certs = True # No effect. Certificates are always verified.
proxy = None
Expand Down

0 comments on commit ad4752b

Please sign in to comment.