From da7dde23d49848e6fb259354e257ccc2329b1414 Mon Sep 17 00:00:00 2001 From: martin legrand Date: Mon, 28 Apr 2025 10:24:30 +0200 Subject: [PATCH] feat : display planner next task on front --- prompts/base/planner_agent.txt | 1 + sources/agents/code_agent.py | 2 +- sources/agents/planner_agent.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/prompts/base/planner_agent.txt b/prompts/base/planner_agent.txt index fd9f780..a4762d3 100644 --- a/prompts/base/planner_agent.txt +++ b/prompts/base/planner_agent.txt @@ -81,4 +81,5 @@ Rules: - Do not search for tutorial. - Make sure json is within ```json tag - Coding agent should write the whole code in a single file unless instructed otherwise. +- Do not use python for NLP analysis of a text, you can review a text with the casual agent - One step, one agent. \ No newline at end of file diff --git a/sources/agents/code_agent.py b/sources/agents/code_agent.py index b503619..10c7854 100644 --- a/sources/agents/code_agent.py +++ b/sources/agents/code_agent.py @@ -35,7 +35,7 @@ class CoderAgent(Agent): info = f"System Info:\n" \ f"OS: {platform.system()} {platform.release()}\n" \ f"Python Version: {platform.python_version()}\n" \ - f"\nYou must save file in work directory: {self.work_dir}" + f"\nYou must save file at root directory: {self.work_dir}" return f"{prompt}\n\n{info}" async def process(self, prompt, speech_module) -> str: diff --git a/sources/agents/planner_agent.py b/sources/agents/planner_agent.py index 6aa9024..afb91d2 100644 --- a/sources/agents/planner_agent.py +++ b/sources/agents/planner_agent.py @@ -224,7 +224,6 @@ class PlannerAgent(Agent): self.agents[task['agent'].lower()].show_answer() pretty_print(f"Agent {task['agent']} completed task.", color="status") self.logger.info(f"Agent {task['agent']} finished working on {task['task']}. Success: {success}") - # TODO ajouter feedback / agent et code executer agent_answer += "\nAgent succeeded with task." if success else "\nAgent failed with task (Error detected)." return agent_answer, success @@ -257,6 +256,7 @@ class PlannerAgent(Agent): task_name, task = agents_tasks[i][0], agents_tasks[i][1] self.status_message = "Starting agents..." pretty_print(f"I will {task_name}.", color="info") + self.last_answer = f"I will {task_name.lower()}." pretty_print(f"Assigned agent {task['agent']} to {task_name}", color="info") if speech_module: speech_module.speak(f"I will {task_name}. I assigned the {task['agent']} agent to the task.")