agent

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownAgentType       = errors.New("unknown agent type")
	ErrAgentNoReturn          = errors.New("no actions or finish was returned by the agent")
	ErrNotFinished            = errors.New("agent not finished before max iterations")
	ErrExecutorInputNotString = errors.New("input to executor is not a string")
	ErrInvalidChainReturnType = errors.New("agent chain did not return a string")
	ErrUnableToParseOutput    = errors.New("unable to parse agent output")
)

Functions

This section is empty.

Types

type AgentType

type AgentType string
const (
	ZeroShotReactDescriptionAgentType       AgentType = "zero-shot-react-description"
	ReactDocstoreAgentType                  AgentType = "react-docstore"
	ConversationalReactDescriptionAgentType AgentType = "conversational-react-description"
)

type ConversationalReactDescription added in v0.0.15

type ConversationalReactDescription struct {
	// contains filtered or unexported fields
}

func NewConversationalReactDescription added in v0.0.15

func NewConversationalReactDescription(llm schema.LLM, tools []schema.Tool) (*ConversationalReactDescription, error)

func (*ConversationalReactDescription) InputKeys added in v0.0.15

func (a *ConversationalReactDescription) InputKeys() []string

func (*ConversationalReactDescription) OutputKeys added in v0.0.15

func (a *ConversationalReactDescription) OutputKeys() []string

func (*ConversationalReactDescription) Plan added in v0.0.15

type ConversationalReactDescriptionOptions added in v0.0.15

type ConversationalReactDescriptionOptions struct {
	Prefix       string
	Instructions string
	Suffix       string
	AIPrefix     string
	OutputKey    string
}

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

func New added in v0.0.4

func New(llm schema.LLM, tools []schema.Tool, aType AgentType) (*Executor, error)

func NewExecutor

func NewExecutor(agent schema.Agent, tools []schema.Tool) (*Executor, error)

func (Executor) Call added in v0.0.4

func (Executor) Callbacks added in v0.0.13

func (e Executor) Callbacks() []schema.Callback

func (Executor) InputKeys

func (e Executor) InputKeys() []string

func (Executor) Memory added in v0.0.13

func (e Executor) Memory() schema.Memory

func (Executor) OutputKeys

func (e Executor) OutputKeys() []string

func (Executor) Type added in v0.0.13

func (e Executor) Type() string

func (Executor) Verbose added in v0.0.13

func (e Executor) Verbose() bool

type ExecutorOptions added in v0.0.4

type ExecutorOptions struct {
	MaxIterations int
	Memory        schema.Memory
	Callbacks     []schema.Callback
	Verbose       bool
}

type ZeroShotReactDescription added in v0.0.15

type ZeroShotReactDescription struct {
	// contains filtered or unexported fields
}

func NewZeroShotReactDescription added in v0.0.15

func NewZeroShotReactDescription(llm schema.LLM, tools []schema.Tool) (*ZeroShotReactDescription, error)

func (*ZeroShotReactDescription) InputKeys added in v0.0.15

func (a *ZeroShotReactDescription) InputKeys() []string

func (*ZeroShotReactDescription) OutputKeys added in v0.0.15

func (a *ZeroShotReactDescription) OutputKeys() []string

func (*ZeroShotReactDescription) Plan added in v0.0.15

func (a *ZeroShotReactDescription) Plan(ctx context.Context, intermediateSteps []schema.AgentStep, inputs map[string]string) ([]schema.AgentAction, *schema.AgentFinish, error)

type ZeroShotReactDescriptionOptions added in v0.0.15

type ZeroShotReactDescriptionOptions struct {
	Prefix       string
	Instructions string
	Suffix       string
	OutputKey    string
}

Jump to

Keyboard shortcuts

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