diff --git a/prompts/base/planner_agent.txt b/prompts/base/planner_agent.txt index fc86fe2..1cf230b 100644 --- a/prompts/base/planner_agent.txt +++ b/prompts/base/planner_agent.txt @@ -63,8 +63,15 @@ You: Sure, here is the plan: Rules: - Do not write code. You are a planning agent. -- Give clear, detailled order to each agent and how their task relate to the previous task (if any). - Put your plan in a json with the key "plan". -- Always tell the coding agent where to save file, eg: . -- If using multiple coder agent specify how it interact with files of previous coding agent if any. +- Give clear, detailled order to each agent and how their task relate to the previous task (if any). +- You might use a file agent before code agent to setup a project properly. specify folder name. +- specify work folder name to all coding or file agents. +- Always tell the coding agent where to save file, remind them to use their work directory. +- If working on complex coding project. Use a coding agent to define abstract class first and how all file with import and interaction will work. +- Think about how the main.py will import the class from other coding agents. +- Coding agent should use a class based approach. +- One coding agent should work on one file at a time. With clear explanation on how their code interact with previous agents code. - Tell agent to execute without question. +- Only use web agent for finding necessary informations. +- Do not search for tutorial. \ No newline at end of file diff --git a/prompts/jarvis/planner_agent.txt b/prompts/jarvis/planner_agent.txt index de0b8c9..d9b2766 100644 --- a/prompts/jarvis/planner_agent.txt +++ b/prompts/jarvis/planner_agent.txt @@ -64,11 +64,19 @@ You: "At your service. I’ve devised a plan and assigned agents to each task. W Rules: - Do not write code. You are a planning agent. -- Give clear, detailled order to each agent and how their task relate to the previous task (if any). - Put your plan in a json with the key "plan". -- Always tell the coding agent where to save file, eg: . -- If using multiple coder agent specify how it interact with files of previous coding agent if any. +- Give clear, detailled order to each agent and how their task relate to the previous task (if any). +- You might use a file agent before code agent to setup a project properly. specify folder name. +- specify work folder name to all coding or file agents. +- Always tell the coding agent where to save file, remind them to use their work directory. +- If working on complex coding project. Use a coding agent to define abstract class first and how all file with import and interaction will work. +- Think about how the main.py will import the class from other coding agents. +- Coding agent should use a class based approach. +- One coding agent should work on one file at a time. With clear explanation on how their code interact with previous agents code. +- work in different files, 2 coding agent shouln't work in the same file. - Tell agent to execute without question. +- Only use web agent for finding necessary informations. +- Do not search for tutorial. Personality: diff --git a/sources/agents/browser_agent.py b/sources/agents/browser_agent.py index 259882b..b3dd1d5 100644 --- a/sources/agents/browser_agent.py +++ b/sources/agents/browser_agent.py @@ -297,6 +297,7 @@ class BrowserAgent(Agent): unvisited = [None] while not complete: answer, reasoning = self.llm_decide(prompt, show_reasoning = False) + pretty_print('▂'*32, color="status") extracted_form = self.extract_form(answer) if len(extracted_form) > 0: diff --git a/sources/agents/planner_agent.py b/sources/agents/planner_agent.py index 0b9a5b0..d65b67b 100644 --- a/sources/agents/planner_agent.py +++ b/sources/agents/planner_agent.py @@ -37,9 +37,11 @@ class PlannerAgent(Agent): lines = text.strip().split('\n') for line in lines: - if line is None or len(line) == 0: + if line is None: continue line = line.strip() + if len(line) == 0: + continue if '##' in line or line[0].isdigit(): tasks_names.append(line) continue diff --git a/sources/tools/BashInterpreter.py b/sources/tools/BashInterpreter.py index dcc9ab5..6e9f224 100644 --- a/sources/tools/BashInterpreter.py +++ b/sources/tools/BashInterpreter.py @@ -40,6 +40,7 @@ class BashInterpreter(Tools): concat_output = "" for command in commands: + command = f"cd {self.work_dir} && {command}" command = command.replace('\n', '') if self.safe_mode and is_unsafe(commands): return "Unsafe command detected, execution aborted." diff --git a/sources/tools/tools.py b/sources/tools/tools.py index 397fb8b..dac890a 100644 --- a/sources/tools/tools.py +++ b/sources/tools/tools.py @@ -34,12 +34,12 @@ class Tools(): self.client = None self.messages = [] self.config = configparser.ConfigParser() - self.current_dir = self.create_work_dir() + self.work_dir = self.create_work_dir() self.excutable_blocks_found = False self.safe_mode = True def get_work_dir(self): - return self.current_dir + return self.work_dir def check_config_dir_validity(self): """Check if the config directory is valid.""" @@ -116,7 +116,7 @@ class Tools(): return save_path_dir = os.path.dirname(save_path) save_path_file = os.path.basename(save_path) - directory = os.path.join(self.current_dir, save_path_dir) + directory = os.path.join(self.work_dir, save_path_dir) if directory and not os.path.exists(directory): os.makedirs(directory) for block in blocks: