bug: default to image (#3501)

Default the MIME type to image
This commit is contained in:
jif-oai
2025-09-11 16:10:24 -07:00
committed by GitHub
parent 8453915e02
commit 44bb53df1e
2 changed files with 1 additions and 21 deletions

View File

@@ -219,7 +219,7 @@ impl From<Vec<InputItem>> for ResponseInputItem {
let mime = mime_guess::from_path(&path)
.first()
.map(|m| m.essence_str().to_owned())
.unwrap_or_else(|| "application/octet-stream".to_string());
.unwrap_or_else(|| "image".to_string());
let encoded = base64::engine::general_purpose::STANDARD.encode(bytes);
Some(ContentItem::InputImage {
image_url: format!("data:{mime};base64,{encoded}"),