Skip to content

Commit 2b0bb90

Browse files
authored
2023-03-15-preview as default (#335)
1 parent 62a208d commit 2b0bb90

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ import openai
8484
openai.api_type = "azure"
8585
openai.api_key = "..."
8686
openai.api_base = "https://example-endpoint.openai.azure.com"
87-
openai.api_version = "2022-12-01"
87+
openai.api_version = "2023-03-15-preview"
8888

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

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

121121
# ...
122122
```

openai/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
api_base = os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1")
3838
api_type = os.environ.get("OPENAI_API_TYPE", "open_ai")
3939
api_version = (
40-
"2022-12-01" if api_type in ("azure", "azure_ad", "azuread") else None
40+
"2023-03-15-preview" if api_type in ("azure", "azure_ad", "azuread") else None
4141
)
4242
verify_ssl_certs = True # No effect. Certificates are always verified.
4343
proxy = None

0 commit comments

Comments
 (0)