1
This commit is contained in:
@@ -177,6 +177,7 @@ pub(crate) fn build_openai_image_request_body(
|
||||
Value::String(build_prompt_with_negative(prompt, negative_prompt)),
|
||||
),
|
||||
("n".to_string(), json!(candidate_count.clamp(1, 4))),
|
||||
("official_fallback".to_string(), Value::Bool(true)),
|
||||
(
|
||||
"size".to_string(),
|
||||
Value::String(normalize_image_size(size)),
|
||||
@@ -613,6 +614,7 @@ mod tests {
|
||||
assert_eq!(body["model"], GPT_IMAGE_2_MODEL);
|
||||
assert_eq!(body["size"], "16:9");
|
||||
assert_eq!(body["n"], 2);
|
||||
assert_eq!(body["official_fallback"], true);
|
||||
assert_eq!(body["image_urls"][0], "data:image/png;base64,abcd");
|
||||
assert!(body["prompt"].as_str().unwrap_or_default().contains("避免"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user