-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azure open ai llm authorization failure with azure_ad_token_provider #1387
Comments
Hello @qidianshiwei! I'm here to help you with your bug. Let's get this sorted out together. To resolve the authorization failure with Azure OpenAI when using the
By addressing these points, you should be able to resolve the issue. If using |
Authorization with either token_provider or token should work. Both contain azure certifications. That’s how python function openai.lib.azure works. I think pandas-ai should realize the same thing.发自我的 iPhone在 2024年10月8日,17:09,dosubot[bot] ***@***.***> 写道:
Hello @qidianshiwei! I'm here to help you with your bug. Let's get this sorted out together.
To resolve the authorization failure with Azure OpenAI when using the pandasai library and azure_ad_token_provider, ensure the following:
API Key Requirement: The error indicates that an API key is required. You need to provide it either through the environment variables AZURE_OPENAI_API_KEY or OPENAI_API_KEY, or by passing api_token directly as a parameter.
Azure AD Token Provider: Ensure that azure_ad_token_provider is correctly implemented and returns a valid token. It should be a callable function that provides the Azure AD token.
Environment Variables: Double-check that all necessary environment variables are set correctly, including AZURE_OPENAI_API_KEY or OPENAI_API_KEY.
By addressing these points, you should be able to resolve the issue. If using ClientSecretCredential directly works, ensure that the token provider function is correctly configured to generate a valid token.
To continue talking to Dosu, mention @dosu.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
The While |
System Info
python3.11.7 with pandasai library
🐛 Describe the bug
hello,
I try to use pandas-ai library with azureopen-ai producing token.
And I found it failed when I use
It will raise an error
Azure OpenAI key is required. Please add an environment variable
AZURE_OPENAI_API_KEYor
OPENAI_API_KEYor pass
api_tokenas a named parameter
But if I use
ClientSecretCredential( client_id='client_id', client_secret='client_secret', tenant_id='tenant_id' )
to create an valid token, it worksThe text was updated successfully, but these errors were encountered: