I get the following error:
ValidationError Traceback (most recent call last) Cell In[31], line 1 ----> 1 embeddings = AzureOpenAIEmbeddings( 2 azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"], 3 azure_deployment="text_embedding" 4 )
File ~/Projects/pia_project/venv/lib/python3.9/site-packages/pydantic/v1/main.py:341, in BaseModel.init(pydantic_self, **data) 339 values, fields_set, validation_error = validate_model(pydantic_self.class, data) 340 if validation_error: --> 341 raise validation_error 342 try: 343 object_setattr(pydantic_self, 'dict', values)
ValidationError: 1 validation error for AzureOpenAIEmbeddings root As of openai>=1.0.0, Azure endpoints should be specified via the
azure_endpointparam notopenai_api_base(or aliasbase_url). (type=value_error)
Eventhough, executing the following Code
from langchain_openai import AzureOpenAIEmbeddings, OpenAIEmbeddings
embeddings = AzureOpenAIEmbeddings(
azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
azure_deployment="text_embedding"
)
The strange thing here is that I use the azure_endpoint parameter, but I still get the error. I have access to the OpenAi embedding model via Azure that's why I'm using it this way. How do I solve this issue?
My packages are: openai 1.12.0 langchain 0.1.8 langchain-openai 0.0.6
base_urlparameter. Recheck the code once again.