Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: retry actions #3

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions alumnium/alumni.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from langchain_openai import AzureChatOpenAI, ChatOpenAI
from langchain_google_genai import ChatGoogleGenerativeAI

from retry import retry
from selenium.webdriver.remote.webdriver import WebDriver

from .agents import ActorAgent, VerifierAgent
Expand Down Expand Up @@ -41,6 +42,7 @@ def __init__(self, driver: WebDriver, model: Model = Model.load()):
def quit(self):
self.driver.quit()

@retry(tries=2, delay=0.1)
def do(self, goal: str):
self.actor_agent.invoke(goal)

Expand Down
2 changes: 1 addition & 1 deletion examples/pytest/google_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

def test_google_search(al, driver):
driver.get("https://www.google.com")
al.do("type selenium to search and press enter but do not click on anything")
al.do("search for selenium")
al.check("selenium in page title")
al.check("selenium.dev is present in the search results")
39 changes: 38 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ langchain = "^0.3"
langchain-anthropic = "^0.2"
langchain-google-genai = "^2.0"
langchain-openai = "^0.2"
retry = "^0.9"
selenium = "^4.0"

[tool.poetry.group.dev.dependencies]
behave = "^1.2.6"
behave-html-pretty-formatter = "^1.12"
pytest = "^8.3.3"
pytest-html = "^4.1.1"
behave-html-pretty-formatter = "^1.12"

[build-system]
requires = ["poetry-core"]
Expand Down