agent

package
v0.0.0-...-d758db0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentApp

type AgentApp struct {
	// contains filtered or unexported fields
}

AgentApp represents the Agent application structure

func NewAgentApp

func NewAgentApp(agentName string) (*AgentApp, error)

NewAgentApp creates a new Agent application

func (*AgentApp) Run

func (app *AgentApp) Run() error

Run runs the Agent application

func (*AgentApp) Stop

func (app *AgentApp) Stop()

Stop stops the Agent application

type ChatApp

type ChatApp struct {
	// contains filtered or unexported fields
}

ChatApp represents the chat application structure (merged from chat functionality)

func NewChatApp

func NewChatApp(modelName string, tools []string, system string) *ChatApp

NewChatApp creates a new chat application (merged from chat functionality)

func (*ChatApp) Run

func (app *ChatApp) Run() error

Run runs the Chat application (merged from chat functionality)

func (*ChatApp) Stop

func (app *ChatApp) Stop()

Stop stops the Chat application (merged from chat functionality)

type ErrorMsg

type ErrorMsg string

type Message

type Message struct {
	Type       MessageType
	Content    string
	Name       string     // Tool name (only used for tool messages)
	ToolStatus ToolStatus // Status of tool execution (only used for tool messages)
	Arguments  string     // Tool arguments (only used for tool messages)
	Result     string     // Tool result (only used for tool messages)
	StartTime  int64      // Tool start time (Unix timestamp, only used for tool messages)
	EndTime    int64      // Tool end time (Unix timestamp, only used for tool messages)
}

Message represents a chat message

type MessageType

type MessageType int

MessageType represents the type of a message

const (
	UserMessage MessageType = iota
	AssistantMessage
	ToolStartMessage
	ToolEndMessage
	ErrorMessage
)

type ResponseMsg

type ResponseMsg string

Message type definitions

type StreamChunkMsg

type StreamChunkMsg string

type StreamEndMsg

type StreamEndMsg struct{}

type ToolEndMsg

type ToolEndMsg struct {
	Name   string
	Result string
}

type ToolStartMsg

type ToolStartMsg struct {
	Name      string
	Arguments string
}

type ToolStatus

type ToolStatus int

ToolStatus represents the status of a tool call

const (
	ToolWaiting ToolStatus = iota // Tool is being called (orange)
	ToolSuccess                   // Tool completed successfully (green)
	ToolError                     // Tool failed (red)
)

type ViewModel

type ViewModel struct {
	// contains filtered or unexported fields
}

ViewModel is the model for the Agent interface

func NewViewModel

func NewViewModel(onSendMsg func(string) error) *ViewModel

NewViewModel creates a new ViewModel

func (ViewModel) Init

func (m ViewModel) Init() tea.Cmd

Init initializes the model

func (ViewModel) Update

func (m ViewModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages

func (ViewModel) View

func (m ViewModel) View() string

View renders the interface

Jump to

Keyboard shortcuts

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