How to use PandasAI with azure managed identity?

57 Views Asked by At

PandasAI framework doesn't have the option to use Azure-managed identity. Instead of using the Azure OpenAI API key directly, I want to use azure ad token in code. Is there any possible way toachieve this?

When calling OpenAI directly we use this code:

token_provider = get_bearer_token_provider(DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default")

client = AzureOpenAI(api_version="2024-02-15- preview",azure_endpoint="https://{your_domain}.openai.azure.com/",azure_ad_token_provider=token_provider)

Is there any provision for the same in PandasAI?

0

There are 0 best solutions below