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.
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.
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.
StaticcreateStaticdeserializeLoad an agent from a json-like object describing it.
StaticfromLLMAndCreates 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 & { Optional fields to customize the output parser. Can include an LLM and a list of tool names.
An instance of StructuredChatOutputParserWithRetries.
Staticvalidate
Agent that interoperates with Structured Tools using React logic.
Deprecated
Use the createStructuredChatAgent method instead.