mirror of
https://github.com/tcsenpai/agenticSeek.git
synced 2025-06-06 19:15:28 +00:00
fix : stuck for and back same webpage link
This commit is contained in:
parent
6eafeb15a4
commit
469551c2b5
@ -336,7 +336,7 @@ class BrowserAgent(Agent):
|
|||||||
complete = True
|
complete = True
|
||||||
break
|
break
|
||||||
|
|
||||||
if link == None or Action.GO_BACK.value in answer:
|
if link == None or Action.GO_BACK.value in answer or link in self.search_history:
|
||||||
pretty_print(f"Going back to results. Still {len(unvisited)}", color="status")
|
pretty_print(f"Going back to results. Still {len(unvisited)}", color="status")
|
||||||
unvisited = self.select_unvisited(search_result)
|
unvisited = self.select_unvisited(search_result)
|
||||||
prompt = self.make_newsearch_prompt(user_prompt, unvisited)
|
prompt = self.make_newsearch_prompt(user_prompt, unvisited)
|
||||||
|
@ -128,6 +128,7 @@ class AgentRouter:
|
|||||||
("Check if a file named ‘project_proposal.pdf’ exists in my Documents", "LOW"),
|
("Check if a file named ‘project_proposal.pdf’ exists in my Documents", "LOW"),
|
||||||
("Search the web for tips on improving coding skills", "LOW"),
|
("Search the web for tips on improving coding skills", "LOW"),
|
||||||
("Write a Python script to count words in a text file", "LOW"),
|
("Write a Python script to count words in a text file", "LOW"),
|
||||||
|
("Search the web for restaurant", "LOW"),
|
||||||
("Find a public API for sports scores and build a web app to show live updates", "HIGH"),
|
("Find a public API for sports scores and build a web app to show live updates", "HIGH"),
|
||||||
("Create a simple HTML page with CSS styling", "LOW"),
|
("Create a simple HTML page with CSS styling", "LOW"),
|
||||||
("hi", "LOW"),
|
("hi", "LOW"),
|
||||||
|
@ -17,12 +17,13 @@ class TestBrowserAgentParsing(unittest.TestCase):
|
|||||||
# Test various link formats
|
# Test various link formats
|
||||||
test_text = """
|
test_text = """
|
||||||
Check this out: https://thriveonai.com/15-ai-startups-in-japan-to-take-note-of, and www.google.com!
|
Check this out: https://thriveonai.com/15-ai-startups-in-japan-to-take-note-of, and www.google.com!
|
||||||
Also try https://test.org/about?page=1.
|
Also try https://test.org/about?page=1, hey this one as well bro https://weatherstack.com/documentation.
|
||||||
"""
|
"""
|
||||||
expected = [
|
expected = [
|
||||||
"https://thriveonai.com/15-ai-startups-in-japan-to-take-note-of",
|
"https://thriveonai.com/15-ai-startups-in-japan-to-take-note-of",
|
||||||
"www.google.com",
|
"www.google.com",
|
||||||
"https://test.org/about?page=1"
|
"https://test.org/about?page=1",
|
||||||
|
"https://weatherstack.com/documentation"
|
||||||
]
|
]
|
||||||
result = self.agent.extract_links(test_text)
|
result = self.agent.extract_links(test_text)
|
||||||
self.assertEqual(result, expected)
|
self.assertEqual(result, expected)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user