vllm.v1.structured_output.backend_outlines
¶
Classes:
Functions:
-
validate_regex_is_buildable–Validates that the input regex is not using unsupported features
OutlinesGrammar
dataclass
¶
Bases: StructuredOutputGrammar
Methods:
-
accept_tokens–Accepts a list of tokens and advances the FSM.
accept_tokens(request_id, tokens)
¶
Accepts a list of tokens and advances the FSM.
Returns True if all grammar-constrained tokens were accepted. Tokens after termination (EOS) are ignored. Returns False if the FSM failed to advance.
_check_unsupported(parsed)
¶
Check for regex features unsupported by regex-automata.
_prefix_needs_context(parsed)
¶
Return True if there's a look-around/anchor before any consumer.
validate_regex_is_buildable(pattern)
¶
Validates that the input regex is not using unsupported features
of the regex-automata crate (outlines_core regex engine) and has a
universal start state.
definition of universal start state used can be found at:
https://docs.rs/regex-automata/latest/regex_automata/dfa/trait.Automaton.html#method.universal_start_state