Skip to content
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: 0 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
matrix:
include:
# Update this to build your own agent images.
- name: adk-debate-judge
dockerfile: scenarios/debate/Dockerfile.adk-debate-judge
- name: debate-judge
dockerfile: scenarios/debate/Dockerfile.debate-judge
- name: debater
Expand Down
43 changes: 25 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
## Quickstart
1. Clone the repo
```
git clone [email protected]:rdi-foundation/agentbeats-tutorial.git
git clone [email protected]:RDI-Foundation/agentbeats-tutorial.git agentbeats-tutorial
cd agentbeats-tutorial
```
2. Install dependencies
```
uv sync
uv sync --extra debate
```
This installs the optional dependencies needed to run the debate scenario (Gemini).
3. Set environment variables
```
cp sample.env .env
```
Add your Google API key to the .env file
Fill in the keys you plan to use (e.g. `GOOGLE_API_KEY` for the debate example and `OPENAI_API_KEY` for the tau2 example).

4. Run the [debate example](#example)
```
Expand All @@ -29,6 +30,8 @@ This command will:

**Note:** Use `--show-logs` to see agent outputs during the assessment, and `--serve-only` to start agents without running the assessment.

**Note:** If you see `Error: Some agent endpoints are already in use`, change the ports in the scenario TOML (or stop the process using them).

To run this example manually, start the agent servers in separate terminals, and then in another terminal run the A2A client on the scenario.toml file to initiate the assessment.

After running, you should see an output similar to this.
Expand All @@ -37,21 +40,22 @@ After running, you should see an output similar to this.

## Project Structure
```
src/
└─ agentbeats/
├─ green_executor.py # base A2A green agent executor
├─ models.py # pydantic models for green agent IO
├─ client.py # A2A messaging helpers
├─ client_cli.py # CLI client to start assessment
└─ run_scenario.py # run agents and start assessment

scenarios/
└─ debate/ # implementation of the debate example
├─ debate_judge.py # green agent impl using the official A2A SDK
├─ adk_debate_judge.py # alternative green agent impl using Google ADK
├─ debate_judge_common.py # models and utils shared by above impls
├─ debater.py # debater agent (Google ADK)
└─ scenario.toml # config for the debate example
├─ debate/
│ ├─ judge/src/ # green agent (green-agent-template structure)
│ ├─ debater/src/ # purple agent (agent-template structure)
│ ├─ Dockerfile.debate-judge
│ ├─ Dockerfile.debater
│ └─ scenario.toml
└─ tau2/
├─ evaluator/src/ # green agent (green-agent-template structure)
├─ agent/src/ # purple agent (agent-template structure)
├─ Dockerfile.tau2-evaluator
├─ Dockerfile.tau2-agent
├─ setup.sh # downloads tau2-bench data for local runs
└─ scenario.toml

src/agentbeats/ # optional local runner + A2A client helpers (`agentbeats-run`)
```

# AgentBeats Tutorial
Expand Down Expand Up @@ -122,7 +126,10 @@ To make things concrete, we will use a debate scenario as our toy example:
- Two purple agents (`Debater`) participate by presenting arguments for their side of the topic.

To run this example, we start all three servers and then use an A2A client to send an `assessment_request` to the green agent and observe its outputs.
The full example code is given in the template repository. Follow the quickstart guide to setup the project and run the example.
The debate example is implemented using the same structure as the supported templates:

- Green agent: `scenarios/debate/judge/src/` (green-agent-template style)
- Purple agent: `scenarios/debate/debater/src/` (agent-template style)

### Dockerizing Agent

Expand Down
20 changes: 13 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,22 @@ description = "Agentbeats Tutorial"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"a2a-sdk>=0.3.5",
"google-adk>=1.14.1",
"a2a-sdk[http-server]>=0.3.20",
"httpx>=0.28.1",
"pydantic>=2.11.9",
"python-dotenv>=1.1.1",
"uvicorn>=0.38.0",
]

[project.optional-dependencies]
debate = [
"google-genai>=1.36.0",
]
tau2-agent = [
"litellm>=1.0.0",
"loguru>=0.7.0",
]
tau2-evaluator = [
"nest-asyncio>=1.6.0",
"pydantic>=2.11.9",
"python-dotenv>=1.1.1",
"uvicorn>=0.35.0",
# tau2 from GitHub
"tau2 @ git+https://github.com/sierra-research/tau2-bench.git",
]

Expand Down
1 change: 1 addition & 0 deletions sample.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
GOOGLE_GENAI_USE_VERTEXAI=FALSE
GOOGLE_API_KEY=
OPENAI_API_KEY=
18 changes: 0 additions & 18 deletions scenarios/debate/Dockerfile.adk-debate-judge

This file was deleted.

8 changes: 5 additions & 3 deletions scenarios/debate/Dockerfile.debate-judge
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ghcr.io/astral-sh/uv:python3.12-trixie
FROM ghcr.io/astral-sh/uv:python3.13-bookworm

ENV UV_HTTP_TIMEOUT=300

RUN adduser agentbeats
USER agentbeats
Expand All @@ -9,10 +11,10 @@ COPY src src

RUN \
--mount=type=cache,target=/home/agentbeats/.cache/uv,uid=1000 \
uv sync --locked
uv sync --locked --no-dev --no-install-project --extra debate

COPY scenarios scenarios

ENTRYPOINT ["uv", "run", "scenarios/debate/debate_judge.py"]
ENTRYPOINT ["uv", "run", "scenarios/debate/judge/src/server.py"]
CMD ["--host", "0.0.0.0"]
EXPOSE 9009
8 changes: 5 additions & 3 deletions scenarios/debate/Dockerfile.debater
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ghcr.io/astral-sh/uv:python3.12-trixie
FROM ghcr.io/astral-sh/uv:python3.13-bookworm

ENV UV_HTTP_TIMEOUT=300

RUN adduser agentbeats
USER agentbeats
Expand All @@ -9,10 +11,10 @@ COPY src src

RUN \
--mount=type=cache,target=/home/agentbeats/.cache/uv,uid=1000 \
uv sync --locked
uv sync --locked --no-dev --no-install-project --extra debate

COPY scenarios scenarios

ENTRYPOINT ["uv", "run", "scenarios/debate/debater.py"]
ENTRYPOINT ["uv", "run", "scenarios/debate/debater/src/server.py"]
CMD ["--host", "0.0.0.0"]
EXPOSE 9019
113 changes: 0 additions & 113 deletions scenarios/debate/adk_debate_judge.py

This file was deleted.

Loading