We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa0c557 commit 4a30c88Copy full SHA for 4a30c88
chat.py
@@ -12,9 +12,10 @@
12
token_provider = azure.identity.get_bearer_token_provider(
13
azure.identity.DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default"
14
)
15
- client = openai.OpenAI(
16
- base_url=os.environ["AZURE_OPENAI_ENDPOINT"],
17
- api_key=token_provider,
+ client = openai.AzureOpenAI(
+ api_version=os.environ["AZURE_OPENAI_VERSION"],
+ azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
18
+ azure_ad_token_provider=token_provider,
19
20
MODEL_NAME = os.environ["AZURE_OPENAI_DEPLOYMENT"]
21
0 commit comments