Skip to content

Commit 4a30c88

Browse files
committed
Revert chat.py changes
1 parent fa0c557 commit 4a30c88

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

chat.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
token_provider = azure.identity.get_bearer_token_provider(
1313
azure.identity.DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default"
1414
)
15-
client = openai.OpenAI(
16-
base_url=os.environ["AZURE_OPENAI_ENDPOINT"],
17-
api_key=token_provider,
15+
client = openai.AzureOpenAI(
16+
api_version=os.environ["AZURE_OPENAI_VERSION"],
17+
azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
18+
azure_ad_token_provider=token_provider,
1819
)
1920
MODEL_NAME = os.environ["AZURE_OPENAI_DEPLOYMENT"]
2021

0 commit comments

Comments
 (0)