A path to the module that contains the class, eg. ["langchain", "llms"] Usually should be the same as the entrypoint the class is exported from.
A map of aliases for constructor args. Keys are the attribute names, e.g. "foo". Values are the alias that will replace the key in serialization. This is used to eg. make argument names match Python.
A map of additional attributes to merge with constructor args. Keys are the attribute names, e.g. "foo". Values are the attribute values, which will be serialized. These attributes need to be accepted by the constructor as arguments.
The final serialized identifier for the module.
A map of secrets, which will be omitted from serialization. Keys are paths to the secret in constructor args, e.g. "foo.bar.baz". Values are the secret ids, which will be used when deserializing.
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.
Optional
callbackManager: CallbackManagerCallback 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
Optional
callbackManager: CallbackManagerStatic
createCreate prompt in the style of the agent.
List of tools the agent will have access to, used to format the prompt.
Optional
args: StructuredChatCreatePromptArgsArguments to create the prompt with.
Static
createCreates 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.
Static
deserializeStatic
fromLLMAndCreates 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.
Optional
args: StructuredChatCreatePromptArgs & AgentArgsOptional arguments to customize the creation of the agent. Can include arguments for creating the prompt and AgentArgs.
A new instance of StructuredChatAgent.
Static
getReturns a default output parser for the StructuredChatAgent. If an LLM is provided, it creates an output parser with retry logic from the LLM.
Optional
fields: OutputParserArgs & { Optional fields to customize the output parser. Can include an LLM and a list of tool names.
An instance of StructuredChatOutputParserWithRetries.
Static
lc_Static
validateValidates that all provided tools have a description. Throws an error if any tool lacks a description.
Array of StructuredTool instances to validate.
Generated using TypeDoc
Agent that interoperates with Structured Tools using React logic.