microsoft / teams-ai

SDK focused on building AI based applications and extensions for Microsoft Teams and other Bot Framework channels
MIT License
400 stars 170 forks source link

[Bug]: Missing credentials error when use `azureADTokenProvider` to call Azure OpenAI #2001

Open blackchoey opened 6 days ago

blackchoey commented 6 days ago

Language

Javascript/Typescript

Version

latest

Description

I got follow error when using azureADTokenProvider OpenAIError: Missing credentials. Please pass one of apiKey and azureADTokenProvider, or set the AZURE_OPENAI_API_KEY environment variable.

Reproduction Steps

  1. Use azureADTokenProvider as follow

    image
  2. Run the app

blackchoey commented 5 days ago

Found the root cause, this line sets the wrong parameter: https://github.com/microsoft/teams-ai/blob/main/js/packages/teams-ai/src/models/OpenAIModel.ts#L234