Run the basic workflow

This commit is contained in:
Jenit Jain 2025-08-05 22:06:50 -07:00
parent 32095350a3
commit 75924a2b94
2 changed files with 1426 additions and 9 deletions

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,13 @@ class FinancialSituationMemory:
self.embedding = "text-embedding-3-small"
self.client = OpenAI(base_url=config["backend_url"])
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):
"""Get OpenAI embedding for a text"""