Hmmm, it looks like the python langchain_core.documents Documents class was casting metadata to a stringified object. That may be my issue.
Looks like there's no way to do the same in the JS version
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm trying to make calls to a Azure Ai Search index I have already set up. Specifically I'm trying to add documents via the AzureAISearchVectorStore.addDocuments from the "@langchain/community/vectorstores/azure_aisearch" package.
No matter what I've tried I get the error:
Azure AI Search uploadDocuments batch failed: RestError: The request is invalid. Details: An unexpected 'StartObject' node was found for property named 'metadata' when reading from the JSON reader. A 'PrimitiveValue' node was expected
Even if I omit metadata entirely.
My code looks something like this:
const embeddings = new AzureOpenAIEmbeddings({
maxRetries: 1,
// azureOpenAIApiKey etc in env
});
const searchClient = new SearchClient
Hmmm, it looks like the python langchain_core.documents Documents class was casting metadata to a stringified object. That may be my issue.
Looks like there's no way to do the same in the JS version