We'd love to accept your patches and contributions to this project. This repository contains code samples and demos demonstrating the Agent2Agent (A2A) Protocol.
Ensure your local environment meets the following requirements before starting development:
- Python: Version 3.12 or higher (3.13+ recommended for agent development).
- Package Manager: uv is required for managing dependencies and workspaces.
-
Fork and Clone: Fork this repository to your GitHub account, then clone your fork locally:
git clone https://github.com/<your-username>/a2a-samples.git cd a2a-samples
-
Install Dependencies: Ensure your workspace dependencies are installed:
uv sync
-
Create a Branch: Create a feature branch for your changes:
git checkout -b feature/my-new-sample
Before undertaking significant work, check the issues page to see if your feature or bug fix is already being discussed. If not, open a new issue to discuss your proposed changes.
All submissions, including submissions by project members, require review using GitHub pull requests. Consult GitHub Help for more information on using pull requests.
We use uv for dependency management, linting, formatting, type checking, and testing. Make sure all checks pass before submitting a pull request.
All code must be formatted and linted using ruff tool. Check its .ruff.toml configuration for more details.
To check and automatically fix linting errors across the workspace:
uv run ruff check --fixTo format the codebase:
uv run ruff formatIf you are working on a single agent sample (e.g., helloworld), you can target it directly:
uv run ruff check --fix --config .ruff.toml samples/python/agents/helloworld/
uv run ruff format --config .ruff.toml samples/python/agents/helloworld/Alternatively, you can use ./format.sh for formatting Python and Notebook files.
Use static type checks to improve your code readability and maintainability. Run the following commands from the workspace root or target directory:
uv run mypy samples/python
uv run pyright samples/pythonBuild and run your tests using pytest. Use --verbose for more detailed output.
uv run pytest --verboseTo run tests for a specific agent sample or extension:
uv run pytest tests/python/agents/<sample-name>/