agent

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent added in v0.3.2

type Agent struct {
	*config.Config
	// contains filtered or unexported fields
}

func New added in v0.3.2

func New(cfg *config.Config) *Agent

func (*Agent) Clear added in v0.3.2

func (a *Agent) Clear()

func (*Agent) Messages added in v0.3.2

func (a *Agent) Messages() []Message

func (*Agent) Send added in v0.3.2

func (a *Agent) Send(ctx context.Context, instructions string, input []Content, tools []tool.Tool) iter.Seq2[Message, error]

type CompactionInfo added in v0.3.2

type CompactionInfo struct {
	InProgress bool
	FromTokens int64
	ToTokens   int64
}

type Content added in v0.3.2

type Content struct {
	Text  string
	Image *string // base64 data URL, e.g. "data:image/png;base64,..."
}

type Message added in v0.3.2

type Message struct {
	Role    MessageRole
	Content []Content

	ToolCall   *ToolCall
	ToolResult *ToolResult

	Usage *Usage

	Compaction *CompactionInfo
}

type MessageRole added in v0.3.2

type MessageRole string
const (
	RoleUser      MessageRole = "user"
	RoleAssistant MessageRole = "assistant"
	RoleSystem    MessageRole = "system"
)

type ToolCall added in v0.3.2

type ToolCall struct {
	ID   string
	Name string
	Args string
}

type ToolResult added in v0.3.2

type ToolResult struct {
	ID      string
	Name    string
	Args    string
	Content []Content
}

type Usage added in v0.3.2

type Usage struct {
	InputTokens  int64
	OutputTokens int64
}

Jump to

Keyboard shortcuts

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