BamlClientFinishReasonError
The BamlClientFinishReasonError
class represents an error that occurs when an LLM terminates with a disallowed finish reason.
You can allow or disallow finish reasons like this:
Type Definition
Properties
Literal type identifier for the error class.
Error message describing the specific finish reason that caused the termination.
The original prompt sent to the LLM.
The partial output received from the LLM before termination.
Comprehensive error information that includes the complete history of all failed attempts when using fallback clients or retry policies. When multiple attempts are made (via fallback or retry), this field contains formatted details about each failed attempt, making it invaluable for debugging complex client configurations.
Type Guards
The error can be identified using TypeScript’s instanceof
operator: