Error "{'code': '404', 'message': 'Resource not found'}" #25523
Replies: 1 comment 2 replies
-
Hello @mnbenavides! I'm here to help you with any bugs, questions, or becoming a contributor. Let's squash those bugs together! 🤖 To resolve the "Resource not found" error when using
Here is an example of how to instantiate the import os
from langchain_community.embeddings.openai import OpenAIEmbeddings
os.environ["AZURE_OPENAI_ENDPOINT"] = "https://<your-endpoint>.openai.azure.com/"
os.environ["AZURE_OPENAI_API_KEY"] = "your-api-key"
os.environ["OPENAI_API_VERSION"] = "2023-05-15"
def get_embedding_function():
embeddings = OpenAIEmbeddings(
azure_endpoint=os.environ['AZURE_OPENAI_ENDPOINT'],
deployment="text-embedding-ada-002",
openai_api_key=os.environ['AZURE_OPENAI_API_KEY'],
openai_api_version=os.environ['OPENAI_API_VERSION'],
model="text-embedding-ada-002",
)
return embeddings Ensure that the environment variables are set correctly if you are not passing them directly: export AZURE_OPENAI_API_KEY="your-api-key"
export AZURE_OPENAI_ENDPOINT="https://<your-endpoint>.openai.azure.com/"
export OPENAI_API_VERSION="2023-05-15" By verifying and correctly setting these parameters, you should be able to resolve the "Resource not found" error [1][2]. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I have already followed the steps provided:
I double-checked the environment variables multiple times to ensure that AZURE_OPENAI_ENDPOINT and OPENAI_API_VERSION are correctly set.
I confirmed that the deployment name exactly matches the "Model Deployment Name" in the Azure Portal.
I installed the openai package and updated it to the latest version available.
*I tested the text-embedding-3-large, text-embedding-ada-002, and gpt-4o models to check for functionality.
I also verified that the authentication with AZURE_OPENAI_API_KEY is correctly configured.
Despite these efforts, I am still encountering the same issue. I would appreciate any additional assistance you can provide to help resolve this.
log in to azure cli
Thank you in advance for your support.
System Info
"pip install -U langchain_openai"
Langchain (Version --> 0.2.14)
Phyton (Version --> 3.12.5)
Windows (Version --> Windows 11 pro )
Azure cli (Version --> 2.63.0)
Beta Was this translation helpful? Give feedback.
All reactions