Skip to content

Commit a1f2e4e

Browse files
committed
Update requirements
1 parent d507b15 commit a1f2e4e

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

text_2_sql/autogen/src/autogen_text_2_sql/creators/llm_model_creator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT License.
3-
from autogen_ext.models import AzureOpenAIChatCompletionClient
3+
from autogen_ext.models.openai import AzureOpenAIChatCompletionClient
44
from text_2_sql_core.utils.environment import IdentityType, get_identity_type
55

66
from azure.identity import DefaultAzureCredential, get_bearer_token_provider
@@ -57,7 +57,7 @@ def gpt_4o_mini_model(cls) -> AzureOpenAIChatCompletionClient:
5757
return AzureOpenAIChatCompletionClient(
5858
azure_deployment=os.environ["OpenAI__MiniCompletionDeployment"],
5959
model=os.environ["OpenAI__MiniCompletionDeployment"],
60-
api_version="2024-08-01-preview",
60+
api_version=os.environ["OpenAI__ApiVersion"],
6161
azure_endpoint=os.environ["OpenAI__Endpoint"],
6262
azure_ad_token_provider=token_provider,
6363
api_key=api_key,
@@ -75,7 +75,7 @@ def gpt_4o_model(cls) -> AzureOpenAIChatCompletionClient:
7575
return AzureOpenAIChatCompletionClient(
7676
azure_deployment=os.environ["OpenAI__CompletionDeployment"],
7777
model=os.environ["OpenAI__CompletionDeployment"],
78-
api_version="2024-08-01-preview",
78+
api_version=os.environ["OpenAI__ApiVersion"],
7979
azure_endpoint=os.environ["OpenAI__Endpoint"],
8080
azure_ad_token_provider=token_provider,
8181
api_key=api_key,

text_2_sql/text_2_sql_core/src/text_2_sql_core/connectors/open_ai.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@ def get_authentication_properties(cls) -> dict:
3434
return token_provider, api_key
3535

3636
async def run_completion_request(self, messages: list[dict], temperature=0):
37+
token_provider, api_key = self.get_authentication_properties()
3738
async with AsyncAzureOpenAI(
38-
api_key=os.environ["OpenAI__ApiKey"],
39-
azure_endpoint=os.environ["OpenAI__Endpoint"],
39+
azure_deployment=os.environ["OpenAI__MiniCompletionDeployment"],
4040
api_version=os.environ["OpenAI__ApiVersion"],
41+
azure_endpoint=os.environ["OpenAI__Endpoint"],
42+
azure_ad_token_provider=token_provider,
43+
api_key=api_key,
4144
) as open_ai_client:
4245
response = await open_ai_client.chat.completions.create(
4346
model=os.environ["OpenAI__MiniCompletionDeployment"],

0 commit comments

Comments
 (0)