fix : various bugs & improve memory system

This commit is contained in:
martin legrand
2025-03-23 17:25:49 +01:00
parent caf1b5e9a9
commit 8b5bb28c94
7 changed files with 15 additions and 22 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ class BrowserAgent(Agent):
self.tools = {
"web_search": searxSearch(),
}
self.role = "Web Research"
self.role = "Web surfing, website & news"
self.type = "browser_agent"
self.browser = Browser()
self.current_page = ""
+1 -1
View File
@@ -18,7 +18,7 @@ class CasualAgent(Agent):
"file_finder": FileFinder(),
"bash": BashInterpreter()
}
self.role = "Chat and Conversation"
self.role = "talk, quick search"
self.type = "casual_agent"
def process(self, prompt, speech_module) -> str:
+1 -1
View File
@@ -20,7 +20,7 @@ class CoderAgent(Agent):
"go": GoInterpreter(),
"file_finder": FileFinder()
}
self.role = "Code Assistance"
self.role = "Coding task"
self.type = "code_agent"
def process(self, prompt, speech_module) -> str:
+5 -13
View File
@@ -18,23 +18,15 @@ class FileAgent(Agent):
self.type = "file_agent"
def process(self, prompt, speech_module) -> str:
complete = False
exec_success = False
self.memory.push('user', prompt)
self.wait_message(speech_module)
while not complete:
if exec_success:
complete = True
animate_thinking("Thinking...", color="status")
answer, reasoning = self.llm_request()
exec_success, _ = self.execute_modules(answer)
answer = self.remove_blocks(answer)
self.last_answer = answer
complete = True
for name, tool in self.tools.items():
if tool.found_executable_blocks():
complete = False # AI read results and continue the conversation
animate_thinking("Thinking...", color="status")
answer, reasoning = self.llm_request()
exec_success, _ = self.execute_modules(answer)
answer = self.remove_blocks(answer)
self.last_answer = answer
return answer, reasoning
if __name__ == "__main__":