Skip to content

Commit

Permalink
Updating code and readme to reference the Azure's newest 2023-05-15 A…
Browse files Browse the repository at this point in the history
…PI version. (#452)
  • Loading branch information
glecaros authored May 18, 2023
1 parent 2b21516 commit da82878
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ import openai
openai.api_type = "azure"
openai.api_key = "..."
openai.api_base = "https://example-endpoint.openai.azure.com"
openai.api_version = "2023-03-15-preview"
openai.api_version = "2023-05-15"

# create a chat completion
chat_completion = openai.ChatCompletion.create(deployment_id="deployment-name", model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Hello world"}])
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 = "2023-03-15-preview"
openai.api_version = "2023-05-15"

# ...
```
Expand Down
2 changes: 1 addition & 1 deletion openai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
api_type = os.environ.get("OPENAI_API_TYPE", "open_ai")
api_version = os.environ.get(
"OPENAI_API_VERSION",
("2023-03-15-preview" if api_type in ("azure", "azure_ad", "azuread") else None),
("2023-05-15" 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 da82878

Please sign in to comment.