types

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 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 Message

type Message struct {
	Type           MessageType
	Content        string
	Sender         string                // Agent name for assistant messages
	ToolCall       tools.ToolCall        // Associated tool call for tool messages
	ToolDefinition tools.Tool            // Definition of the tool being called
	ToolStatus     ToolStatus            // Status for tool calls
	ToolResult     *tools.ToolCallResult // Result of tool call (when completed)
}

Message represents a single message in the chat

func Agent added in v1.9.12

func Agent(typ MessageType, agentName, content string) *Message

func Cancelled added in v1.9.12

func Cancelled() *Message

func Error added in v1.9.12

func Error(content string) *Message

func ShellOutput added in v1.9.12

func ShellOutput(content string) *Message

func Spinner added in v1.9.12

func Spinner() *Message

func ToolCallMessage added in v1.9.12

func ToolCallMessage(agentName string, toolCall tools.ToolCall, toolDef tools.Tool, status ToolStatus) *Message

func User added in v1.9.12

func User(content string) *Message

func Welcome added in v1.9.12

func Welcome(content string) *Message

type MessageType

type MessageType int

MessageType represents different types of messages

const (
	MessageTypeUser MessageType = iota
	MessageTypeAssistant
	MessageTypeAssistantReasoning
	MessageTypeSpinner
	MessageTypeError
	MessageTypeShellOutput
	MessageTypeCancelled
	MessageTypeToolCall
	MessageTypeToolResult
	MessageTypeWelcome
)

type ToolStatus

type ToolStatus int

ToolStatus represents the status of a tool call

const (
	ToolStatusPending ToolStatus = iota
	ToolStatusConfirmation
	ToolStatusRunning
	ToolStatusCompleted
	ToolStatusError
)

Jump to

Keyboard shortcuts

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