Skip to main content

Class: ListOutputParser

output_parsers.ListOutputParser

Class to parse the output of an LLM call to a list.

Hierarchy

Constructors

constructor

new ListOutputParser()

Inherited from

BaseOutputParser.constructor

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

Abstract getFormatInstructions(): string

Return a string describing the format of the output.

Example

{
"foo": "bar"
}

Returns

string

Format instructions.

Inherited from

BaseOutputParser.getFormatInstructions

Defined in

langchain/src/schema/index.ts:164


parse

Abstract parse(text): Promise<string[]>

Parse the output of an LLM call.

Parameters

NameTypeDescription
textstringLLM output to parse.

Returns

Promise<string[]>

Parsed output.

Overrides

BaseOutputParser.parse

Defined in

langchain/src/output_parsers/list.ts:8


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