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

Function _parse_json_object_arg

llama_cpp/server/cli.py:72–79  ·  view source on GitHub ↗
(arg: str | bytes)

Source from the content-addressed store, hash-verified

70
71
72def _parse_json_object_arg(arg: str | bytes) -> dict[str, Any]:
73 if isinstance(arg, bytes):
74 arg = arg.decode("utf-8")
75
76 value = json.loads(arg)
77 if not isinstance(value, dict):
78 raise ValueError(f"Invalid JSON object argument: {arg}")
79 return value
80
81
82def add_args_from_model(parser: argparse.ArgumentParser, model: Type[BaseModel]):

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…