agent

package
v0.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithMistral added in v0.0.3

func WithMistral(key string, opts ...client.ClientOpt) llm.Opt
func WithAnthropic(key string, opts ...client.ClientOpt) llm.Opt {
	return func(o *llm.Opts) error {
		client, err := anthropic.New(key, opts...)
		if err != nil {
			return err
		} else {
			return llm.WithAgent(client)(o)
		}
	}
}

func WithOllama

func WithOllama(endpoint 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

Jump to

Keyboard shortcuts

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