fix : browser duplication, isolate driver creation

This commit is contained in:
martin legrand
2025-03-26 14:17:52 +01:00
parent 9080697dc0
commit 8c425f62b6
10 changed files with 82 additions and 79 deletions
+3 -3
View File
@@ -9,11 +9,11 @@ from datetime import date
from typing import List, Tuple
class BrowserAgent(Agent):
def __init__(self, name, prompt_path, provider, verbose=False):
def __init__(self, name, prompt_path, provider, verbose=False, browser=None):
"""
The Browser agent is an agent that navigate the web autonomously in search of answer
"""
super().__init__(name, prompt_path, provider, verbose)
super().__init__(name, prompt_path, provider, verbose, browser)
self.tools = {
"web_search": searxSearch(),
}
@@ -24,7 +24,7 @@ class BrowserAgent(Agent):
"es": "web"
}
self.type = "browser_agent"
self.browser = Browser()
self.browser = browser
self.current_page = ""
self.search_history = []
self.navigable_links = []