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

Method format_grammar

examples/server/server.py:764–768  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

762 return rule
763
764 def format_grammar(self) -> str:
765 return "\n".join(
766 f"{name} ::= {rule}"
767 for name, rule in sorted(self._rules.items(), key=lambda item: item[0])
768 )
769
770 @classmethod
771 def to_gbnf(cls, schema: str, prop_order: Optional[List[str]] = None) -> str:

Callers 1

to_gbnfMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected