From 8ba9c0432f5c87de91d0f4ae0e29c87ccb54e5bf Mon Sep 17 00:00:00 2001 From: martin legrand Date: Sat, 15 Mar 2025 13:15:41 +0100 Subject: [PATCH] Fix : web prompt --- sources/agents/browser_agent.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sources/agents/browser_agent.py b/sources/agents/browser_agent.py index fa5e8c3..ebd50ba 100644 --- a/sources/agents/browser_agent.py +++ b/sources/agents/browser_agent.py @@ -70,7 +70,7 @@ class BrowserAgent(Agent): The user query was : {user_prompt} You must choose a link (write it down) to navigate to, go go back. For exemple you can say: i want to go to www.events.org/events - Always end with a sentence that summarize your finding for exemple: + Always end with a sentence that summarize useful information if any for exemple: Summary: According to https://karpathy.github.io/ LeCun net is the earliest real-world application of a neural net" Another exemple: Summary: the BBC website does not provide useful informations. @@ -117,7 +117,7 @@ class BrowserAgent(Agent): def save_notes(self, text): lines = text.split('\n') - for line in line + for line in lines: if "summary:" in line: self.notes.append(line) @@ -127,6 +127,7 @@ class BrowserAgent(Agent): animate_thinking(f"Searching...", color="status") search_result_raw = self.tools["web_search"].execute([user_prompt], False) search_result = self.jsonify_search_results(search_result_raw) + search_result = search_result[:10] # until futher improvement prompt = self.make_newsearch_prompt(user_prompt, search_result) unvisited = [None] while not complete: