AssistantEvent
AssistantEvent = {
state:AssistantState;type:"state"; } | {message:AssistantMessage;type:"message"; } | {messageId:string;part:AssistantPart;type:"part"; } | {placeholder?:string|null;replying?:boolean;status?:string|null;type:"patch"; }
Defined in: packages/schema/src/assistant/protocol.ts:160
What the event stream sends. state replaces everything and always comes first on a connection; message adds a
message or replaces the one with its id; part adds a part to a message or replaces the one with its id; patch
changes the top-level fields, null clearing one. A backend in place of the built-in one sends these; see
Another backend.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ state: AssistantState; type: "state"; }
state:
AssistantState
The new state.
type:
"state"
Replaces the whole state.
Type Literal
Section titled “Type Literal”{ message: AssistantMessage; type: "message"; }
message
Section titled “message”message:
AssistantMessage
The message.
type:
"message"
Adds or replaces a message.
Type Literal
Section titled “Type Literal”{ messageId: string; part: AssistantPart; type: "part"; }
messageId
Section titled “messageId”messageId:
string
The id of the message the part belongs to.
part:
AssistantPart
The part.
type:
"part"
Adds or replaces a part of a message.
Type Literal
Section titled “Type Literal”{ placeholder?: string | null; replying?: boolean; status?: string | null; type: "patch"; }
placeholder?
Section titled “placeholder?”
optionalplaceholder?:string|null
The new placeholder, or null to clear it.
replying?
Section titled “replying?”
optionalreplying?:boolean
The new replying, when it changes.
status?
Section titled “status?”
optionalstatus?:string|null
The new status, or null to clear it.
type:
"patch"
Changes the state’s top-level fields.