Fix : web search

This commit is contained in:
martin legrand
2025-03-11 12:27:19 +01:00
parent ed02a4dad0
commit 479bc2769b
7 changed files with 32 additions and 10 deletions
+5 -3
View File
@@ -18,7 +18,7 @@ class CasualAgent(Agent):
"file_finder": FileFinder(),
"bash": BashInterpreter()
}
self.role = "talking, advices and philosophical"
self.role = "talking, advices, events and philosophical"
def process(self, prompt, speech_module) -> str:
complete = False
@@ -32,8 +32,10 @@ class CasualAgent(Agent):
exec_success, _ = self.execute_modules(answer)
answer = self.remove_blocks(answer)
self.last_answer = answer
if exec_success:
complete = True
complete = True
for tool in self.tools.values():
if tool.found_executable_blocks():
complete = False # AI read results and continue the conversation
return answer, reasoning
if __name__ == "__main__":
+3
View File
@@ -81,6 +81,9 @@ class PlannerAgent(Agent):
speech_module.speak(f"I will {task_name}. I assigned the {task['agent']} agent to the task.")
try:
self.agents[task['agent'].lower()].process(agent_prompt, None)
pretty_print(f"-- Agent answer ---\n\n", color="output")
self.agents[task['agent'].lower()].show_answer()
pretty_print(f"\n\n", color="output")
except Exception as e:
pretty_print(f"Error: {e}", color="failure")
speech_module.speak(f"I encountered an error: {e}")