rucora A2A
rucora 的 A2A(Agent-to-Agent)协议集成。
概述
本 crate 为 rucora 提供 A2A 协议支持,用于:
- Agent 之间的通信与协作
- 任务委托与结果返回
- 多 Agent 系统编排
安装
[]
= "0.1"
或通过主 rucora crate:
[]
= { = "0.1", = ["a2a"] }
使用方式
客户端使用
use Client;
// 连接到 Agent 服务器
let client = connect.await?;
// 发送任务
let task = client.send_task.await?;
// 等待结果
let result = client.wait_for_result.await?;
服务端使用
use Server;
let mut server = new;
server.register_handler;
server.bind.await?.serve.await?;
多 Agent 协作
use Client;
let agent1 = connect.await?;
let agent2 = connect.await?;
// 将任务委托给 Agent 1
let task1 = agent1.send_task.await?;
let data = agent1.wait_for_result.await?;
// 将结果传递给 Agent 2 处理
let task2 = agent2.send_task.await?;
let result = agent2.wait_for_result.await?;
A2A 工具适配器
use A2AToolAdapter;
use Tool;
let adapter = new;
let result = adapter.call.await?;
子模块
protocol:A2A 协议模型定义transport:A2A 传输层types:A2A 协议类型(来自ra2a::types)
依赖
基于 ra2a 库构建。
许可证
MIT