添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

const client = await getPineconeClient()
const pineconeIndex = client.Index(‘pdfreadr’)

console.log(‘inserting vectors into pinecone’);
const namespace = convertToAscii(fileKey)
PineconeUtils.chunkedUpsert(pineconeIndex, vectors, namespace, 10)

getting an error on pineconeIndex: Type ‘Index’ is missing the following properties from type ‘VectorOperationsApi’: _deleteRaw, _delete, delete1Raw, delete1, and 16 more.ts(2345)

got the same error. the chunkedUpsert method is deprecated. instead you have to do

    const client = await getPineconeClient();
    const pineconeIndex = client.Index('chatpdf');
    console.log("inserting vectors into pinecone");
    pineconeIndex.upsert(vectors);

IMPORANT!

“vectors” has to be of type PineconeRecord and not of type Vector

so this could look like this then

return {
            id: hash,
            values: embeddings,
            metadata: {
                text: doc.metadata.text,
                pageNumber: doc.metadata.pageNumber,
        } as PineconeRecord

for details see here