Skip to content

Conversation

@andrescodas
Copy link

allow the user to pass the azure_ad_token_provider as in https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/managed-identity#chat-completions to AzureChat.

The included jupyter notebook quickstart_azure.ipynb run the same example as quickstart.ipynb, however, it uses AzureChat with a azure_ad_token_provider

@t-schn
Copy link
Collaborator

t-schn commented Mar 14, 2025

Hi @andrescodas - thanks so much for putting this in! I was wondering whether it would be cleaner to use api_key for also the azure token provider. In the runner class, we could then check via callable(config["api_key"]). What do you think?

@andrescodas
Copy link
Author

Hi!. I think it could be confusing, because these refer to different authorization methods. The api_key is interfaced in the headers with

            headers = {"api_key": "my_api_key"}

while a token is interfaced with:

            headers = {"Authorization": "Bearer my_token"}

Copy link
Collaborator

@t-schn t-schn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants