generated_chat_parser
Parses ChatML output from a LLM generation
This module provides a parser for the output of a chat conversation generated by a Large Language Model (LLM). The parser is designed to handle the output of a conversation between a human and an AI, where the AI’s responses are structured JSON objects. The parser will validate the output and return a normalized conversation object.
Warning
This module has been held over prior to the 2024 refactor and is out of date. Classes are marked as deprecated and will be removed in the future.
Attributes
Classes
ChatParserException
Bases: Exception
Raised when there is an error parsing chat output.
GeneratedChatOutputParser
Bases: BaseOutputParser[CanonicalChat]
Parses an output chat conversation. Leverages a simplified syntax so that we don’t have to worry about confusing the LLM with ChatML tags