moved pinecone api config settings into provider class

This commit is contained in:
cs0lar
2023-04-08 16:11:31 +01:00
parent 97ac802f0c
commit 76a1462e37
2 changed files with 3 additions and 2 deletions

View File

@@ -281,8 +281,6 @@ next_action_count = 0
# Make a constant:
user_input = "Determine which next command to use, and respond using the format specified above:"
# raise an exception if pinecone_api_key or region is not provided
if not cfg.pinecone_api_key or not cfg.pinecone_region: raise Exception("Please provide pinecone_api_key and pinecone_region")
# Initialize memory and make sure it is empty.
# this is particularly important for indexing and referencing pinecone memory
memory = MemoryFactory.get_memory(cfg.memory_provider)

View File

@@ -6,6 +6,9 @@ cfg = Config()
class PineconeMemory(Memory):
def __init__(self):
# raise an exception if pinecone_api_key or region is not provided
if not cfg.pinecone_api_key or not cfg.pinecone_region: raise Exception("Please provide pinecone_api_key and pinecone_region")
pinecone_api_key = cfg.pinecone_api_key
pinecone_region = cfg.pinecone_region
pinecone.init(api_key=pinecone_api_key, environment=pinecone_region)