BamlValidationError
The BamlValidationError
class represents an error that occurs when BAML fails to parse or validate LLM output.
Type Definition
Type Definition
Properties
type
Literal type identifier for the error class.
message
Error message describing the specific validation failure.
prompt
The original prompt sent to the LLM.
raw_output
The raw output from the LLM that failed validation.
detailed_message
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:
Type Check