MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / load

Function load

scripts/decision-eval/eval.py:70–83  ·  view source on GitHub ↗
(coll)

Source from the content-addressed store, hash-verified

68
69
70def load(coll):
71 with open(os.path.join(HERE, f"{coll}.json")) as f:
72 items = json.load(f)
73 out = []
74 for it in items:
75 fields = it.get("fields") or {}
76 if isinstance(fields, str):
77 try:
78 fields = json.loads(fields)
79 except Exception:
80 fields = {}
81 out.append({"ref": it["ref"], "title": it["title"], "content": (it.get("content") or "")[:MAX_BODY],
82 "fields": fields, "collection": coll})
83 return out
84
85
86def call(key, model, state, questions, retries=5):

Callers 1

mainFunction · 0.70

Calls 5

joinMethod · 0.80
loadMethod · 0.65
getMethod · 0.65
openFunction · 0.50
appendMethod · 0.45

Tested by

no test coverage detected