MCPcopy Create free account
hub / github.com/nlweb-ai/NLWeb / trim_json_hard

Function trim_json_hard

AskAgent/python/core/utils/json_utils.py:33–44  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

31 return obj
32
33def trim_json_hard(obj):
34 obj = jsonify(obj)
35 objType = obj.get("@type", ["Thing"])
36 if not isinstance(objType, list):
37 objType = [objType]
38 if (objType == ["Thing"]):
39 return obj
40 if ("Recipe" in objType):
41 return trim_recipe_hard(obj)
42 if ("Movie" in objType or "TVSeries" in objType):
43 return trim_movie(obj, hard=True)
44 return obj
45
46
47def trim_recipe(obj):

Callers 1

rankItemMethod · 0.90

Calls 4

getMethod · 0.80
jsonifyFunction · 0.70
trim_recipe_hardFunction · 0.70
trim_movieFunction · 0.70

Tested by

no test coverage detected