agent

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

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.1

func (a *Agent) AddEnvironmentInfo() bool

func (*Agent) Description

func (a *Agent) Description() string

Description returns the agent's description

func (*Agent) HasParents

func (a *Agent) HasParents() bool

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) 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) Parents

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

Parents returns the list of parent agent names

func (*Agent) StopToolSets

func (a *Agent) StopToolSets() error

func (*Agent) SubAgents

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

SubAgents returns the list of sub-agent names

func (*Agent) ToolDisplayName added in v0.7.0

func (a *Agent) ToolDisplayName(ctx context.Context, toolName string) string

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

type Opt

type Opt func(a *Agent)

func WithAddDate

func WithAddDate(addDate bool) Opt

func WithAddEnvironmentInfo added in v1.0.1

func WithAddEnvironmentInfo(addEnvironmentInfo bool) Opt

func WithDescription

func WithDescription(description string) Opt

func WithInstruction

func WithInstruction(prompt string) Opt

func WithMemoryManager

func WithMemoryManager(mm memorymanager.Manager) Opt

func WithModel

func WithModel(model provider.Provider) Opt

func WithName

func WithName(name string) Opt

func WithSubAgents

func WithSubAgents(subAgents ...*Agent) Opt

func WithToolSets

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

func WithTools

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

Jump to

Keyboard shortcuts

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