package
0.0.0-20250219065129-52aed497bc00
Repository: https://github.com/infinilabs/coco-server.git
Documentation: pkg.go.dev

# Functions

Deprecated: This may be removed in the future; please use NewExecutor instead.
No description provided by the author
NewExecutor creates a new agent executor with an agent and the tools the agent can use.
NewOneShotAgent creates a new OneShotZeroAgent with the given LLM model, tools, and options.
NewOpenAIFunctionsAgent creates a new OpenAIFunctionsAgent.
No description provided by the author
NewParserErrorHandler creates a new parser error handler.
WithCallbacksHandler is an option for setting a callback handler to an executor.
WithMaxIterations is an option for setting the max number of iterations the executor will complete.
WithMemory is an option for setting the memory of the executor.
WithOutputKey is an option for setting the output key of the agent.
WithParserErrorHandler is an option for setting a parser error handler to an executor.
WithPrompt is an option for setting the prompt the agent will use.
WithPromptFormatInstructions is an option for setting the format instructions of the prompt used by the agent.
WithPromptPrefix is an option for setting the prefix of the prompt used by the agent.
WithPromptSuffix is an option for setting the suffix of the prompt used by the agent.
WithReturnIntermediateSteps is an option for making the executor return the intermediate steps taken.

# Constants

ConversationalReactDescription is an AgentType constant that represents the "conversationalReactDescription" agent type.
ZeroShotReactDescription is an AgentType constant that represents the "zeroShotReactDescription" agent type.

# Variables

ErrAgentNoReturn is returned if the agent returns no actions and no finish.
ErrExecutorInputNotString is returned if an input to the executor call function is not a string.
ErrInvalidChainReturnType is returned if the internal chain of the agent returns a value in the "text" filed that is not a string.
ErrInvalidOptions is returned if the options given to the initializer is invalid.
ErrNotFinished is returned if the agent does not give a finish before the number of iterations is larger than max iterations.
ErrUnableToParseOutput is returned if the output of the llm is unparsable.
ErrUnknownAgentType is returned if the type given to the initializer is invalid.

# Structs

ConversationalAgent is a struct that represents an agent responsible for deciding what to do or give the final output if the task is finished given a set of inputs and previous steps taken.
Executor is the chain responsible for running agents.
OneShotZeroAgent is a struct that represents an agent responsible for deciding what to do or give the final output if the task is finished given a set of inputs and previous steps taken.
OpenAIFunctionsAgent is an Agent driven by OpenAIs function powered API.
No description provided by the author
No description provided by the author
ParserErrorHandler is the struct used to handle parse errors from the agent in the executor.

# Interfaces

Agent is the interface all agents must implement.

# Type aliases

AgentType is a string type representing the type of agent to create.
Option is a function type that can be used to modify the creation of the agents and executors.