Skip to main content

shape_to_grammar

Function shape_to_grammar 

Source
pub fn shape_to_grammar(shape: &dyn Shape) -> Result<String>
Expand description

Lowers a SIM shape into a constrained-decoding grammar string.

The grammar can be handed to a model runner to constrain generation to values that match shape.