added rag databases

This commit is contained in:
Saifeddine ALOUI 2024-06-17 01:49:17 +02:00
parent bdebae5d71
commit 6a7346f930
2 changed files with 5 additions and 1 deletions

View File

@ -16,6 +16,7 @@ class Client:
self.db_name = db
self.rooms = set()
self.rag_databases = []
self.generated_text = ""
self.cancel_generation = False
self.generation_thread:Thread = None

View File

@ -148,6 +148,7 @@ def select_rag_database() -> Optional[Dict[str, Path]]:
print(f"Added document: {title}")
except Exception as e:
print(f"Failed to add document {fn}: {e}")
lollmsElfServer.HideBlockingMessage()
return {"database_name": db_name, "database_path": Path(folder_path)}
except:
lollmsElfServer.HideBlockingMessage()
@ -207,5 +208,7 @@ def mount_rag_database(database_infos: MountDatabase):
"""
Selects and names a database
"""
check_access(lollmsElfServer, database_infos.client_id)
client = check_access(lollmsElfServer, database_infos.client_id)
client.rag_databases.append(database_infos.database_name)
return select_rag_database()