Parses the given text and returns an AgentAction
or AgentFinish
object. Throws an OutputParserException
if the parsing fails.
The text to parse.
Optional
callbacks: CallbackManager | (BaseCallbackHandler | BaseCallbackHandlerMethodsClass)[]A Promise that resolves to an AgentAction
or AgentFinish
object.
Static
fromLLMCreates a new StructuredChatOutputParserWithRetries
instance from a
BaseLanguageModel
and options. The options can include a base parser
and tool names.
A BaseLanguageModel
instance.
Options for creating a StructuredChatOutputParserWithRetries
instance.
A new StructuredChatOutputParserWithRetries
instance.
Generated using TypeDoc
A class that provides a wrapper around the
StructuredChatOutputParser
andOutputFixingParser
classes. It extends theAgentActionOutputParser
class and allows for retrying the output parsing using theOutputFixingParser
if it is provided.Example