agent

package
v0.3.14 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 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]

func (*Agent) Usage added in v0.3.9

func (a *Agent) Usage() Usage

type Content added in v0.3.2

type Content struct {
	Text string

	File *File

	ToolCall   *ToolCall
	ToolResult *ToolResult
}

type File added in v0.3.9

type File struct {
	Name string
	Data string // base64 data URL, e.g. "data:image/png;base64,..."
}

type Message added in v0.3.2

type Message struct {
	Role MessageRole

	Content []Content
}

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 string
}

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