I'm having trouble using LangChain embedding with Azure OpenAI credentials - it's showing a 404 error for resource not found.
stack trace: Error: 404 Resource not found
at APIError.generate (c:\abcproject\node_modules\openai\error.js:53:20
import { OpenAIEmbeddings } from "@langchain/openai"
export const embeddingModel = new OpenAIEmbeddings({
azureOpenAIApiKey: "AzureOpenAI api key",
azureOpenAIApiVersion: "2023-08-01-preview",
azureOpenAIApiDeploymentName: "gpt-4-32k",
azureOpenAIBasePath:"Azure OpenAI endpoint"
});
The definition of your OpenAIEmbeddings
class is incorrect: you should not have something related to gpt
models for embeddings, but "text-embedding-ada-002" instead.
Try modifying your azureOpenAIApiDeploymentName
value or better use modelName
(see doc)