MCPcopy Index your code
hub / github.com/abetlen/llama-cpp-python / from_string

Method from_string

llama_cpp/llama_grammar.py:25–26  ·  view source on GitHub ↗
(cls, grammar: str, verbose: bool = True)

Source from the content-addressed store, hash-verified

23
24 @classmethod
25 def from_string(cls, grammar: str, verbose: bool = True) -> "LlamaGrammar":
26 return cls(_grammar=grammar)
27
28 @classmethod
29 def from_file(cls, file: Union[str, Path], verbose: bool = True) -> "LlamaGrammar":

Callers 15

from_fileMethod · 0.80
from_json_schemaMethod · 0.80
__init__Method · 0.80
chat_completion_handlerFunction · 0.80
_grammar_for_jsonFunction · 0.80
functionary_chat_handlerFunction · 0.80
get_grammarFunction · 0.80
__call__Method · 0.80
__call__Method · 0.80
chatml_function_callingFunction · 0.80

Calls

no outgoing calls

Tested by 2

test_real_llamaFunction · 0.64
test_grammar_from_stringFunction · 0.64