You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I included a link to the documentation page I am referring to (if applicable).
Issue with current documentation:
The provided example code in the LangChain documentation for using PineconeStore is incomplete as it does not initialize or create the pineconeIndex variable.
import { PineconeStore } from "@langchain/pinecone";
import { Pinecone as PineconeClient } from "@pinecone-database/pinecone";
const pinecone = new PineconeClient();
const vectorStore = new PineconeStore(embeddings, {
pineconeIndex,
maxConcurrency: 5,
});
The variable pineconeIndex is used without being initialized or created. This will result in an error when running the code.
Idea or request for content:
The code can be fixed by adding the initialization of pineconeIndex using the pinecone.Index()
import { PineconeStore } from "@langchain/pinecone";
import { Pinecone as PineconeClient } from "@pinecone-database/pinecone";
const PINECONE_API_KEY:any = process.env.PINECONE_API_KEY
const pinecone = new PineconeClient({
apiKey: PINECONE_API_KEY
});
const pineconeIndex = pinecone.Index("rag"); // Initialize the Pinecone index
const vectorStore = new PineconeStore(embeddings, {
pineconeIndex,
maxConcurrency: 5,
});
Also added the API key since it was not mentioned in the docs either.
The text was updated successfully, but these errors were encountered:
dosubotbot
added
the
🤖:docs
Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder
label
Jan 28, 2025
URL
https://js.langchain.com/docs/tutorials/rag/
Checklist
Issue with current documentation:
The provided example code in the LangChain documentation for using PineconeStore is incomplete as it does not initialize or create the pineconeIndex variable.
The variable pineconeIndex is used without being initialized or created. This will result in an error when running the code.
Idea or request for content:
The code can be fixed by adding the initialization of pineconeIndex using the pinecone.Index()
import { PineconeStore } from "@langchain/pinecone";
import { Pinecone as PineconeClient } from "@pinecone-database/pinecone";
const PINECONE_API_KEY:any = process.env.PINECONE_API_KEY
const pinecone = new PineconeClient({
apiKey: PINECONE_API_KEY
});
const pineconeIndex = pinecone.Index("rag"); // Initialize the Pinecone index
const vectorStore = new PineconeStore(embeddings, {
pineconeIndex,
maxConcurrency: 5,
});
Also added the API key since it was not mentioned in the docs either.
The text was updated successfully, but these errors were encountered: