lock the second pinecone index behind GCP key (disable this)

Kaveen Kumarasinghe 1 year ago
parent bb22d66f48
commit 36ef6e9115

@ -62,14 +62,15 @@ if PINECONE_TOKEN:
pod_type="s1", pod_type="s1",
) )
PINECONE_INDEX_SEARCH = "search-embeddings" PINECONE_INDEX_SEARCH = "search-embeddings"
if PINECONE_INDEX_SEARCH not in pinecone.list_indexes(): if EnvService.get_google_search_api_key() and EnvService.get_google_search_engine_id():
print("Creating pinecone index for seraches. Please wait...") if PINECONE_INDEX_SEARCH not in pinecone.list_indexes():
pinecone.create_index( print("Creating pinecone index for seraches. Please wait...")
PINECONE_INDEX_SEARCH, pinecone.create_index(
dimension=1536, PINECONE_INDEX_SEARCH,
metric="dotproduct", dimension=1536,
pod_type="s1", metric="dotproduct",
) pod_type="s1",
)
pinecone_service = PineconeService(pinecone.Index(PINECONE_INDEX)) pinecone_service = PineconeService(pinecone.Index(PINECONE_INDEX))
pinecone_search_service = PineconeService(pinecone.Index(PINECONE_INDEX_SEARCH)) pinecone_search_service = PineconeService(pinecone.Index(PINECONE_INDEX_SEARCH))

Loading…
Cancel
Save