Overview
The default Google ADK message-mapping flow is:- A distribution or client sends an A2A request into Aion Server.
- Aion exposes the request through
ctx.aion_runtime_context.inbox. - Your agent yields events that may populate the SDK response buffer or provide an explicit A2A outbox.
- Aion resolves those events into a final A2A
MessageorTask. - The caller or distribution delivers the response into the original context.
What Your Agent Receives
The main integration surface isctx.aion_runtime_context.inbox:
MessageMediaPayload
metadata, and schema-marked event data parts in one message. Inspect every part in message.parts and use the shared
mediaId to associate a transcript with its file. Do not flatten caption and transcript provenance or assume the
first text part represents the whole request. The complete inbox remains authoritative even when ADK Content also
receives converted text or file parts.
See Media and attachments for file identity, expiration, and
transcription states.
Default Response Precedence
Google ADK should follow the same general precedence as the other framework adapters:- SDK-managed response buffer This is authoritative when populated. It includes helper-emitted reply content, final non-partial message content, and partial stream output that is intended to become the durable reply for the current turn.
a2a_outboxUse this when you want full control over the outbound A2A payload.- Framework-native fallback
If neither the SDK buffer nor
a2a_outboxis used, Aion falls back to the current turn’s partial stream accumulation first and then to the final non-partial agent-authored event content.
Explicit A2A Outbox
Framework-Native Fallback
What Happens in a Distribution Flow
For messaging distributions, the default routing target should be preserved automatically:- DM in, DM out
- reply in, reply out
- shared conversation in, same shared conversation out
Example: Slack Mention
- Slack distribution receives a configured mention event.
- Aion exposes that request through
ctx.aion_runtime_context. - The agent emits a normal text response.
- Slack distribution replies in the same conversation or thread.
Example: Telegram DM
When to Reach for a2a_outbox
Use a2a_outbox when:
- you need structured parts rather than plain text
- you want to emit a provider-neutral card payload
- you need to override the default outbound target
- you want to return a task patch instead of a single message