mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Update image outputs to default to high detail (#18386)
Do not assume the default `detail`.
This commit is contained in:
committed by
GitHub
Unverified
parent
e3c2acb9cd
commit
53b1570367
@@ -1,5 +1,6 @@
|
||||
use serde_json::Value as JsonValue;
|
||||
|
||||
use crate::response::DEFAULT_IMAGE_DETAIL;
|
||||
use crate::response::FunctionCallOutputContentItem;
|
||||
use crate::response::ImageDetail;
|
||||
|
||||
@@ -81,7 +82,7 @@ pub(super) fn normalize_output_image(
|
||||
}
|
||||
})
|
||||
}
|
||||
None => None,
|
||||
None => Some(DEFAULT_IMAGE_DETAIL),
|
||||
};
|
||||
|
||||
Ok(FunctionCallOutputContentItem::InputImage { image_url, detail })
|
||||
@@ -159,7 +160,7 @@ fn parse_mcp_output_image(
|
||||
.and_then(JsonValue::as_object)
|
||||
.and_then(|meta| meta.get(CODEX_IMAGE_DETAIL_META_KEY))
|
||||
.and_then(JsonValue::as_str)
|
||||
.filter(|detail| *detail == "original")
|
||||
.filter(|detail| matches!(*detail, "auto" | "low" | "high" | "original"))
|
||||
.map(str::to_string);
|
||||
Ok((image_url, detail))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user