I have been trying Canopy to build out a serverless index and now trying to retrofit a legacy chatbot to refer to the new serverless index but it is not finding the resource even after upgrading libraries… note I have run and installed canopy from another machine to create the index so canopy is not installed on the bot server, but I have upgraded pinecone-client and langchain accordingly (versions below).
I have this basic setup in python:
from openai import OpenAI
import secrets
import langchain
from langchain_openai import OpenAIEmbeddings
from langchain.chains import RetrievalQA
from pinecone import Pinecone
from pinecone import ServerlessSpec, PodSpec
from langchain_community.vectorstores import Pinecone as pcvs
and connection as like this:
pc = Pinecone(api_key=pinecone_api_key)
index = pc.Index(vectordb)
where vectordb is the name of the canopy serverless index and I have confirmed I can see this index like this no problem (so API key appears fine):
for index in pc.list_indexes():
print(index['name'])
but this line results in a not found error:
index = pc.Index(vectordb)
{“error”:{“code”:“NOT_FOUND”,“message”:“Resource canopy–indexname not found”},“status”:404}
this feels like a dependency version issue but since I was able to list indexes it did at least partially work as-is… versions of packages below on python 3.11:
openai: Version: 1.10.0
langchain: 0.1.4
langchain_community: 0.0.14
langchain_openai: 0.0.5
pinecone-client: 3.0.2
any help appreciated- been stuck a while trying to troubleshoot
thanks!
here’s a little more of the error info from the client call; replaced index name with “canopy–indexname” but that name is confirmed correct per above list command.
pinecone/core/client/rest.py", line 255, in request
raise NotFoundException(http_resp=r)
pinecone.core.client.exceptions.NotFoundException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({‘content-type’: ‘text/plain; charset=utf-8’, ‘access-control-allow-origin’: ‘', ‘vary’: ‘origin,access-control-request-method,access-control-request-headers’, ‘access-control-expose-headers’: '’, ‘X-Cloud-Trace-Context’: ‘72e3c60d0cccbc4dde1a00a649552e20’, ‘Date’: ‘Tue, 30 Jan 2024 17:44:01 GMT’, ‘Server’: ‘Google Frontend’, ‘Content-Length’: ‘93’, ‘Via’: ‘1.1 google’, ‘Alt-Svc’: ‘h3=“:443”; ma=2592000,h3-29=“:443”; ma=2592000’})
HTTP response body: {“error”:{“code”:“NOT_FOUND”,“message”:“Resource canopy–indexname not found”},“status”:404}
EDIT: through testing have discovered this works fine with isolated Python call but since the above is being called from a flask app presumably over http it seems the request is not formatted properly for the serverless Pinecone-client; however from documentation having a tough time finding what the issue could be with the request - still stuck !