MCPcopy Create free account
hub / github.com/THUDM/AgentTuning / default

Method default

AgentBench.old/src/utils.py:14–20  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

12 """Convert numpy classes to JSON serializable objects."""
13
14 def default(self, obj):
15 if isinstance(obj, (np.integer, np.floating, np.bool_)):
16 return obj.item()
17 elif isinstance(obj, np.ndarray):
18 return obj.tolist()
19 else:
20 return super(JsonEncoder, self).default(obj)
21
22
23def serialize(obj, max_depth=5, compress=False):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected