I'm trying to write the following code and it gives me an error. Tried everything, it doesn't work! using
langchain Version: 0.3.19, python 3.11 langchain-openai Version: 0.3.6
Code:
from langchain_openai import AzureOpenAIEmbeddings
openai_embeddings = AzureOpenAIEmbeddings(
azure_endpoint ="https://****.openai.azure/openai",
deployment = "text-embedding-3-large",
openai_api_version = "2023-05-15",
openai_api_key = "****"
)
Later i'm using it for the AzureCosmosDBNoSqlVectorSearch function.
This is the Error:
File "C:\Users\****.py", line 64, in <module>
openai_embeddings = AzureOpenAIEmbeddings(
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\....\venv\Lib\site-packages\pydantic\main.py", line 214, in __init__
validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for AzureOpenAIEmbeddings
Value error, As of openai>=1.0.0, Azure endpoints should be specified via the `azure_endpoint` param not `openai_api_base` (or alias `base_url`). [type=value_error, input_value={'azure_endpoint': 'https...te', 'model_kwargs': {}}, input_type=dict]
For further information visit /2.10/v/value_error
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745154044a4614010.html
评论列表(0条)