This page describes the Thread type from aion-authoring-langgraph.
The Thread object is the main fluent surface for replying, posting, looking
up history, and emitting streaming intents without forcing authors to build
raw A2A messages by hand.
Properties
| Property | Purpose |
|---|
id | Current messaging thread or context identifier |
parent_id | Parent thread or context identifier when one exists |
network | Originating network or distribution identifier |
default_reply_target | Canonical reply target derived from the inbound event |
Methods
| Method | Purpose |
|---|
reply(content, *, metadata=None) | Add a durable reply to the current thread |
post(content, *, target=None, metadata=None) | Create an explicit outbound post action |
history(limit=20, before=None) | Request recent conversation history through the control plane |
typing() | Emit a stream-only typing or progress intent |
reply(...) and post(...) should accept the same content categories:
- plain text
- a
Card object — provider-neutral card document
- an async iterator of text chunks for streaming replies
- an explicit low-level message builder when the author needs more control
reply(...)
reply(...) is intended for the most common case: answer in the same place
the inbound message arrived.
async def node(state: State, runtime: Runtime[AionRuntimeContext]) -> dict:
thread = Thread.from_context(runtime.context)
await thread.reply("Thanks. I'm looking into that now.")
return {}
To send a card, pass a Card instance. See Card for all creation
modes and component reference.
When content is an async iterator, the SDK should:
- emit stream deltas during
SendStreamingMessage
- accumulate the durable reply in the same request-scoped response buffer
That keeps streamed output and final reply compilation aligned.
post(...)
post(...) is intended for explicit outbound actions that should remain
distinct from the default reply target.
async def node(state: State, runtime: Runtime[AionRuntimeContext]) -> dict:
thread = Thread.from_context(runtime.context)
await thread.post("Posting a follow-up note to a different channel.")
return {}
Unlike reply(...), post(...) should remain explicit in the response buffer
so cross-target delivery is never inferred from transcript order alone.
history(...)
history(...) is intended to ask the control plane for more context than was
included on the inbound turn.
async def node(state: State, runtime: Runtime[AionRuntimeContext]) -> dict:
thread = Thread.from_context(runtime.context)
recent = await thread.history(limit=5)
return {}
This should compile down to a control-plane request that uses the distribution
metadata already attached to the current turn.
history() is not yet fully implemented and currently returns an empty list.
typing()
typing() is intended for stream-only live intents.
async def node(state: State, runtime: Runtime[AionRuntimeContext]) -> dict:
thread = Thread.from_context(runtime.context)
await thread.typing()
return {}
These intents should not replace the durable response precedence. They are
best-effort live hints for streaming views.
Related Pages