Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Prompt ¶
type Prompt struct {
InterruptID string
Event agentdomain.ChatEvent
}
Prompt is one interrupt a suspended run waits on, as the event the chat TUI answers on its ResponseChan. Event is nil for an interrupt of an unknown reason, which the client can only cancel.
type Reducer ¶
type Reducer struct {
// contains filtered or unexported fields
}
Reducer folds the AG-UI events of a thread's runs into the chat events the TUI handlers render: deltas become chunks, a model step its completion and an interrupt the prompt the user answers. It follows one client request across a suspended run and its continuations, and tolerates attaching mid-run.
func New ¶
New builds the reducer for the client request requestID, the id every event it returns carries.
func (*Reducer) Decode ¶
func (r *Reducer) Decode(frame []byte) ([]agentdomain.ChatEvent, End)
Decode reduces one frame into the events it stands for and reports where it leaves the run. A frame that is not an AG-UI event, or one outside a run's vocabulary, reduces to nothing.
type SessionUsageEvent ¶
type SessionUsageEvent struct {
agentdomain.BaseChatEvent
Model string
InputTokens int
OutputTokens int
CachedTokens int
}
SessionUsageEvent is a usage patch read back: the token totals of the run's session after the model step the patch closes. A chat whose agent runs elsewhere mirrors them into its repository, where the status bar reads them, so no handler renders it.