Skip to content

Commit

Permalink
Fix AzureChatCompletion init method for aad auth
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldotyu committed Jan 9, 2024
1 parent 1c00793 commit 8fa1e1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ai-service/routers/LLM.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get_llm():
print("Authenticating to Azure OpenAI with Azure AD Workload Identity")
credential = DefaultAzureCredential()
access_token = credential.get_token("https://cognitiveservices.azure.com/.default")
kernel.add_chat_service("dv", AzureChatCompletion(deployment_name=deployment, endpoint=endpoint, api_key=access_token.token, ad_auth=True))
kernel.add_chat_service("dv", AzureChatCompletion(deployment_name=deployment, endpoint=endpoint, ad_token=access_token.token))
else:
print("Authenticating to Azure OpenAI with OpenAI API key")
kernel.add_chat_service("dv", AzureChatCompletion(deployment_name=deployment, endpoint=endpoint, api_key=api_key))
Expand Down

0 comments on commit 8fa1e1c

Please sign in to comment.