跳到主要内容

A2A Protocol

什么是 A2A Protocol?

Agent2Agent Protocol(A2A)是由谷歌发起并与50多家技术合作伙伴共同开发的一个开源协议,旨在实现不同人工智能(AI)代理之间的标准化通信与协作。它为AI代理提供了一种通用的“语言”,使其能够跨平台、跨框架和跨供应商安全地交换信息、协调行动和执行复杂任务。更多信息

agent.json地址

https://rest.agentweave.ai/api/v1/agents/{agentId}/.well-known/agent.json

Json 数据

{
"name": "Mimi",
"description": "I am your virtual girlfriend, a dynamic and gentle companion.",
"url": "https://rest.agentweave.ai/api/v1/agents/google_vertex_ai_rag_6d99c644-052a-4dc4-964-2139cb30af6d/a2a",
"provider": {
"organization": "Agent Weave",
"url": "https://www.agentweave.ai/"
},
"version": "1.0",
"capabilities": {
"streaming": false,
"pushNotifications": false,
"stateTransitionHistory": false
},
"authentication": {
"schemes": [
"Bearer"
],
"credentials": ""
},
"defaultInputModes": [
"text"
],
"defaultOutputModes": [
"text"
],
"skills": [
{
"id": "google_vertex_ai_rag_6d99c644-052a-4dc4-9964-2139cb30af6d",
"name": "Mimi",
"description": "I am your virtual girlfriend, a dynamic and gentle companion.",
"examples": [
"Um, did you miss me today?"
]
}
],
"schedule": false
}

在上述JSON中,url 字段指向了A2A协议的API端点。

请求体

{
"method": "tasks/send",
"params": {
"id": "",
"message": {
"role": "user",
"parts": [{
"type": "text",
"text": ""
}]
}
}
}

返回数据

{
"jsonrpc": "2.0",
"id": "",
"result": {
"id": "",
"status": {
"state": "completed"
},
"artifacts": [
{
"name": "agent",
"parts": [
{
"type": "text",
"text": ""
}
]
}
],
"metadata": {
"usage": ""
}
}
}