LessonOutputParser#

pydantic model LessonOutputParser[source]#

Bases: BaseLessonOutputParser

Parses LLM lesson into a Lesson object

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[source]#

Instructions on how the LLM output should be formatted.

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

Instructions on how the LLM output should be formatted.

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