From 1c6d48b17495bed1397f11591e204414bb4da9b2 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Mon, 11 Mar 2024 01:02:41 +0100 Subject: [PATCH] moved skills library to lollms ap --- lollms/app.py | 4 ++-- lollms/databases/discussions_database.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lollms/app.py b/lollms/app.py index 2613e15..1f98c55 100644 --- a/lollms/app.py +++ b/lollms/app.py @@ -63,6 +63,7 @@ class LollmsApplication(LoLLMsCom): self.session = Session(lollms_paths) self.skills_library = SkillsLibrary(self.lollms_paths.personal_skills_path/(self.config.skills_lib_database_name+".db")) + if not free_mode: try: if config.auto_update: @@ -131,7 +132,6 @@ class LollmsApplication(LoLLMsCom): def add_discussion_to_skills_library(self, client: Client): messages = client.discussion.get_messages() - db = client.discussion.skills_db # Extract relevant information from messages content = self._extract_content(messages) @@ -145,7 +145,7 @@ class LollmsApplication(LoLLMsCom): category = self._generate_text(category_prompt) # Add entry to skills library - db.add_entry(1, category, title, content) + self.skills_library.add_entry(1, category, title, content) return category, title, content def _extract_content(self, messages:List[Message]): diff --git a/lollms/databases/discussions_database.py b/lollms/databases/discussions_database.py index c8f4009..45c1f7c 100644 --- a/lollms/databases/discussions_database.py +++ b/lollms/databases/discussions_database.py @@ -599,8 +599,7 @@ class Discussion: self.discussion_skills_folder.mkdir(exist_ok=True) self.discussion_rag_folder.mkdir(exist_ok=True) self.messages = self.get_messages() - self.skills_db_path = self.discussion_skills_folder/"skills_db.db" - self.skills_db = SkillsLibrary(self.skills_db_path) + if len(self.messages)>0: self.current_message = self.messages[-1]