ag-ui-protocol / ag-ui-protocol/ag-ui

Auto-discover AgentCapabilities from the wrapped ADK agent (opt-in)

Abierto
#2,107 1 comentario 0 reacciones 0 asignados Ver en GitHub
enhancement Integration
Lenguaje dominante
Python
Estrellas
15.9k
Forks
1.4k
Merge medio
1 d 17 h
PR fusionados (30 d)
163

Descripción

## Feature request: auto-discover `AgentCapabilities` from the wrapped ADK agent

`ag-ui-adk` already exposes `GET /capabilities` (via `add_adk_fastapi_endpoint`) and `ADKAgent.get_capabilities()`, but today that only returns whatever dict the developer hand-wrote into the `capabilities=` constructor arg — otherwise `None`. The middleware **knows** a lot about the agent it wraps (name, description, sub-agents, planner, tools) yet derives nothing from it. So an agent that clearly supports multi-agent delegation, reasoning, and human-in-the-loop advertises `{}` unless the developer manually restates all of it — which is easy to forget and drifts out of sync with the actual agent.

### Proposal

Add an opt-in `discover_capabilities: bool = False` flag to `ADKAgent` / `ADKAgent.create(...)`. When enabled, `get_capabilities()` derives a best-effort `AgentCapabilities` by structurally inspecting the wrapped ADK agent (no run needed), then **merges it under** any explicitly-configured `capabilities` — the developer's explicit values always win (one level deep). Flag off → behavior is 100% unchanged (`None` or exactly the configured dict).

Mapping (all `getattr`-guarded so `SequentialAgent` / custom `BaseAgent` roots degrade gracefully):

| Derived key | Source on the ADK agent |
|---|---|
| `identity.{name,description}` + `identity.type: "google-adk"` | `agent.name`, `agent.description` |
| `multiAgent.{supported, subAgents[]}` | `agent.sub_agents` |
| `reasoning.{supported, streaming}` | planner with `thinking_config.include_thoughts` |
| `tools.supported` | non-empty `agent.tools` |
| `humanInTheLoop.supported` | an `AGUIToolset` present in `agent.tools` |
| `transport.streaming` | always `True` (middleware serves SSE) |

### Why

- **Zero-config discovery** — a frontend or agent marketplace can hit `GET /capabilities` and learn the agent is multi-agent / reasoning / HITL-capable without the developer hand-maintaining the dict.
- **No drift** — capabilities track the actual agent structure instead of a stale hand-written copy.
- **Fully backward compatible** — opt-in flag, explicit config still wins per sub-key.

Happy to submit the PR (implementation + tests are ready) — opening the issue first to confirm the derivation mapping (especially the `identity.type: "google-adk"` value and the "explicit-wins one-level-deep" merge semantics) matches what maintainers want.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.