Skip to content

Interface: AguiEvent

@kortexya/reasoninglayer


@kortexya/reasoninglayer / Agui / AguiEvent

Interface: AguiEvent

Defined in: src/types/agui.ts:203

A single AG-UI event, decoded from one Server-Sent Events frame.

Remarks

POST /api/v1/agui answers with an AG-UI SSE stream of data-only frames: the discriminator lives inside the JSON payload as type (RUN_STARTEDRUN_FINISHED | RUN_ERROR), and declarative UI arrives as A2UI v0.9 payloads inside CUSTOM (a2ui) events and STATE_SNAPSHOT.a2ui.

The OpenAPI spec declares no schema for the event payloads, so the SDK does not invent one: type is surfaced as the (string) discriminator and every other field is carried through verbatim as JSON. Narrow on type and read the fields the AG-UI protocol defines for that event.

Example

for await (const event of client.agui.run({ threadId: 't1' })) {
if (event.type === 'RUN_ERROR') {
console.error(event['message']);
}
}

Indexable

[key: string]: JsonValue | undefined

Every other field of the event payload, verbatim as the server sent it.

Properties

type

type: string

Defined in: src/types/agui.ts:205

The event discriminator (e.g. RUN_STARTED, CUSTOM, RUN_FINISHED, RUN_ERROR).