Find answers from the community

Updated 7 months ago

Seeing above error message when using

At a glance

The community member is encountering a validation error when using the llama-index-embeddings-azure-openai version 0.2.2. The error message indicates that the azure_ad_token_provider field in the AzureOpenAIEmbedding class expects a callable (a function), but it's receiving None instead. The community member is passing in an api_key as they always did, and they're wondering what's wrong and why the validation is failing.

In the comments, other community members suggest updating the llama-index-embeddings-azure-openai package by running pip install -U llama-index-embeddings-azure-openai. However, there is no explicitly marked answer to the original issue.

Useful resources
Seeing above error message when using
llama-index-embeddings-azure-openai
version 0.2.2

The error message I'm encountering indicates that the azure_ad_token_provider field in the AzureOpenAIEmbedding class expects a callable (i.e., a function), but it's receiving None instead. This is causing the validation to fail. I'm passing in an api_key as I always did, wonder what's wrong here and why it's throwing a vliadation error?

```
llm = AzureOpenAI(
model="gpt-4o",
deployment_name="gpt-4o",
api_key=aoai_api_key,
azure_endpoint=aoai_endpoint,
api_version=aoai_api_version,
)

embed_model = AzureOpenAIEmbedding(
model="text-embedding-ada-002",
deployment_name="text-embedding-ada-002",
api_key=aoai_api_key,
azure_endpoint=aoai_endpoint,
api_version=aoai_api_version,
)
ValidationError: 1 validation error for AzureOpenAIEmbedding
azure_ad_token_provider
Input should be callable [type=callable_type, input_value=None, input_type=NoneType]
Add a reply
Sign up and join the conversation on Discord