Documentation
¶
Index ¶
- func ConvertToolToFunctionDefinition(tools []tool.Tool) []llm.Tool
- func NewSopAgent(opts ...Option) (schema.Agent, error)
- func NewWatcherAgent(opts ...Option) (schema.Agent, error)
- type BaseAgent
- func (ba *BaseAgent) Description() string
- func (ba *BaseAgent) Env() schema.Environment
- func (ba *BaseAgent) Name() string
- func (ba *BaseAgent) Plan(ctx context.Context, messages []schema.Message, steps []schema.StepAction, ...) ([]schema.StepFeedback, []schema.StepAction, []schema.Message, int, error)
- func (ba *BaseAgent) Run(ctx context.Context, messages []schema.Message, opts ...llm.GenerateOption) (*schema.Generation, error)
- func (ba *BaseAgent) Tools() []tool.Tool
- func (ba *BaseAgent) WithEnv(env schema.Environment)
- type Option
- func WithCallback(callback callback.Handler) Option
- func WithDesc(desc string) Option
- func WithEnv(env schema.Environment) Option
- func WithFeedbacks(feedbacks ...feedback.Feedback) Option
- func WithFilterMemoryFunc(fun func([]schema.Message) []schema.Message) Option
- func WithInstruction(instruction string) Option
- func WithLLM(LLM llm.LLM) Option
- func WithMaxIterations(maxIterations int) Option
- func WithName(name string) Option
- func WithParseOutputFunc(...) Option
- func WithPrompt(prompt string) Option
- func WithRole(role string) Option
- func WithSuffix(suffix string) Option
- func WithTools(actions []tool.Tool) Option
- func WithUseFunctionCall(useFunctionCall bool) Option
- func WithVars(k, v string) Option
- type Options
- type UserProxyAgent
- func (a *UserProxyAgent) Description() string
- func (a *UserProxyAgent) Env() schema.Environment
- func (a *UserProxyAgent) Name() string
- func (a *UserProxyAgent) Run(ctx context.Context, messages []schema.Message, opts ...llm.GenerateOption) (*schema.Generation, error)
- func (a *UserProxyAgent) Tools() []tool.Tool
- func (a *UserProxyAgent) WithEnv(_ schema.Environment)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToolToFunctionDefinition ¶ added in v0.2.0
Types ¶
type BaseAgent ¶
type BaseAgent struct {
MaxIterations int
// contains filtered or unexported fields
}
func NewBaseAgent ¶
func (*BaseAgent) Description ¶
func (*BaseAgent) Env ¶
func (ba *BaseAgent) Env() schema.Environment
func (*BaseAgent) Plan ¶
func (ba *BaseAgent) Plan(ctx context.Context, messages []schema.Message, steps []schema.StepAction, opts ...llm.GenerateOption) ( []schema.StepFeedback, []schema.StepAction, []schema.Message, int, error)
func (*BaseAgent) Run ¶
func (ba *BaseAgent) Run(ctx context.Context, messages []schema.Message, opts ...llm.GenerateOption) (*schema.Generation, error)
func (*BaseAgent) WithEnv ¶
func (ba *BaseAgent) WithEnv(env schema.Environment)
type Option ¶
type Option func(opt *Options)
func WithCallback ¶
func WithEnv ¶
func WithEnv(env schema.Environment) Option
func WithFeedbacks ¶
func WithFilterMemoryFunc ¶
func WithInstruction ¶
func WithMaxIterations ¶
func WithParseOutputFunc ¶
func WithParseOutputFunc(fun func(string, *llm.Generation) ([]schema.StepAction, []schema.Message, error)) Option
func WithPrompt ¶
func WithSuffix ¶
func WithUseFunctionCall ¶ added in v0.2.0
type Options ¶
type Options struct {
LLM llm.LLM
Tools []tool.Tool
FeedbackChain feedback.Feedback
Env schema.Environment
Callback callback.Handler
FilterMemoryFunc func([]schema.Message) []schema.Message
ParseOutputFunc func(string, *llm.Generation) ([]schema.StepAction, []schema.Message, error)
Vars map[string]string
MaxIterations int
// contains filtered or unexported fields
}
type UserProxyAgent ¶
type UserProxyAgent struct {
// contains filtered or unexported fields
}
func NewUserProxy ¶
func NewUserProxy(name, desc string, command bool) *UserProxyAgent
func (*UserProxyAgent) Description ¶
func (a *UserProxyAgent) Description() string
func (*UserProxyAgent) Env ¶
func (a *UserProxyAgent) Env() schema.Environment
func (*UserProxyAgent) Name ¶
func (a *UserProxyAgent) Name() string
func (*UserProxyAgent) Run ¶
func (a *UserProxyAgent) Run(ctx context.Context, messages []schema.Message, opts ...llm.GenerateOption) (*schema.Generation, error)
func (*UserProxyAgent) Tools ¶
func (a *UserProxyAgent) Tools() []tool.Tool
func (*UserProxyAgent) WithEnv ¶
func (a *UserProxyAgent) WithEnv(_ schema.Environment)
Click to show internal directories.
Click to hide internal directories.