Documentation
¶
Index ¶
- type Agent
- func (a *Agent) AddDate() bool
- func (a *Agent) AddEnvironmentInfo() bool
- func (a *Agent) AddPromptFiles() []string
- func (a *Agent) Commands() types.Commands
- func (a *Agent) ConfiguredModels() []provider.Provider
- func (a *Agent) Description() string
- func (a *Agent) DrainWarnings() []string
- func (a *Agent) Handoffs() []*Agent
- func (a *Agent) HasModelOverride() bool
- func (a *Agent) HasSubAgents() bool
- func (a *Agent) Hooks() *latest.HooksConfig
- func (a *Agent) Instruction() string
- func (a *Agent) MaxIterations() int
- func (a *Agent) Model() provider.Provider
- func (a *Agent) Name() string
- func (a *Agent) NumHistoryItems() int
- func (a *Agent) Parents() []*Agent
- func (a *Agent) SetModelOverride(models ...provider.Provider)
- func (a *Agent) SkillsEnabled() bool
- func (a *Agent) StopToolSets(ctx context.Context) error
- func (a *Agent) SubAgents() []*Agent
- func (a *Agent) ToolSets() []tools.ToolSet
- func (a *Agent) Tools(ctx context.Context) ([]tools.Tool, error)
- func (a *Agent) WelcomeMessage() string
- type Opt
- func WithAddDate(addDate bool) Opt
- func WithAddEnvironmentInfo(addEnvironmentInfo bool) Opt
- func WithAddPromptFiles(addPromptFiles []string) Opt
- func WithCommands(commands types.Commands) Opt
- func WithDescription(description string) Opt
- func WithHandoffs(handoffs ...*Agent) Opt
- func WithHooks(hooks *latest.HooksConfig) Opt
- func WithInstruction(instruction string) Opt
- func WithLoadTimeWarnings(warnings []string) Opt
- func WithMaxIterations(maxIterations int) Opt
- func WithModel(model provider.Provider) Opt
- func WithName(name string) Opt
- func WithNumHistoryItems(numHistoryItems int) Opt
- func WithSkillsEnabled(enabled bool) Opt
- func WithSubAgents(subAgents ...*Agent) Opt
- func WithToolSets(toolSet ...tools.ToolSet) Opt
- func WithTools(allTools ...tools.Tool) Opt
- func WithWelcomeMessage(welcomeMessage string) Opt
- type StartableToolSet
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 (*Agent) AddEnvironmentInfo ¶ added in v1.0.0
func (*Agent) AddPromptFiles ¶ added in v1.6.0
func (*Agent) Commands ¶ added in v1.6.6
Commands returns the named commands configured for this agent.
func (*Agent) ConfiguredModels ¶ added in v1.19.0
ConfiguredModels returns the originally configured models for this agent. This is useful for listing available models in the TUI picker.
func (*Agent) Description ¶
Description returns the agent's description
func (*Agent) DrainWarnings ¶ added in v1.8.2
DrainWarnings returns pending warnings and clears them.
func (*Agent) HasModelOverride ¶ added in v1.19.0
HasModelOverride returns true if a model override is currently set.
func (*Agent) HasSubAgents ¶
HasSubAgents checks if the agent has sub-agents
func (*Agent) Hooks ¶ added in v1.8.2
func (a *Agent) Hooks() *latest.HooksConfig
Hooks returns the hooks configuration for this agent.
func (*Agent) Instruction ¶
Instruction returns the agent's instructions
func (*Agent) MaxIterations ¶ added in v1.3.6
func (*Agent) Model ¶
Model returns the model to use for this agent. If model override(s) are set, it returns one of the overrides (randomly for alloy). Otherwise, it returns a random model from the available models.
func (*Agent) NumHistoryItems ¶ added in v1.5.2
func (*Agent) SetModelOverride ¶ added in v1.19.0
SetModelOverride sets runtime model override(s) for this agent. The override(s) take precedence over the configured models. For alloy models, multiple providers can be passed and one will be randomly selected. Pass no arguments or nil providers to clear the override.
func (*Agent) SkillsEnabled ¶ added in v1.8.2
SkillsEnabled returns whether skills discovery is enabled for this agent.
func (*Agent) WelcomeMessage ¶ added in v1.8.2
WelcomeMessage returns the agent's welcome message
type Opt ¶
type Opt func(a *Agent)
func WithAddDate ¶
func WithAddEnvironmentInfo ¶ added in v1.0.0
func WithAddPromptFiles ¶ added in v1.6.0
func WithCommands ¶ added in v1.6.6
func WithDescription ¶
func WithHandoffs ¶ added in v1.8.2
func WithHooks ¶ added in v1.8.2
func WithHooks(hooks *latest.HooksConfig) Opt
func WithInstruction ¶
func WithLoadTimeWarnings ¶ added in v1.8.2
func WithMaxIterations ¶ added in v1.3.6
func WithNumHistoryItems ¶ added in v1.5.2
func WithSkillsEnabled ¶ added in v1.8.2
func WithSubAgents ¶
func WithToolSets ¶
func WithWelcomeMessage ¶ added in v1.8.2
type StartableToolSet ¶ added in v1.7.1
func (*StartableToolSet) IsStarted ¶ added in v1.8.2
func (s *StartableToolSet) IsStarted() bool
IsStarted returns whether the toolset has been successfully started.