MCPcopy Create free account
hub / github.com/FareedKhan-dev/ai-long-task / _artifact_serializer

Method _artifact_serializer

data/database.py:2422–2426  ·  view source on GitHub ↗

JSON serializer for artifacts that handles bytes

(self, obj)

Source from the content-addressed store, hash-verified

2420 return len(str(value).encode("utf-8"))
2421
2422 def _artifact_serializer(self, obj):
2423 """JSON serializer for artifacts that handles bytes"""
2424 if isinstance(obj, bytes):
2425 return {"__bytes__": base64.b64encode(obj).decode("utf-8")}
2426 raise TypeError(f"Object of type {type(obj)} is not JSON serializable")
2427
2428 def _artifact_deserializer(self, dct):
2429 """JSON deserializer for artifacts that handles bytes"""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected