Skip to content

Commit 887a21a

Browse files
p0dejesh3pik
authored andcommitted
revert: retry actions
The retry serves as a simplistic manager agent. In a situation when the model attempts to do too much on the page. For example, in Google search it's common to for model to suggest to type word in the search box, press Enter and then click "Search" button. The last step is redundant and causes the test to fail. Retry would attempt to search again and the model would respond that nothing needs to be done since the goal is achieved. Eventually, we want to replace retry with a more intelligent agent that would constantly evaluate what needs to be done to achieve the goal as the action is executed. This reverts commits e1b734d, 961d35a and bb6b59d.
1 parent 04d7cbf commit 887a21a

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

alumnium/alumni.py

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from langchain_openai import AzureChatOpenAI, ChatOpenAI
66
from langchain_google_genai import ChatGoogleGenerativeAI
77

8+
from retry import retry
89
from selenium.webdriver.remote.webdriver import WebDriver
910

1011
from .agents import ActorAgent, VerifierAgent
@@ -41,6 +42,7 @@ def __init__(self, driver: WebDriver, model: Model = Model.load()):
4142
def quit(self):
4243
self.driver.quit()
4344

45+
@retry(tries=2, delay=0.1)
4446
def do(self, goal: str):
4547
self.actor_agent.invoke(goal)
4648

examples/pytest/google_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313

1414
def test_google_search(al, driver):
1515
driver.get("https://www.google.com")
16-
al.do("type selenium to search and press enter but do not click on anything")
16+
al.do("search for selenium")
1717
al.check("selenium in page title")
1818
al.check("selenium.dev is present in the search results")

poetry.lock

+38-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ langchain = "^0.3"
1414
langchain-anthropic = "^0.2"
1515
langchain-google-genai = "^2.0"
1616
langchain-openai = "^0.2"
17+
retry = "^0.9"
1718
selenium = "^4.0"
1819

1920
[tool.poetry.group.dev.dependencies]
2021
behave = "^1.2.6"
21-
behave-html-pretty-formatter = "^1.12"
2222
pytest = "^8.3.3"
2323
pytest-html = "^4.1.1"
24+
behave-html-pretty-formatter = "^1.12"
2425

2526
[build-system]
2627
requires = ["poetry-core"]

0 commit comments

Comments
 (0)