Run the basic workflow
This commit is contained in:
parent
32095350a3
commit
75924a2b94
File diff suppressed because it is too large
Load Diff
|
|
@ -11,7 +11,13 @@ class FinancialSituationMemory:
|
||||||
self.embedding = "text-embedding-3-small"
|
self.embedding = "text-embedding-3-small"
|
||||||
self.client = OpenAI(base_url=config["backend_url"])
|
self.client = OpenAI(base_url=config["backend_url"])
|
||||||
self.chroma_client = chromadb.Client(Settings(allow_reset=True))
|
self.chroma_client = chromadb.Client(Settings(allow_reset=True))
|
||||||
self.situation_collection = self.chroma_client.create_collection(name=name)
|
# Check if collection exists
|
||||||
|
try:
|
||||||
|
self.situation_collection = self.chroma_client.get_collection(name=name)
|
||||||
|
except:
|
||||||
|
# Collection doesn't exist, create it
|
||||||
|
self.situation_collection = self.chroma_client.create_collection(name=name)
|
||||||
|
# self.situation_collection = self.chroma_client.create_collection(name=name)
|
||||||
|
|
||||||
def get_embedding(self, text):
|
def get_embedding(self, text):
|
||||||
"""Get OpenAI embedding for a text"""
|
"""Get OpenAI embedding for a text"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue