How do I solve this Pinecone setup error I keep getting?

76 Views Asked by At

I keep getting this error while tying to use Pinecone as vector store for my Langchain project, what might be wrong?

your try catch block error is PineconeArgumentError: The argument to describeIndex had type errors: argument must be string.

Here is my code:

    const pinecone = new Pinecone();

    const pineconeIndex = pinecone.Index();

    const docs = [
      new Document({
        metadata: { foo: "bar" },
        pageContent: "pinecone is a vector db",
      }),
      new Document({
        metadata: { foo: "bar" },
        pageContent: "the quick brown fox jumped over the lazy dog",
      }),
      new Document({
        metadata: { baz: "qux" },
        pageContent: "lorem ipsum dolor sit amet",
      }),
      new Document({
        metadata: { baz: "qux" },
        pageContent: "pinecones are the woody fruiting body and of a pine tree",
      }),
    ];

    await PineconeStore.fromDocuments(docs, new OpenAIEmbeddings(), {
      pineconeIndex,
      maxConcurrency: 5, // Maximum number of batch requests to allow at once. Each batch is 1000 vectors.
    });
0

There are 0 best solutions below