bytes_field Bytes Bases: Field Source code in griptape/schemas/bytes_field.py 7 8 9 10 11 12 13 14 15 16class Bytes(fields.Field): def _serialize(self, value: Any, attr: Any, obj: Any, **kwargs) -> str: return base64.b64encode(value).decode() def _deserialize(self, value: Any, attr: Any, data: Any, **kwargs) -> bytes: return base64.b64decode(value) def _validate(self, value: Any) -> None: if not isinstance(value, bytes): raise ValidationError("Invalid input type.") _deserialize(value, attr, data, **kwargs) Source code in griptape/schemas/bytes_field.py 11 12def _deserialize(self, value: Any, attr: Any, data: Any, **kwargs) -> bytes: return base64.b64decode(value) _serialize(value, attr, obj, **kwargs) Source code in griptape/schemas/bytes_field.py 8 9def _serialize(self, value: Any, attr: Any, obj: Any, **kwargs) -> str: return base64.b64encode(value).decode() _validate(value) Source code in griptape/schemas/bytes_field.py 14 15 16def _validate(self, value: Any) -> None: if not isinstance(value, bytes): raise ValidationError("Invalid input type.")