semantic-search-nextjs-pinecone-langchain-chatgpt icon indicating copy to clipboard operation
semantic-search-nextjs-pinecone-langchain-chatgpt copied to clipboard

Update syntax for pinecone related code

Open Ed-Marcavage opened this issue 1 year ago • 1 comments

Pinecone no longer supports an envirorment parm on init. Also init langchain's OpenAI object with gpt-3.5-turbo as text-davinci-003 has been deprecated

Ed-Marcavage avatar Feb 26 '24 00:02 Ed-Marcavage

Needed to refactor because Pinecone's console no longer gives you a PINECONE_ENVIRONMENT value as seen in the screenshot below and stated here in their docs:

"On the new Pinecone API, you no longer choose a single cloud environment for a project. Instead, you choose a cloud environment for each index in a project."

  • https://docs.pinecone.io/docs/projects)

So this was no longer valid and need to be updated to 2.0.1:

  const client = new Pinecone({
    apiKey: process.env.PINECONE_API_KEY || '',
    environment: process.env.PINECONE_ENVIRONMENT || ''
  })
image

Ed-Marcavage avatar Feb 26 '24 01:02 Ed-Marcavage