Fix : web search
This commit is contained in:
@@ -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__":
|
||||
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user