Thread type from aion.adk.authoring.
The Thread object is the main fluent surface for replying, posting, and
emitting streaming intents without forcing authors to build raw A2A messages
by hand.
Import
Constructing a Thread
Create a Thread from the Aion runtime context available on the ADK invocation context. Inside_run_async_impl, type ctx as AionInvocationContext to get
IDE support for the Aion-specific fields:
ctx.aion_runtime_context is an AionRuntimeContext injected by Aion Server
into every ADK invocation. It is None when the agent runs outside of Aion.
See Invocation Context for the full ctx field reference.
Properties
Methods
reply(...)
reply(...) is the most common way to respond. It automatically routes the
reply back to the same place the inbound message arrived.
content can be:
- a
str— sent as a text message - a
Card— sent as a provider-neutral card document - an
a2a.types.Artifact— saved via the artifact service and emitted as aTaskArtifactUpdateEvent - an
Event— forwarded directly to the ADK event stream - an async iterator of
strchunks — streamed as partial events, then emitted as one durable final event
content is an async iterator, the SDK emits partial events during
streaming and accumulates a durable final reply in the same invocation.
post(...)
post(...) gives explicit control over where the message is delivered. Use it
when you want to route output to a different target than the default reply.
post(...) accepts the same content categories as reply(...).
typing(...)
typing(...) emits an ephemeral event that is shown in real time and never
persisted in task history. Use it for progress indicators or intermediate status
messages.