MCPcopy
hub / github.com/Agenta-AI/agenta / encode

Method encode

api/oss/src/core/shared/dtos.py:84–92  ·  view source on GitHub ↗
(self, data: Any)

Source from the content-addressed store, hash-verified

82 }
83
84 def encode(self, data: Any) -> Any:
85 if isinstance(data, dict):
86 return {k: self.encode(v) for k, v in data.items()}
87 elif isinstance(data, list):
88 return [self.encode(item) for item in data]
89 for type_, encoder in self.Config.json_encoders.items():
90 if isinstance(data, type_):
91 return encoder(data)
92 return data
93
94 def model_dump(self, *args, **kwargs) -> dict:
95 kwargs.setdefault("exclude_none", True)

Callers 8

model_dumpMethod · 0.95
validate_testset_limitsFunction · 0.45
map_span_dto_to_span_dbeFunction · 0.45
_blob_idMethod · 0.45
_validate_testset_limitsFunction · 0.45
generate_testset_to_sizeFunction · 0.45
calculate_doc_hashFunction · 0.45

Calls

no outgoing calls

Tested by 2

_validate_testset_limitsFunction · 0.36
generate_testset_to_sizeFunction · 0.36