mirror of
https://github.com/tcsenpai/agenticSeek.git
synced 2025-06-07 03:25:32 +00:00
Merge pull request #101 from Fosowl/dev
Feat : planner prompt improvement + enhance display + new readme image
This commit is contained in:
commit
139f8cdc11
BIN
media/examples/pong.png
Normal file
BIN
media/examples/pong.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 558 KiB |
Binary file not shown.
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 2.8 MiB |
BIN
media/whale_reame_old.jpg
Normal file
BIN
media/whale_reame_old.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 104 KiB |
@ -49,6 +49,6 @@ Some rules:
|
|||||||
- Do not ever use user input, input are not supported by the system.
|
- Do not ever use user input, input are not supported by the system.
|
||||||
- Do not ever tell user how to run it. user know it.
|
- Do not ever tell user how to run it. user know it.
|
||||||
- For simple explanation you don't need to code.
|
- For simple explanation you don't need to code.
|
||||||
- If using gui, make sure echap close the program
|
- If using gui, make sure echap or exit button close the program
|
||||||
- No lazyness, write and rewrite full code every time
|
- No lazyness, write and rewrite full code every time
|
||||||
- If query is unclear say REQUEST_CLARIFICATION
|
- If query is unclear say REQUEST_CLARIFICATION
|
@ -63,8 +63,15 @@ You: Sure, here is the plan:
|
|||||||
|
|
||||||
Rules:
|
Rules:
|
||||||
- Do not write code. You are a planning agent.
|
- 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".
|
- Put your plan in a json with the key "plan".
|
||||||
- Always tell the coding agent where to save file, eg: .
|
- Give clear, detailled order to each agent and how their task relate to the previous task (if any).
|
||||||
- If using multiple coder agent specify how it interact with files of previous coding agent 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.
|
- Tell agent to execute without question.
|
||||||
|
- Only use web agent for finding necessary informations.
|
||||||
|
- Do not search for tutorial.
|
@ -64,11 +64,19 @@ You: "At your service. I’ve devised a plan and assigned agents to each task. W
|
|||||||
|
|
||||||
Rules:
|
Rules:
|
||||||
- Do not write code. You are a planning agent.
|
- 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".
|
- Put your plan in a json with the key "plan".
|
||||||
- Always tell the coding agent where to save file, eg: .
|
- Give clear, detailled order to each agent and how their task relate to the previous task (if any).
|
||||||
- If using multiple coder agent specify how it interact with files of previous coding agent 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.
|
- Tell agent to execute without question.
|
||||||
|
- Only use web agent for finding necessary informations.
|
||||||
|
- Do not search for tutorial.
|
||||||
|
|
||||||
Personality:
|
Personality:
|
||||||
|
|
||||||
|
@ -20,9 +20,9 @@ class executorResult:
|
|||||||
self.success = success
|
self.success = success
|
||||||
|
|
||||||
def show(self):
|
def show(self):
|
||||||
pretty_print("-"*100, color="output")
|
pretty_print('▂'*64, color="status")
|
||||||
pretty_print(self.block, color="code" if self.success else "failure")
|
pretty_print(self.block, color="code" if self.success else "failure")
|
||||||
pretty_print("-"*100, color="output")
|
pretty_print('▂'*64, color="status")
|
||||||
pretty_print(self.feedback, color="success" if self.success else "failure")
|
pretty_print(self.feedback, color="success" if self.success else "failure")
|
||||||
|
|
||||||
class Agent():
|
class Agent():
|
||||||
|
@ -297,6 +297,7 @@ class BrowserAgent(Agent):
|
|||||||
unvisited = [None]
|
unvisited = [None]
|
||||||
while not complete:
|
while not complete:
|
||||||
answer, reasoning = self.llm_decide(prompt, show_reasoning = False)
|
answer, reasoning = self.llm_decide(prompt, show_reasoning = False)
|
||||||
|
pretty_print('▂'*32, color="status")
|
||||||
|
|
||||||
extracted_form = self.extract_form(answer)
|
extracted_form = self.extract_form(answer)
|
||||||
if len(extracted_form) > 0:
|
if len(extracted_form) > 0:
|
||||||
|
@ -61,6 +61,8 @@ class CoderAgent(Agent):
|
|||||||
self.last_answer = answer
|
self.last_answer = answer
|
||||||
if exec_success:
|
if exec_success:
|
||||||
break
|
break
|
||||||
|
pretty_print("Execution failure", color="failure")
|
||||||
|
pretty_print("Correcting code...", color="status")
|
||||||
self.show_answer()
|
self.show_answer()
|
||||||
attempt += 1
|
attempt += 1
|
||||||
if attempt == max_attempts:
|
if attempt == max_attempts:
|
||||||
|
@ -37,9 +37,11 @@ class PlannerAgent(Agent):
|
|||||||
|
|
||||||
lines = text.strip().split('\n')
|
lines = text.strip().split('\n')
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if line is None or len(line) == 0:
|
if line is None:
|
||||||
continue
|
continue
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
if len(line) == 0:
|
||||||
|
continue
|
||||||
if '##' in line or line[0].isdigit():
|
if '##' in line or line[0].isdigit():
|
||||||
tasks_names.append(line)
|
tasks_names.append(line)
|
||||||
continue
|
continue
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import readline
|
||||||
from typing import List, Tuple, Type, Dict
|
from typing import List, Tuple, Type, Dict
|
||||||
|
|
||||||
from sources.text_to_speech import Speech
|
from sources.text_to_speech import Speech
|
||||||
|
@ -108,6 +108,7 @@ class AgentRouter:
|
|||||||
("Search the web for recent articles on space exploration", "LOW"),
|
("Search the web for recent articles on space exploration", "LOW"),
|
||||||
("Find a public API for movie data and build a web app to display movie ratings", "HIGH"),
|
("Find a public API for movie data and build a web app to display movie ratings", "HIGH"),
|
||||||
("Write a bash script to list all files in a directory", "LOW"),
|
("Write a bash script to list all files in a directory", "LOW"),
|
||||||
|
("when is the exam period for master student in france?", "LOW"),
|
||||||
("Check if a folder named ‘Photos_2024’ exists on my desktop", "LOW"),
|
("Check if a folder named ‘Photos_2024’ exists on my desktop", "LOW"),
|
||||||
("Create a Python script to rename all files in a folder based on their creation date", "LOW"),
|
("Create a Python script to rename all files in a folder based on their creation date", "LOW"),
|
||||||
("Search the web for tutorials on machine learning and build a simple ML model in Python", "HIGH"),
|
("Search the web for tutorials on machine learning and build a simple ML model in Python", "HIGH"),
|
||||||
@ -163,6 +164,8 @@ class AgentRouter:
|
|||||||
("Help me organize my desktop files into folders by type.", "files"),
|
("Help me organize my desktop files into folders by type.", "files"),
|
||||||
("What’s your favorite movie and why?", "talk"),
|
("What’s your favorite movie and why?", "talk"),
|
||||||
("what directory are you in ?", "files"),
|
("what directory are you in ?", "files"),
|
||||||
|
("what files you seing rn ?", "files"),
|
||||||
|
("When is the period of university exam in france ?", "web"),
|
||||||
("Search my drive for a file named budget_2024.xlsx", "files"),
|
("Search my drive for a file named budget_2024.xlsx", "files"),
|
||||||
("Write a Python function to sort a list of dictionaries by key", "code"),
|
("Write a Python function to sort a list of dictionaries by key", "code"),
|
||||||
("Find the latest updates on quantum computing on the web", "web"),
|
("Find the latest updates on quantum computing on the web", "web"),
|
||||||
|
@ -40,6 +40,7 @@ class BashInterpreter(Tools):
|
|||||||
|
|
||||||
concat_output = ""
|
concat_output = ""
|
||||||
for command in commands:
|
for command in commands:
|
||||||
|
command = f"cd {self.work_dir} && {command}"
|
||||||
command = command.replace('\n', '')
|
command = command.replace('\n', '')
|
||||||
if self.safe_mode and is_unsafe(commands):
|
if self.safe_mode and is_unsafe(commands):
|
||||||
return "Unsafe command detected, execution aborted."
|
return "Unsafe command detected, execution aborted."
|
||||||
|
@ -34,12 +34,12 @@ class Tools():
|
|||||||
self.client = None
|
self.client = None
|
||||||
self.messages = []
|
self.messages = []
|
||||||
self.config = configparser.ConfigParser()
|
self.config = configparser.ConfigParser()
|
||||||
self.current_dir = self.create_work_dir()
|
self.work_dir = self.create_work_dir()
|
||||||
self.excutable_blocks_found = False
|
self.excutable_blocks_found = False
|
||||||
self.safe_mode = True
|
self.safe_mode = True
|
||||||
|
|
||||||
def get_work_dir(self):
|
def get_work_dir(self):
|
||||||
return self.current_dir
|
return self.work_dir
|
||||||
|
|
||||||
def check_config_dir_validity(self):
|
def check_config_dir_validity(self):
|
||||||
"""Check if the config directory is valid."""
|
"""Check if the config directory is valid."""
|
||||||
@ -116,7 +116,7 @@ class Tools():
|
|||||||
return
|
return
|
||||||
save_path_dir = os.path.dirname(save_path)
|
save_path_dir = os.path.dirname(save_path)
|
||||||
save_path_file = os.path.basename(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):
|
if directory and not os.path.exists(directory):
|
||||||
os.makedirs(directory)
|
os.makedirs(directory)
|
||||||
for block in blocks:
|
for block in blocks:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user