[알게된 것] pineconeIndex VectorOperationsApi

Chobby·2023년 10월 30일
1

알게된 것

목록 보기
25/50

😀문제상황

pinecone을 활용하며, 인덱스를 불러올 때 pinecone.Index 명령어로 생성한 인자가 타입 문제를 일으킴

const vectorStore = await PineconeStore.fromExistingIndex(embeddings, {
    pineconeIndex,
    namespace: file.id,
  });

😁해결방법

import { Pinecone } from "@pinecone-database/pinecone";

export const getPineconeClient = async () => {
  const client = new Pinecone({
    apiKey: process.env.PINECONE_API_KEY!,
    environment: "gcp-starter",
  });

  return client;
};

Pinecone 생성 방식이 변경되었으므로, 맞게 변경함

profile
내 지식을 공유할 수 있는 대담함

0개의 댓글