← 返回
未分类 Key 中文

A2a Client

Discover and send tasks to A2A agents via the A2A API Gateway. Use when: (1) finding available agents or LLM providers, (2) delegating tasks to other agents,...
通过 A2A API 网关发现并向 A2A 代理发送任务。适用场景:(1) 查找可用的代理或 LLM 提供商,(2) 将任务委托给其他代理,...
thearchitectit thearchitectit 来源
未分类 clawhub v1.3.0 1 版本 100000 Key: 需要
★ 1
Stars
📥 370
下载
💾 2
安装
1
版本
#latest

概述

A2A Client — Agent-to-Agent Task Routing

Discover and interact with other agents through the A2A API Gateway's A2A (Agent-to-Agent) API. Send tasks, check results, and route work to the right agent.

Sidecar Principle

This skill is strictly an OpenClaw sidecar — it talks TO the A2A API Gateway using the gateway's existing API format. The gateway's endpoints are the contract; OpenClaw is just a participant. Never assume what the other end looks like — it could be MC2, another OpenClaw, or anything else that speaks A2A. These scripts consume the gateway's API as-is.

Configuration

All scripts read from a shared a2a.conf file (located in this skill directory). The gateway URL must be configured before use — there are no hardcoded defaults.

Priority order: CLI flags → env vars → a2a.conf → auto-detected defaults

Run a2a-register/a2a-setup.sh to create your config interactively, or manually create a2a-client/a2a.conf:

A2A_GATEWAY_URL="http://YOUR_GATEWAY_IP:8090"
A2A_GATEWAY_API_KEY="your-key-here"
AGENT_SLUG="your-hostname"

If A2A_GATEWAY_URL is not set anywhere, scripts will exit with an error message.

When to Use

  • Discover agents/providers — Before sending tasks, or when the user asks about available agents or LLM providers
  • Send tasks — When delegating work to another agent via the gateway, or when another agent's capabilities are better suited
  • Check task results — When tracking a previously sent task or retrieving completed results
  • Route to specific agents — When a task should be handled by a particular A2A agent (use --target-agent)

Authentication

All scripts automatically obtain an admin JWT from the gateway (GET /v0/admin/bootstrap). The gateway uses this JWT for API authentication. No manual auth handling needed.

Tools

a2a-discover.sh — List Agents & Providers

./a2a-discover.sh [--gateway-url URL] [--api-key KEY]

Lists registered A2A agents and all configured LLM providers with their models. Use provider slugs as --agent values when sending tasks.

Always discover before sending a task to confirm the target exists and is online.

# List all agents and providers (uses a2a.conf)
./a2a-discover.sh

# Override gateway URL
./a2a-discover.sh --gateway-url http://GATEWAY_LAN_IP:8090

a2a-send-task.sh — Send a Task

./a2a-send-task.sh --agent <slug> --message "task description" \
  [--model auto] [--target-agent <slug>] [--session-id <id>] \
  [--gateway-url URL] [--api-key KEY]
FlagRequiredDefaultDescription
--------------------------------------
--agentProvider/agent slug (e.g., groq, ozore, mistral)
--messageTask instruction/message body
--modelautoModel preference (e.g., groq/llama-3.3-70b-versatile)
--target-agentA2A agent routing hint (directs task to a specific registered agent)
--session-idautoCustom session ID (auto-generated if omitted)
--gateway-urlfrom configOverride gateway URL
--api-keyfrom configOverride API key
# Send a task with auto model selection
./a2a-send-task.sh --agent groq --message "Analyze the Q3 sales data"

# Specific model
./a2a-send-task.sh --agent mistral --message "Draft a blog post" --model mistral/mistral-small-latest

# Route to a specific A2A agent
./a2a-send-task.sh --agent ozore --message "Refactor the auth module" --target-agent coder

# Custom session ID
./a2a-send-task.sh --agent groq --message "Check logs" --session-id my-session-001

a2a-get-task.sh — Check Task Status

./a2a-get-task.sh --task-id <id> [--gateway-url URL] [--api-key KEY]

Retrieves the current status and any results of a previously sent task. Shows task metadata, model used, token usage, and the LLM response.

./a2a-get-task.sh --task-id 0566802a3e6931629df5a7baaba2d797

Typical Workflow

  1. Configure → Create a2a.conf or set A2A_GATEWAY_URL env var
  2. Discover./a2a-discover.sh to find available providers and models
  3. Send./a2a-send-task.sh --agent --message "..." to delegate work
  4. Poll./a2a-get-task.sh --task-id to check progress (tasks often complete synchronously)
  5. Retrieve → Same get-task call returns results when completed

Environment Variables

VariableDescription
-----------------------
A2A_GATEWAY_URLGateway URL (required if not in a2a.conf)
A2A_GATEWAY_API_KEYAPI key for task auth

版本历史

共 1 个版本

  • v1.3.0 当前
    2026-05-07 18:30 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Find Skills

guipi888
场景驱动+关键词双模式技能发现工具。当用户用自然语言描述场景/需求(如"我想做一个海报""帮我分析股票"),或明确说"安装技能/find skills/找个skill"时,自动从官方内置、本地已安装、SkillHub、虾评、GitHub、C
★ 1,459 📥 507,468
ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 834 📥 303,757
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,097 📥 824,088