Class: Langchain::OutputParsers::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/langchain/output_parsers/base.rb

Overview

This class is abstract.

Structured output parsers from the LLM.

Direct Known Subclasses

OutputFixingParser, StructuredOutputParser

Instance Method Summary collapse

Instance Method Details

#get_format_instructionsString

Return a string describing the format of the output.

“‘json

"foo": "bar"

“‘

Examples:

returns the format instructions

Returns:

  • (String)

    Format instructions.

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/langchain/output_parsers/base.rb', line 27

def get_format_instructions
  raise NotImplementedError
end

#parse(text:) ⇒ Object

Parse the output of an LLM call.

Parameters:

  • text
    • LLM output to parse.

Returns:

  • (Object)

    Parsed output.

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/langchain/output_parsers/base.rb', line 13

def parse(text:)
  raise NotImplementedError
end