Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion swirl/openai/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def _init_openai_client(self, provider, key):
ai_client = OpenAI(api_key=key)
elif provider == "AZUREAI":
from openai import AzureOpenAI
ai_client = AzureOpenAI(api_key=key, azure_endpoint=self._azure_endpoint, api_version="2023-10-01-preview")
self._azure_api_version = getattr(settings, "AZURE_API_VERSION", None)
ai_client = AzureOpenAI(api_key=key, azure_endpoint=self._azure_endpoint, api_version=self._azure_api_version)
else:
raise NotImplementedError(f"Unknown AI provider {provider}. Client initialization not supported.")
except Exception as err:
Expand Down
1 change: 1 addition & 0 deletions swirl_server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@
AZURE_OPENAI_KEY = env.get_value('AZURE_OPENAI_KEY', default='')
AZURE_OPENAI_ENDPOINT = env.get_value('AZURE_OPENAI_ENDPOINT', default='')
AZURE_MODEL = env.get_value('AZURE_MODEL', default='')
AZURE_API_VERSION = os.getenv("AZURE_API_VERSION", default='')

# Defines for RAG ChatGPT models
CGPT_MODEL_3 = "gpt-3.5-turbo"
Expand Down