agent

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: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

Agent represents an AI agent

func New

func New(name, prompt string, opts ...Opt) *Agent

New creates a new agent

func (*Agent) AddDate

func (a *Agent) AddDate() bool

func (*Agent) AddEnvironmentInfo added in v1.0.0

func (a *Agent) AddEnvironmentInfo() bool

func (*Agent) AddPromptFiles added in v1.6.0

func (a *Agent) AddPromptFiles() []string

func (*Agent) Commands added in v1.6.6

func (a *Agent) Commands() map[string]string

Commands returns the named commands configured for this agent.

func (*Agent) Description

func (a *Agent) Description() string

Description returns the agent's description

func (*Agent) DrainWarnings added in v1.9.1

func (a *Agent) DrainWarnings() []string

DrainWarnings returns pending warnings and clears them.

func (*Agent) Handoffs added in v1.9.20

func (a *Agent) Handoffs() []*Agent

Handoffs returns the list of handoff agents

func (*Agent) HasSubAgents

func (a *Agent) HasSubAgents() bool

HasSubAgents checks if the agent has sub-agents

func (*Agent) Instruction

func (a *Agent) Instruction() string

Instruction returns the agent's instructions

func (*Agent) MaxIterations added in v1.3.6

func (a *Agent) MaxIterations() int

func (*Agent) Model

func (a *Agent) Model() provider.Provider

Model returns a random model from the available models

func (*Agent) Name

func (a *Agent) Name() string

func (*Agent) NumHistoryItems added in v1.5.2

func (a *Agent) NumHistoryItems() int

func (*Agent) Parents

func (a *Agent) Parents() []*Agent

Parents returns the list of parent agent names

func (*Agent) SkillsEnabled added in v1.15.0

func (a *Agent) SkillsEnabled() bool

SkillsEnabled returns whether skills discovery is enabled for this agent.

func (*Agent) StopToolSets

func (a *Agent) StopToolSets(ctx context.Context) error

func (*Agent) SubAgents

func (a *Agent) SubAgents() []*Agent

SubAgents returns the list of sub-agents

func (*Agent) ToolSets

func (a *Agent) ToolSets() []tools.ToolSet

func (*Agent) Tools

func (a *Agent) Tools(ctx context.Context) ([]tools.Tool, error)

Tools returns the tools available to this agent

func (*Agent) WelcomeMessage added in v1.9.11

func (a *Agent) WelcomeMessage() string

WelcomeMessage returns the agent's welcome message

type Opt

type Opt func(a *Agent)

func WithAddDate

func WithAddDate(addDate bool) Opt

func WithAddEnvironmentInfo added in v1.0.0

func WithAddEnvironmentInfo(addEnvironmentInfo bool) Opt

func WithAddPromptFiles added in v1.6.0

func WithAddPromptFiles(addPromptFiles []string) Opt

func WithCommands added in v1.6.6

func WithCommands(commands map[string]string) Opt

func WithDescription

func WithDescription(description string) Opt

func WithHandoffs added in v1.9.20

func WithHandoffs(handoffs ...*Agent) Opt

func WithInstruction

func WithInstruction(instruction string) Opt

func WithLoadTimeWarnings added in v1.9.1

func WithLoadTimeWarnings(warnings []string) Opt

func WithMaxIterations added in v1.3.6

func WithMaxIterations(maxIterations int) Opt

func WithModel

func WithModel(model provider.Provider) Opt

func WithName

func WithName(name string) Opt

func WithNumHistoryItems added in v1.5.2

func WithNumHistoryItems(numHistoryItems int) Opt

func WithSkillsEnabled added in v1.15.0

func WithSkillsEnabled(enabled bool) Opt

func WithSubAgents

func WithSubAgents(subAgents ...*Agent) Opt

func WithToolSets

func WithToolSets(toolSet ...tools.ToolSet) Opt

func WithTools

func WithTools(allTools ...tools.Tool) Opt

func WithWelcomeMessage added in v1.9.11

func WithWelcomeMessage(welcomeMessage string) Opt

type StartableToolSet added in v1.7.1

type StartableToolSet struct {
	tools.ToolSet
	// contains filtered or unexported fields
}

func (*StartableToolSet) IsStarted added in v1.16.0

func (s *StartableToolSet) IsStarted() bool

IsStarted returns whether the toolset has been started.

Jump to

Keyboard shortcuts

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