Skip to content

Commit ecb8f11

Browse files
committed
Merge branch 'trace-recorder' into hints_retrieve
2 parents 74fc47f + d3054cd commit ecb8f11

34 files changed

+9740
-98
lines changed

.github/workflows/code_format.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ jobs:
1818
- name: Checkout Repository
1919
uses: actions/checkout@v4
2020

21-
- name: Set up Python
22-
uses: actions/setup-python@v5
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v4
2323
with:
24-
python-version: '3.11'
25-
cache: 'pip' # caching pip dependencies
24+
enable-cache: true
25+
26+
- name: Set up Python
27+
run: uv python install 3.11
2628

27-
- name: Pip install
28-
run: pip install -r requirements.txt
29+
- name: Install dependencies
30+
run: uv sync --frozen --extra dev
2931

30-
- name: Pip list
31-
run: pip list
32+
- name: List packages
33+
run: uv pip list
3234

3335
- name: Code Formatting
34-
run: black . --check --diff
36+
run: uv run black src/ --check --diff

.github/workflows/darglint.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ jobs:
1818
- name: Checkout Repository
1919
uses: actions/checkout@v4
2020

21-
- name: Set up Python
22-
uses: actions/setup-python@v5
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v4
2323
with:
24-
python-version: '3.12'
25-
cache: 'pip' # caching pip dependencies
24+
enable-cache: true
25+
26+
- name: Set up Python
27+
run: uv python install 3.12 # this fails in 3.11
2628

27-
- name: Pip install
28-
run: pip install darglint
29+
- name: Install dependencies
30+
run: uv sync --frozen --extra dev
2931

30-
- name: Pip list
31-
run: pip list
32+
- name: List packages
33+
run: uv pip list
3234

3335
- name: Darglint checks
34-
run: darglint -v 2 -z short src/
36+
run: uv run darglint -v 2 -z short src/

.github/workflows/python_version_compatibility.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ jobs:
3232
- name: Check Python ${{ matrix.python-version }}
3333
continue-on-error: true
3434
run: |
35-
export PATH="$HOME/.cargo/bin:$PATH"
36-
if uvx --python ${{ matrix.python-version }} --from python --with-requirements requirements.txt python -c "print('✅ Compatible')"; then
37-
echo "✅ Python ${{ matrix.python-version }} works"
38-
else
39-
echo "❌ Python ${{ matrix.python-version }} incompatible"
40-
fi
35+
export PATH="$HOME/.cargo/bin:$PATH"
36+
uv python install ${{ matrix.python-version }}
37+
if uv sync --frozen --python ${{ matrix.python-version }}; then
38+
uv run -p ${{ matrix.python-version }} python -c "import sys; print('✅ Compatible:', sys.version)"
39+
echo "✅ Python ${{ matrix.python-version }} works"
40+
else
41+
echo "❌ Python ${{ matrix.python-version }} incompatible"
42+
exit 1
43+
fi

.github/workflows/unit_tests.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,25 @@ jobs:
2323
- name: Set up Git user
2424
run: git config --global user.email "[email protected]" && git config --global user.name "GitHub Actions"
2525

26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v4
28+
with:
29+
enable-cache: true
30+
2631
- name: Set up Python
27-
uses: actions/setup-python@v5
28-
with: # python at least 3.11
29-
python-version: '3.11'
30-
cache: 'pip' # caching pip dependencies
32+
run: uv python install 3.11
3133

3234
- name: Install AgentLab
33-
run: pip install -e .
35+
run: uv sync --frozen --extra dev
3436

35-
- name: Pip list
36-
run: pip list
37+
- name: List packages
38+
run: uv pip list
3739

3840
- name: Install Playwright
39-
run: playwright install chromium --with-deps
41+
run: uv run playwright install chromium --with-deps
4042

4143
- name: Download WebArena / VisualWebArena ressource files
42-
run: python -c 'import nltk; nltk.download("punkt_tab")'
44+
run: uv run python -c 'import nltk; nltk.download("punkt_tab")'
4345

4446
- name: Fetch MiniWob
4547
uses: actions/checkout@v4
@@ -59,9 +61,9 @@ jobs:
5961
run: curl -I "http://localhost:8080/miniwob/" || echo "MiniWob not reachable"
6062

6163
- name: Pre-download nltk ressources
62-
run: python -c "import nltk; nltk.download('punkt_tab')"
64+
run: uv run python -c "import nltk; nltk.download('punkt_tab')"
6365

6466
- name: Run AgentLab Unit Tests
6567
env:
6668
MINIWOB_URL: "http://localhost:8080/miniwob/"
67-
run: pytest -n 5 --durations=10 -m 'not pricy' -v tests/
69+
run: uv run pytest -n 5 --durations=10 -m 'not pricy' -v tests/

.readthedocs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,8 @@ sphinx:
3232
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
3333
python:
3434
install:
35+
- method: pip
36+
path: .
37+
extra_requirements:
38+
- dev
3539
- requirements: docs/source/requirements.txt

docs/source/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
agentlab
2-
sphinx-rtd-theme
1+
sphinx-rtd-theme
2+
sphinx

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
AGENT_4o,
1616
AGENT_4o_MINI,
1717
AGENT_o3_MINI,
18-
AGENT_o1_MINI,
1918
AGENT_37_SONNET,
2019
AGENT_CLAUDE_SONNET_35,
20+
AGENT_GPT5_MINI,
2121
)
2222
from agentlab.experiments.study import Study
2323

pyproject.toml

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "agentlab"
7-
dynamic = ["version", "dependencies"]
7+
dynamic = ["version"]
88
description = "Main package for developing agents and experiments"
99
authors = [
1010
{name = "Rim Assouel", email = "[email protected]"},
@@ -27,13 +27,55 @@ classifiers = [
2727
"Topic :: Scientific/Engineering :: Artificial Intelligence",
2828
"License :: OSI Approved :: Apache Software License",
2929
]
30+
dependencies = [
31+
"pydantic~=2.9",
32+
"dask",
33+
"distributed",
34+
"browsergym>=0.7.1",
35+
"joblib>=1.2.0",
36+
"openai>=1.7,<2",
37+
"langchain_community",
38+
"tiktoken",
39+
"huggingface_hub",
40+
"contexttimer",
41+
"ipython",
42+
"pyyaml>=6",
43+
"pandas",
44+
"gradio>=5.5",
45+
"gitpython",
46+
"requests",
47+
"matplotlib",
48+
"ray[default]",
49+
"python-slugify",
50+
"pillow",
51+
"gymnasium>=0.27",
52+
"torch>=2.2.2",
53+
"safetensors>=0.4.0",
54+
"transformers>=4.38.2",
55+
"anthropic>=0.62.0",
56+
"litellm>=1.75.3",
57+
"python-dotenv>=1.1.1",
58+
]
59+
60+
[project.optional-dependencies]
61+
dev = [
62+
"black[jupyter]>=24.2.0",
63+
"blacken-docs",
64+
"pre-commit",
65+
"pytest==7.3.2",
66+
"flaky",
67+
"pytest-xdist",
68+
"pytest-playwright",
69+
]
70+
# tapeagents = [
71+
# "tapeagents[converters]",
72+
# ]
3073

3174
[project.urls]
3275
"Homepage" = "https://github.com/ServiceNow/AgentLab"
3376

3477
[tool.setuptools.dynamic]
3578
version = {attr = "agentlab.__version__"}
36-
dependencies = {file = ["requirements.txt"]}
3779

3880
[tool.black]
3981
line-length = 100
@@ -54,6 +96,13 @@ exclude = '''
5496
)/
5597
'''
5698

99+
[dependency-groups]
100+
dev = [
101+
"darglint>=1.8.1",
102+
"ipykernel>=6.30.1",
103+
"pip>=25.2",
104+
]
105+
57106

58107
[project.scripts]
59108
agentlab-assistant = "agentlab.ui_assistant:main"

src/agentlab/agents/generic_agent/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
AGENT_o3_MINI,
2727
FLAGS_GPT_4o,
2828
GenericAgentArgs,
29+
AGENT_GPT5_MINI,
2930
)
3031

3132
__all__ = [
@@ -46,4 +47,5 @@
4647
"AGENT_4o_VISION",
4748
"AGENT_4o_MINI_VISION",
4849
"AGENT_CLAUDE_SONNET_35_VISION",
50+
"AGENT_GPT5_MINI",
4951
]

src/agentlab/agents/generic_agent/agent_configs.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,12 @@
270270
chat_model_args=CHAT_MODEL_ARGS_DICT["openrouter/anthropic/claude-3.7-sonnet"],
271271
flags=FLAGS_GPT_4o,
272272
)
273+
# AGENT_o3_MINI = GenericAgentArgs(
274+
# chat_model_args=CHAT_MODEL_ARGS_DICT["openai/o3-mini-2025-01-31"],
275+
# flags=FLAGS_GPT_4o,
276+
# )
273277
AGENT_o3_MINI = GenericAgentArgs(
274-
chat_model_args=CHAT_MODEL_ARGS_DICT["openai/o3-mini-2025-01-31"],
278+
chat_model_args=CHAT_MODEL_ARGS_DICT["openrouter/openai/o3-mini"],
275279
flags=FLAGS_GPT_4o,
276280
)
277281

@@ -302,6 +306,18 @@
302306
chat_model_args=CHAT_MODEL_ARGS_DICT["openrouter/meta-llama/llama-4-maverick"],
303307
flags=BASE_FLAGS,
304308
)
309+
GPT5_MINI_FLAGS = BASE_FLAGS.copy()
310+
GPT5_MINI_FLAGS.action = dp.ActionFlags( # action should not be str to work with agentlab-assistant
311+
action_set=HighLevelActionSetArgs(
312+
subsets=["bid"],
313+
multiaction=False,
314+
)
315+
)
316+
317+
AGENT_GPT5_MINI = GenericAgentArgs(
318+
chat_model_args=CHAT_MODEL_ARGS_DICT["openai/gpt-5-mini-2025-08-07"],
319+
flags=GPT5_MINI_FLAGS,
320+
)
305321

306322
DEFAULT_RS_FLAGS = GenericPromptFlags(
307323
flag_group="default_rs",

0 commit comments

Comments
 (0)