aion-authoring-langgraph.
Use these helpers when a LangGraph node needs direct control over emitted
messages, cards, artifacts, or reactions. For ordinary reply and post authoring,
the higher-level Thread and Message APIs are the intended fluent surface.
These helpers are intended for use with streaming requests where Aion Server
consumes stream_mode=["values", "messages", "custom", "updates"].
Event Helpers
Functions
emit_artifact(...)
a2a.types.Artifact during graph execution.
Use the framework-agnostic builders from aion.core.a2a (url_artifact,
file_artifact, data_artifact) to construct the artifact before emitting it.
Use cases: generated PDFs or images, chunked file streaming, external file
references, structured data payloads.
Example:
emit_card(...)
TaskStatusUpdateEvent whose message contains a card file part and
extensions=[CardsURI]. When routing is provided, a DataPart with
MessageActionPayload is also attached so the distribution delivers the card
to the correct channel.
Example:
emit_message(...)
ephemeral=False (default):
AIMessage->TaskStatusUpdateEvent(working, message=...); persisted in history.AIMessageChunk->TaskArtifactUpdateEvent(STREAM_DELTA); streamed and not persisted.
ephemeral=True:
AIMessageorAIMessageChunk->TaskArtifactUpdateEvent(EPHEMERAL_MESSAGE).- Emitted to client and filtered out by task store.
- Does not change durable response fallback behavior.
emit_reaction(...)
Message.react(...); it
derives the context and message identifiers from the runtime context.
The
ReactionActionPayload must include:
context_id: Provider-native conversation or thread identifier — take fromcontext.event.payload.context_idmessage_id: Provider-native message identifier to react to — take fromcontext.event.payload.message_idreaction_key: Reaction identifier, such asthumbsuporheartoperation:"add"or"remove"display_value: Optional human-readable reaction text
Related Pages
- Artifact Builders —
url_artifact,file_artifact,data_artifactreference - Card — Card builder API reference
- Thread
- Message
- Event Handlers
- Message Mapping