Skip to main content

AG-UI Event Streaming

AGUIStream and AGUIEvent emit typed agent UI events (thought, token, tool_start, tool_end, status, error, done) validated and serialized into Server-Sent Events (text/event-stream) through the shared Rust core.

import asyncio
from ish.integrations.protocols import AGUIStream

async def main() -> None:
stream = AGUIStream()
await stream.emit("status", {"step": "planning"})
await stream.emit("token", {"text": "Ready."})
await stream.close()

async for sse_frame in stream.sse_stream():
print(sse_frame)

asyncio.run(main())

Emit events, serialize SSE​