Skip to main content

resolve_image_ref

Function resolve_image_ref 

Source
pub fn resolve_image_ref(raw: &str) -> Result<String, String>
Expand description

Resolve an image reference into something a multimodal API accepts: an http(s)/data: URL passes through unchanged; a local path is read and encoded into a data:<mime>;base64,… URL (local inference servers can’t fetch arbitrary URLs). Returns an error string the caller surfaces.