Skip to content

Commit

Permalink
Fix api_version
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudotensor committed Jun 7, 2024
1 parent 76d6eda commit a774668
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1624,10 +1624,8 @@ def set_openai(inference_server, model_name=None):
if api_version in ['None', None]:
# for function tools support
# https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-12-01-preview
if model_name is not None and (model_name.startswith('gpt-4-turbo-2024-04-09') or model_name.startswith('gpt-4o')):
api_version = "2024-05-13"
else:
api_version = "2024-04-01-preview"
# https://learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation
api_version = "2024-05-01-preview"
if os.getenv('OPENAI_AZURE_KEY') is not None:
# use this instead if exists
api_key = os.getenv("OPENAI_AZURE_KEY")
Expand Down
2 changes: 1 addition & 1 deletion src/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "f399da9f31be1fc14ed24136b43124ee101e3c1d"
__version__ = "76d6eda1bbd606be56cc03e39d4e557f773a9edb"

0 comments on commit a774668

Please sign in to comment.