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
+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__":