fix: align image generation checks

This commit is contained in:
fawney19
2026-05-21 00:45:02 +08:00
parent 4d0c654822
commit 923515ab28
8 changed files with 41 additions and 20 deletions

View File

@@ -1191,10 +1191,10 @@ mod tests {
use serde_json::json;
use super::{
build_chatgpt_web_image_request_body, build_openai_image_provider_request_body,
is_openai_image_stream_request, normalize_openai_image_request,
normalize_openai_image_request_with_options, openai_image_operation_from_path,
OpenAiImageNormalizeOptions, OpenAiImageOperation,
build_chatgpt_web_image_request_body, build_openai_image_api_provider_request_body,
build_openai_image_provider_request_body, is_openai_image_stream_request,
normalize_openai_image_request, normalize_openai_image_request_with_options,
openai_image_operation_from_path, OpenAiImageNormalizeOptions, OpenAiImageOperation,
};
use crate::formats::openai::image::spec::{resolve_stream_spec, resolve_sync_spec};
use crate::formats::openai::responses::codex::{

View File

@@ -356,6 +356,7 @@ pub fn build_openai_chat_usage_chunk(
)
}
#[allow(clippy::too_many_arguments)]
pub fn build_openai_chat_usage_chunk_with_cache(
id: &str,
model: &str,

View File

@@ -1338,13 +1338,14 @@ mod tests {
let output = utf8(outcome.sse_body);
assert!(output.contains("event: message_start"));
assert!(output.contains("event: message_stop"));
assert!(output.contains("\"stop_reason\":\"end_turn\""));
assert!(!output.contains("status_code"));
assert_eq!(
outcome
.terminal_summary
.as_ref()
.and_then(|summary| summary.finish_reason.as_deref()),
Some("end_turn")
Some("stop")
);
}