doc update and minor fix

This commit is contained in:
arpit-at
2025-04-16 13:27:52 +05:30
parent 0da667d179
commit dc46acb762
2 changed files with 12 additions and 0 deletions

View File

@ -37,6 +37,17 @@ model="" # the OpenAI model you've deployed on Azure (e.g. gpt-4o)
fallback_models=["..."] fallback_models=["..."]
``` ```
To use Azure AD (Entra id) based authentication set in your `.secrets.toml` (working from CLI), or in the GitHub `Settings > Secrets and variables` (working from GitHub App or GitHub Action):
```toml
[azure_ad]
client_id = "" # Your Azure AD application client ID
client_secret = "" # Your Azure AD application client secret
tenant_id = "" # Your Azure AD tenant ID
api_base = "" # Your Azure OpenAI service base URL (e.g., https://openai.xyz.com/)
```
Passing custom headers to the underlying LLM Model API can be done by setting extra_headers parameter to litellm. Passing custom headers to the underlying LLM Model API can be done by setting extra_headers parameter to litellm.
```toml ```toml

View File

@ -100,6 +100,7 @@ class LiteLLMAIHandler(BaseAiHandler):
# Check for Azure AD configuration # Check for Azure AD configuration
if get_settings().get("AZURE_AD.CLIENT_ID", None): if get_settings().get("AZURE_AD.CLIENT_ID", None):
from azure.identity import ClientSecretCredential
self.azure = True self.azure = True
# Generate access token using Azure AD credentials from settings # Generate access token using Azure AD credentials from settings
access_token = self._get_azure_ad_token() access_token = self._get_azure_ad_token()