Skip to main content

Class: OutputFixingParser

output_parsers.OutputFixingParser

Class to parse the output of an LLM call.

Hierarchy​

Constructors​

constructor​

β€’ new OutputFixingParser(Β«destructuredΒ»)

Parameters​

NameType
Β«destructuredΒ»Object
β€ΊΒ parserBaseOutputParser
β€ΊΒ retryChainLLMChain

Overrides​

BaseOutputParser.constructor

Defined in​

langchain/src/output_parsers/fix.ts:24

Properties​

parser​

β€’ parser: BaseOutputParser

Defined in​

langchain/src/output_parsers/fix.ts:8


retryChain​

β€’ retryChain: LLMChain

Defined in​

langchain/src/output_parsers/fix.ts:10

Methods​

_type​

β–Έ _type(): string

Return the string type key uniquely identifying this class of parser

Returns​

string

Inherited from​

BaseOutputParser._type

Defined in​

langchain/src/schema/index.ts:169


getFormatInstructions​

β–Έ getFormatInstructions(): string

Return a string describing the format of the output.

Example

{
"foo": "bar"
}

Returns​

string

Format instructions.

Overrides​

BaseOutputParser.getFormatInstructions

Defined in​

langchain/src/output_parsers/fix.ts:54


parse​

β–Έ parse(completion): Promise<unknown>

Parse the output of an LLM call.

Parameters​

NameTypeDescription
completionstringLLM output to parse.

Returns​

Promise<unknown>

Parsed output.

Overrides​

BaseOutputParser.parse

Defined in​

langchain/src/output_parsers/fix.ts:36


parseWithPrompt​

β–Έ parseWithPrompt(text, _prompt): Promise<unknown>

Parameters​

NameType
textstring
_promptBasePromptValue

Returns​

Promise<unknown>

Inherited from​

BaseOutputParser.parseWithPrompt

Defined in​

langchain/src/schema/index.ts:147


fromLLM​

β–Έ Static fromLLM(llm, parser, fields?): OutputFixingParser

Parameters​

NameType
llmBaseLanguageModel
parserBaseOutputParser
fields?Object
fields.prompt?BasePromptTemplate

Returns​

OutputFixingParser

Defined in​

langchain/src/output_parsers/fix.ts:12