Return the string type key uniquely identifying multi or single action agents.
Return the string type key uniquely identifying this class of agent.
Constructs the agent's scratchpad from a list of steps. If the agent's scratchpad is not empty, it prepends a message indicating that the agent has not seen any previous work.
Array of AgentStep instances to construct the scratchpad from.
A Promise that resolves to a string representing the agent's scratchpad.
Name of tool to use to terminate the chain.
Prefix to append the LLM call with.
Prefix to append the observation with.
Decide what to do given some input.
Steps the LLM has taken so far, along with observations from each.
User inputs.
OptionalcallbackManager: anyCallback manager to use for this call.
Action specifying what tool to use.
Prepare the agent for output, if needed
Return response when agent has been stopped due to max iterations
OptionalcallbackManager: anyStaticcreateCreate prompt in the style of the agent.
List of tools the agent will have access to, used to format the prompt.
Optionalargs: StructuredChatCreatePromptArgsArguments to create the prompt with.
Interface for arguments used to create a prompt for a StructuredChatAgent.
OptionalhumanMessageTemplate?: stringString to use directly as the human message template.
OptionalinputVariables?: string[]List of input variables the final prompt will expect.
OptionalmemoryPrompts?: BaseMessagePromptTemplate[]List of historical prompts from memory.
Optionalprefix?: stringString to put before the list of tools.
Optionalsuffix?: stringString to put after the list of tools.
StaticcreateCreates a string representation of the schemas of the provided tools.
Array of StructuredTool instances to create the schemas string from.
A string representing the schemas of the provided tools.
StaticdeserializeLoad an agent from a json-like object describing it.
StaticfromCreates a StructuredChatAgent from an LLM and a list of tools. Validates the tools, creates a prompt, and sets up an LLM chain for the agent.
BaseLanguageModel instance to create the agent from.
Array of StructuredTool instances to create the agent from.
Optionalargs: StructuredChatCreatePromptArgs & AgentArgsOptional arguments to customize the creation of the agent. Can include arguments for creating the prompt and AgentArgs.
A new instance of StructuredChatAgent.
StaticgetReturns a default output parser for the StructuredChatAgent. If an LLM is provided, it creates an output parser with retry logic from the LLM.
Optionalfields: OutputParserArgs & { toolNames: string[] }Optional fields to customize the output parser. Can include an LLM and a list of tool names.
An instance of StructuredChatOutputParserWithRetries.
Staticlc_StaticvalidateValidates that all provided tools have a description. Throws an error if any tool lacks a description.
Array of StructuredTool instances to validate.
Agent that interoperates with Structured Tools using React logic.