Skip to content

Commit

Permalink
adjuted notebook and browsing agent for the previous changes
Browse files Browse the repository at this point in the history
  • Loading branch information
VRSEN committed May 25, 2024
1 parent a505504 commit 2c3d868
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 225 deletions.
4 changes: 4 additions & 0 deletions agency_swarm/agents/BrowsingAgent/BrowsingAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def response_validator(self, message):
wd = get_web_driver()
highlight_elements_with_labels(wd, 'a, button, div[onclick], div[role="button"], div[tabindex], '
'span[onclick], span[role="button"], span[tabindex]')
self.shared_state.set("elements_highlighted", 'a, button, div[onclick], div[role="button"], div[tabindex], '
'span[onclick], span[role="button"], span[tabindex]')

self.take_screenshot()

Expand All @@ -79,6 +81,7 @@ def response_validator(self, message):
elif '[highlight text fields]' in message.lower():
wd = get_web_driver()
highlight_elements_with_labels(wd, 'input, textarea')
self.shared_state.set("elements_highlighted", "input, textarea")

self.take_screenshot()

Expand All @@ -99,6 +102,7 @@ def response_validator(self, message):
elif '[highlight dropdowns]' in message.lower():
wd = get_web_driver()
highlight_elements_with_labels(wd, 'select')
self.shared_state.set("elements_highlighted", "select")

self.take_screenshot()

Expand Down
3 changes: 1 addition & 2 deletions agency_swarm/agents/BrowsingAgent/tools/ClickElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def run(self):

set_web_driver(wd)

from agency_swarm.util import shared_state
shared_state.set("elements_highlighted", "")
self.shared_state.set("elements_highlighted", "")

return result
3 changes: 0 additions & 3 deletions agency_swarm/agents/BrowsingAgent/tools/util/highlights.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ def highlight_elements_with_labels(driver, selector):

driver.execute_script(script)

from agency_swarm.util import shared_state
shared_state.set("elements_highlighted", selector)

return driver


Expand Down
Loading

0 comments on commit 2c3d868

Please sign in to comment.