MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / format_grammar

Method format_grammar

llama_cpp/llama_grammar.py:937–941  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

935 return rule
936
937 def format_grammar(self):
938 return "\n".join(
939 f"{name} ::= {rule}"
940 for name, rule in sorted(self._rules.items(), key=lambda kv: kv[0])
941 )
942
943
944def json_schema_to_gbnf(schema: str, prop_order: Optional[List[str]] = None):

Callers 1

json_schema_to_gbnfFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected