Skip to content
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

Make azure_ad_token_provider customizable. #4931

Open
wants to merge 2 commits into
base: 0.2
Choose a base branch
from

Conversation

chinganc
Copy link
Collaborator

@chinganc chinganc commented Jan 7, 2025

Why are these changes needed?

Currently, when using azure openai, azure_ad_token_provider in OAI_CONFIG_LIST can only take a value of "DEFAULT" which uses the default token provider "https://cognitiveservices.azure.com/.default".

This patch would allow users providing custom token providers by setting azure_ad_token_provider to other values.

Checks

@ekzhu
Copy link
Collaborator

ekzhu commented Jan 7, 2025

You can run pre-commit --all-files to fix the formating

@@ -472,11 +472,14 @@ def _configure_azure_openai(self, config: Dict[str, Any], openai_config: Dict[st
openai_config["azure_endpoint"] = openai_config.get("azure_endpoint", openai_config.pop("base_url", None))

# Create a default Azure token provider if requested
if openai_config.get("azure_ad_token_provider") == "DEFAULT":
Copy link
Member

Choose a reason for hiding this comment

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

Default is meant to refer to the DefaultAzureCredential, however the parameter that is being changed here is the scope. I feel it should be added as a separate parameter that is correctly named

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.

3 participants