Merge pull request #115 from Fosowl/dev

Improve browser note taking and contributing.md
This commit is contained in:
Martin 2025-04-12 18:19:06 +02:00 committed by GitHub
commit 2eb97e6724
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 12 additions and 13 deletions

3
.gitignore vendored
View File

@ -1,10 +1,13 @@
*.wav
*.DS_Store
*.log
cookies.json
*.tmp
*.safetensors
config.ini
test_agent.py
*.egg-info
.voices/
experimental/
conversations/
agentic_env/*

View File

@ -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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 KiB

View File

@ -106,9 +106,10 @@ class BrowserAgent(Agent):
# Instruction
1. **Decide if the page answers the users query:**
- If it does, take notes of useful information (Note: ...), include relevant link in note, then move to a new page.
- If it doesnt, say: Error: <why page don't help> then go back or navigate to another link.
1. **Evaluate if the page is relevant for users query and document finding:**
- If the page is relevant, extract and summarize key information in concise notes (Note: <your note>)
- If page not relevant, state: "Error: <specific reason the page does not address the query>" 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 <website URL>, <key fact 1>. <Key fact 2>. <Additional insight>." 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 (<link>) LeCun net is ...<expand on page content>..."
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.
"""

View File

@ -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