Serde¶
lm15.serde — Serialization and deserialization for the lm15 type system.
One function pair per type: xxx_to_dict / xxx_from_dict. All Part field names are consistent: "input" on the wire matches .input in memory. No name translation (no "arguments" vs "input" split).
part_to_dict(part: Part) -> dict[str, Any]
¶
Serialize a Part to the canonical lm15 JSON format.
part_from_dict(d: dict[str, Any]) -> Part
¶
Deserialize a Part from the canonical lm15 JSON format.
file_upload_request_to_dict(r: FileUploadRequest) -> dict[str, Any]
¶
Bytes travel as base64 (the media-part precedent); a path-backed request serializes its path as a plain string, exactly like path-addressed media Parts — meaningful only where the filesystem is shared, which is the same caveat Parts already carry.