msgs

package
v1.22.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssistantContentUpdated

type AssistantContentUpdated struct {
	TurnID  domain.MessageID // user message ID that started this turn
	Message domain.Message
}

AssistantContentUpdated is fired as the assistant message streams in.

type StreamCompleted

type StreamCompleted struct {
	TurnID        domain.MessageID // user message ID that started this turn
	Message       domain.Message
	Title         string // AI-generated conversation title, if provided
	ContextWindow int    // model's max token capacity
	InputTokens   int    // tokens consumed by input this turn
	OutputTokens  int    // tokens generated by output this turn
}

StreamCompleted is fired when the assistant stream finishes.

type StreamFailed added in v1.11.0

type StreamFailed struct {
	TurnID domain.MessageID // user message ID that started this turn
	Err    error
}

StreamFailed is fired when the assistant stream encounters an error.

type ToolCompleted

type ToolCompleted struct {
	TurnID    domain.MessageID
	ToolUseID string
	Result    domaintools.Result
	Error     error
}

ToolCompleted is fired when any tool finishes executing.

func (ToolCompleted) ResultOrError added in v1.22.3

func (m ToolCompleted) ResultOrError() domaintools.Result

ResultOrError returns the tool result, wrapping Error when present.

type ToolResultMessagePersisted added in v1.22.3

type ToolResultMessagePersisted struct {
	Message domain.Message
}

ToolResultMessagePersisted is fired when the round persists an internal user tool_result message during a tool loop. The top-level chat session uses this to keep in-memory request history aligned with round-local state.

type ToolResultsReady

type ToolResultsReady struct {
	TurnID  domain.MessageID     // identifies which turn completed
	Results []domaintools.Result // collected tool results
}

ToolResultsReady is fired by a turn when all tool results are collected. This is internal to round - it triggers the next turn in the tool loop.

type TurnStarted

type TurnStarted struct {
	UserMessageID  domain.MessageID
	ConversationID domain.ConversationID
}

TurnStarted is fired when a new turn begins within a round.

type UserSubmittedInput

type UserSubmittedInput struct {
	Text        string
	ToolResults []domaintools.Result
}

UserSubmittedInput is fired when user input is ready (text from input bar or tool results).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL