Module structural_tag

Module structural_tag 

Source

Structs§

StructuralTag
The top-level structural tag. Port of StructuralTag.
StructuralTagItem
A single legacy structural-tag item: begin, a JSON schema string, and end. Port of the public StructuralTagItem struct from include/xgrammar/grammar.h.
TagFormat
One begin content end tag. Port of TagFormat.

Enums§

Format
A structural-tag format node. Port of the Format std::variant.
SchemaStyle
The schema style used to convert a Format::JsonSchema into EBNF. Port of JSONSchemaFormat::style ("json", "qwen_xml", "minimax_xml", "deepseek_xml").
StructuralTagError
Error produced while parsing or converting a structural tag.

Functions§

structural_tag_from_items
Build a grammar from a list of StructuralTagItems and trigger prefixes — the legacy Grammar::FromStructuralTag(tags, triggers) entry point.
structural_tag_to_grammar
Convert a structural-tag JSON document into a grammar.

Type Aliases§

StructuralTagResult
Convenience alias for results in this module.