MCPcopy Create free account
hub / github.com/NanGePlus/LightRAGTest / convert_response_to_json

Function convert_response_to_json

LightRAG/lightrag/utils.py:74–82  ·  view source on GitHub ↗
(response: str)

Source from the content-addressed store, hash-verified

72
73
74def convert_response_to_json(response: str) -> dict:
75 json_str = locate_json_string_body_from_string(response)
76 assert json_str is not None, f"Unable to parse JSON from response: {response}"
77 try:
78 data = json.loads(json_str)
79 return data
80 except json.JSONDecodeError as e:
81 logger.error(f"Failed to parse JSON: {json_str}")
82 raise e from None
83
84
85def compute_args_hash(*args):

Callers

nothing calls this directly

Tested by

no test coverage detected