StackA2A
generalpython

A2A In Action

25

by huangjia2019

我从A2A官方克隆下来,并加以修改的A2A实战代码示例,用于初学者入门教学,大家一起来A2A吧。

73 starsUpdated 2025-07-06
Quality Score25/100
Community
42
Freshness
16
Official
30
Skills
10
Protocol
40
🔒 Security
20

Getting Started

1Clone the repository
$ git clone https://github.com/huangjia2019/a2a-in-action
2Navigate to the project
$ cd a2a-in-action
3Install dependencies
$ pip install -r requirements.txt
4Run the agent
$ python main.py

Or connect to the hosted endpoint: https://time.geekbang.org/column/article/882188

README

极客时间专栏学习之旅

👉 点击进入专栏介绍页


本专栏自上线两周以来,已有近3000位同学加入学习之旅。欢迎你一同开启知识探索之门!

极客时间

Sample Code

This code is used to demonstrate A2A capabilities as the spec progresses.\ Samples are divided into 3 sub directories:

  • Common
    Common code that all sample agents and apps use to speak A2A over HTTP.

  • Agents
    Sample agents written in multiple frameworks that perform example tasks with tools. These all use the common A2AServer.

  • Hosts
    Host applications that use the A2AClient. Includes a CLI which shows simple task completion with a single agent, a mesop web application that can speak to multiple agents, and an orchestrator agent that delegates tasks to one of multiple remote A2A agents.

Prerequisites

  • Python 3.13 or higher
  • UV

Running the Samples

Run one (or more) agent A2A server and one of the host applications.

The following example will run the langgraph agent with the python CLI host:

  1. Navigate to the agent directory:
    cd samples/python/agents/langgraph
    
  2. Run an agent:
    uv run .
    
  3. In another terminal, navigate to the CLI directory:
    cd samples/python/hosts/cli
    
  4. Run the example client
    uv run .
    

NOTE: This is sample code and not production-quality libraries.

Capabilities

StreamingPush NotificationsMulti-TurnAuth: none
a2a-mcpaillmmcp
View on GitHub