agent

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAnthropic

func WithAnthropic(key string, opts ...client.ClientOpt) llm.Opt

func WithGemini added in v0.0.6

func WithGemini(key string, opts ...client.ClientOpt) llm.Opt

func WithMistral added in v0.0.3

func WithMistral(key string, opts ...client.ClientOpt) llm.Opt

func WithOllama

func WithOllama(endpoint string, opts ...client.ClientOpt) llm.Opt

func WithOpenAI added in v0.0.6

func WithOpenAI(key string, opts ...client.ClientOpt) llm.Opt

Types

type Agent

type Agent struct {
	*llm.Opts
}

func New

func New(opts ...llm.Opt) (*Agent, error)

Return a new agent, composed of a series of agents and tools

func (*Agent) AgentNames

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

Return a list of agent names

func (*Agent) AgentsWithName

func (a *Agent) AgentsWithName(name ...string) []llm.Agent

Return a list of agents

func (*Agent) GetModel

func (a *Agent) GetModel(ctx context.Context, name string, agentnames ...string) (llm.Model, error)

Return a model by name. If no agents are specified, then all agents are considered. If multiple agents are specified, then the first model found is returned.

func (*Agent) ListModels

func (a *Agent) ListModels(ctx context.Context, names ...string) ([]llm.Model, error)

Return the models from list of agents

func (*Agent) Model added in v0.0.3

func (a *Agent) Model(ctx context.Context, name string) llm.Model

Return a model

func (*Agent) Models

func (a *Agent) Models(ctx context.Context) ([]llm.Model, error)

Return the models from all agents

func (*Agent) Name

func (a *Agent) Name() string

Return a comma-separated list of agent names

func (*Agent) ToolNames

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

Return a list of tool names

type Model added in v0.0.6

type Model struct {
	Agent     string `json:"agent"`
	llm.Model `json:"model"`
}

func (Model) String added in v0.0.6

func (m Model) String() string

Jump to

Keyboard shortcuts

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