as Materializable Asset
fun MediaPart.asMaterializableAsset(name: String? = null, id: String = HexFormat.of().formatHex(MessageDigest.getInstance("SHA-256").digest(data))): MaterializableAsset
Convert a binary MediaPart into a MaterializableAsset for storage in an com.embabel.chat.spi.AssetStore or tracking in a conversation.
Parameters
name
Optional asset name. Defaults to the document filename, or "document"/"image".
id
Optional stable identifier. Defaults to the SHA-256 hex digest of data, ensuring that converting the same media part repeatedly produces a repeatable asset ID.