diff --git a/.gitignore b/.gitignore index 7a47055..905e0be 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,13 @@ *.wav *.DS_Store *.log +cookies.json *.tmp *.safetensors config.ini +test_agent.py *.egg-info +.voices/ experimental/ conversations/ agentic_env/* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5872dcf..b112ad0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -187,11 +187,7 @@ class CasualAgent(Agent): super().__init__(name, prompt_path, provider, verbose, None) self.tools = { } # No tools for the casual agent - self.role = { - "en": "talk", - "fr": "discuter", - "zh": "聊天", - } + self.role = "en" self.type = "casual_agent" def process(self, prompt, speech_module) -> str: @@ -206,7 +202,7 @@ Agent have several parameters that should be sets: `tools`: A dictionary of tools the agent can use. Each tool must inherit from the Tools class. For example, a CasualAgent has no tools ({}), while a coding agent might include a Python execution tool. -`role`:A dictionary defining the agent's role, used by the routing system to select the appropriate agent. It is currently set as a dict for different language but only the "en" key is needed (previous multilingual support needed a language dict), this may be refactored in the future. +`role`:A dictionary defining the agent's role, used by the routing system to select the appropriate agent. `type: the agent type, a fixed name to identify the unique agent type. Every agent must implement the process method, which defines how it handles user input and generates a response. diff --git a/media/technical/diagram_overall.png b/media/technical/diagram_overall.png new file mode 100644 index 0000000..661a510 Binary files /dev/null and b/media/technical/diagram_overall.png differ diff --git a/media/technical/web_agent.png b/media/technical/web_agent.png new file mode 100644 index 0000000..353ab28 Binary files /dev/null and b/media/technical/web_agent.png differ diff --git a/sources/agents/browser_agent.py b/sources/agents/browser_agent.py index 8dc7320..c18be5d 100644 --- a/sources/agents/browser_agent.py +++ b/sources/agents/browser_agent.py @@ -106,9 +106,10 @@ class BrowserAgent(Agent): # Instruction - 1. **Decide if the page answers the user’s query:** - - If it does, take notes of useful information (Note: ...), include relevant link in note, then move to a new page. - - If it doesn’t, say: Error: then go back or navigate to another link. + 1. **Evaluate if the page is relevant for user’s query and document finding:** + - If the page is relevant, extract and summarize key information in concise notes (Note: ) + - If page not relevant, state: "Error: " and either return to the previous page or navigate to a new link. + - Notes should be factual, useful summaries of relevant content, they should always include specific names or link. Written as: "On , . . ." Avoid phrases like "the page provides" or "I found that." 2. **Navigate to a link by either: ** - Saying I will navigate to (write down the full URL) www.example.com/cats - Going back: If no link seems helpful, say: {Action.GO_BACK.value}. @@ -132,7 +133,7 @@ class BrowserAgent(Agent): # Example: Example 1 (useful page, no need go futher): - Note: According to karpathy site () LeCun net is ......" + Note: According to karpathy site LeCun net is ... No link seem useful to provide futher information. Action: {Action.GO_BACK.value} @@ -146,7 +147,7 @@ class BrowserAgent(Agent): Action: {Action.GO_BACK.value} Example 3 (clear definitive query answer found or enought notes taken): - Note: I took 10 notes so far with enought finding to answer user question. + I took 10 notes so far with enought finding to answer user question. Therefore I should exit the web browser. Action: {Action.REQUEST_EXIT.value} @@ -161,7 +162,7 @@ class BrowserAgent(Agent): {user_prompt} You previously took these notes: {notes} - Do not Step-by-Step explanation. Write Notes or Error as a long paragraph followed by your action. + Do not Step-by-Step explanation. Write comprehensive Notes or Error as a long paragraph followed by your action. Do not go to tutorials or help pages. """ diff --git a/sources/llm_provider.py b/sources/llm_provider.py index ffdfffa..49be83f 100644 --- a/sources/llm_provider.py +++ b/sources/llm_provider.py @@ -131,7 +131,6 @@ class Provider: while not is_complete: try: response = requests.get(f"http://{self.server_ip}/get_updated_sentence") - print(response) if "error" in response.json(): pretty_print(response.json()["error"], color="failure") break