Reputation: 83287
openai.api_version = "2023-05-15"
openai.api_version = "2023-03-15-preview"
This makes me wonder: How can I select the proper openai.api_version
? Does that depend on my Azure OpenAI instance or deployed models or which features I use in my Python code? Or something else?
I couldn't find the info in my deployed models:
Upvotes: 15
Views: 33288
Reputation: 83287
As a complement to Nicolas R's answer: the API version property also depends on the model you are calling in the API. For example:
Support for the o1 series models was added in API version
2024-09-01-preview
.
Note that, confusingly, if one tries to use an API version that doesn't exist (e.g., 2024-09-01-previewwww
), one gets this error message:
openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}
Upvotes: 2
Reputation: 14619
The API Version property depends on the method you are calling in the API: all methods are not supported in all API versions.
Details are listed here: https://learn.microsoft.com/en-US/azure/cognitive-services/openai/reference
And preview API lifecycle is described here: https://learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation => check those pages for up-to-date references
As of March 7th, 2024: Example: "completions" endpoint is available in the following versions (ordered by date):
But "chat completions" endpoint is available only in the following versions (ordered by date):
Generally, use the latest "not preview" version for production when possible, as the preview versions might be retired on a more frequent basis.
Upvotes: 18
Reputation: 27635
openai.api_version
is removed from openai==1.0.0
You can still find it in openai==0.28
Upvotes: 2