BaseLessonOutputParser#

pydantic model BaseLessonOutputParser[source]#

Bases: BaseOutputParser, ABC

Base lesson plan output parser class

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

dict(**kwargs: Any) → Dict#

Return dictionary representation of output parser.

get_format_instructions() → str#

Instructions on how the LLM output should be formatted.

abstract parse(text: str) → Lesson[source]#

Parse into a lesson with a list of topics.

parse_with_prompt(completion: str, prompt: PromptValue) → Any#

Optional method to parse the output of an LLM call with a prompt.

The prompt is largely provided in the event the OutputParser wants to retry or fix the output in some way, and needs information from the prompt to do so.

Parameters:
  • completion – output of language model

  • prompt – prompt value

Returns:

structured output