Commit da828789

Gerardo Lecaros <gerardo.lecaros.e@gmail.com>
2023-05-19 06:26:57
Updating code and readme to reference the Azure's newest 2023-05-15 API version. (#452)
1 parent 2b21516
Changed files (2)
openai/__init__.py
@@ -50,7 +50,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 = 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
README.md
@@ -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"}])
@@ -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"
 
 # ...
 ```