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

Method default

src/utils/others.py:9–15  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected