A class that provides a wrapper around the StructuredChatOutputParser and OutputFixingParser classes. It extends the AgentActionOutputParser class and allows for retrying the output parsing using the OutputFixingParser if it is provided.

const outputParser = new StructuredChatOutputParserWithRetries.fromLLM(
new ChatOpenAI({ temperature: 0 }),
{
toolNames: ["calculator", "random-number-generator"],
},
);
const result = await outputParser.parse(
"What is a random number between 5 and 10 raised to the second power?"
);

Hierarchy (view full)

Constructors

Constructors