Replies: 1 comment 6 replies
-
I found a similar solved discussion that might help you resolve the issue [1]. The
Here's an example of how to correctly instantiate the from langchain_openai import AzureOpenAIEmbeddings
embedding = AzureOpenAIEmbeddings(
openai_api_version="2024-04-01-preview",
openai_api_type='azure',
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
azure_endpoint=os.getenv("AZURE_OPENAI_ENDPOINT").rstrip("/") + "/openai",
azure_deployment=os.getenv("DEPLOYMENT_NAME"),
validate_base_url=True
) Ensure that your |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
Below is the error i am getting :
Traceback (most recent call last):
File "/home/deepak/Summarizer-bot/langchain_qa.py", line 99, in
print(generate_embeddings("Code of Conduct Policy.pdf"))
File "/home/deepak/Summarizer-bot/langchain_qa.py", line 65, in generate_embeddings
embedding = AzureOpenAIEmbeddings(
File "/home/deepak/Summarizer-bot/envs/lib/python3.10/site-packages/pydantic/main.py", line 212, 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 notopenai_api_base
(or aliasbase_url
). [type=value_error, input_value={'openai_api_version': '2...rue, 'model_kwargs': {}}, input_type=dict]For further information visit https://errors.pydantic.dev/2.9/v/value_error
System Info
langchain==0.3.0
langchain-community==0.3.0
langchain-core==0.3.5
langchain-openai==0.2.0
langchain-text-splitters==0.3.0
langchainhub==0.1.21
ubuntu
openai==1.47.0
Beta Was this translation helpful? Give feedback.
All reactions