Fixes and added command line tool to run RAG

This commit is contained in:
Vasilije 2023-10-09 21:16:19 +02:00
parent 30678539e7
commit 45a56c9f3d
2 changed files with 6 additions and 2 deletions

View file

@ -298,6 +298,7 @@ async def start_test(data, test_set=None, user_id=None, params=None, job_id=None
session = Session()
#do i need namespace in memory instance, fix it
memory = Memory.create_memory(user_id, session, namespace="SEMANTICMEMORY")
job_id = fetch_job_id(session, user_id = user_id,job_id =job_id)
@ -464,8 +465,8 @@ async def main():
return
else:
params = None
await start_test(args.url, test_set, args.user_id, params, metadata)
#clean up params here
await start_test(args.url, test_set, args.user_id, params=None, metadata=params)
if __name__ == "__main__":
import asyncio

View file

@ -142,6 +142,7 @@ class Memory:
self.short_term_memory = None
self.namespace = namespace
self.memory_instances = []
#inspect and fix this
self.memory_class = DynamicBaseMemory('Memory', user_id, str(self.memory_id), index_name, db_type, namespace)
def load_environment_variables(self) -> None:
load_dotenv()
@ -187,6 +188,8 @@ class Memory:
@staticmethod
def handle_new_user(user_id: str, session):
"""Handle new user creation in the DB and return the new memory ID."""
#handle these better in terms of retry and error handling
memory_id = str(uuid.uuid4())
new_user = User(id=user_id)
session.add(new_user)