MCPcopy Create free account
hub / github.com/DVampire/FinAgent / check_json

Function check_json

finagent/utils/json_utils.py:25–30  ·  view source on GitHub ↗
(json_string)

Source from the content-addressed store, hash-verified

23 json5.dump(json_dict, fp, ensure_ascii=False, indent=indent)
24
25def check_json(json_string):
26 try:
27 json5.loads(json_string)
28 return True
29 except json.JSONDecodeError:
30 return False
31
32def refine_json(json_string):
33 json_string = json_string.strip().replace('\r', '').replace('\t', '').replace('\n', '').replace('\\', '')

Callers 1

refine_jsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected