Skip to main content

Module baml_parser

Module baml_parser 

Source
Expand description

Lightweight BAML parser — extracts classes, enums, functions from .baml files.

NOT a full BAML compiler. Parses just enough to generate:

  • Rust structs with #[derive(JsonSchema, Serialize, Deserialize)]
  • Tool definitions with prompts
  • Enum types with string variants

Source of truth stays in .baml files.

Structs§

BamlClass
A parsed BAML class (→ Rust struct).
BamlField
A field within a BAML class.
BamlFunction
A parsed BAML function (→ tool definition + prompt).
BamlModule
All parsed items from BAML source files.

Enums§

BamlType
BAML type representation.