langchainjs icon indicating copy to clipboard operation
langchainjs copied to clipboard

PineClient: Error calling upsert

Open mayooear opened this issue 1 year ago • 14 comments

As per the docs and latest Pinecone library, the code below should work. However, the function PineconStore.fromDocuments throws an error as per below. It appears there is an issue passing the vectors to Pinecone.

code:

const pinecone = new PineconeClient();
    await pinecone.init({
      environment: `${process.env.PINECONE_ENVIRONMENT}`,
      apiKey: `${process.env.PINECONE_API_KEY}`,
    });
    const index = pinecone.Index("langchainjsfundamentals");

// this is the cause of the error
        const vectorStore = await PineconeStore.fromDocuments(
      index,
      docs,
      new OpenAIEmbeddings()
    );

Error log: error PineconeClient: Error calling upsert: PineconeClient: Error calling upsertRaw: RequiredError: Required parameter requestParameters.upsertRequest was null or undefined when calling upsert.

mayooear avatar Feb 28 '23 03:02 mayooear