简化图片编辑 multipart 请求分支
统一通过带选项的 multipart 传输函数发送请求 移除冗余包装函数调用与未使用导入
This commit is contained in:
@@ -15,7 +15,6 @@ use super::{
|
||||
},
|
||||
curl_transport::{
|
||||
map_curl_error, send_vector_engine_json_request_with_curl,
|
||||
send_vector_engine_multipart_edit_request_with_curl,
|
||||
send_vector_engine_multipart_edit_request_with_curl_options,
|
||||
},
|
||||
error::PlatformImageError,
|
||||
@@ -640,37 +639,20 @@ pub async fn create_vector_engine_image_edit_with_references_and_model_and_optio
|
||||
&mut recovered_failure_audits,
|
||||
));
|
||||
};
|
||||
let response = match match options {
|
||||
Some(options) => {
|
||||
send_vector_engine_multipart_edit_request_with_curl_options(
|
||||
request_url.as_str(),
|
||||
settings.api_key.as_str(),
|
||||
upstream_model,
|
||||
prompt,
|
||||
negative_prompt,
|
||||
normalized_size.as_str(),
|
||||
candidate_count,
|
||||
reference_images,
|
||||
Some(options),
|
||||
attempt_timeout_ms,
|
||||
)
|
||||
.await
|
||||
}
|
||||
None => {
|
||||
send_vector_engine_multipart_edit_request_with_curl(
|
||||
request_url.as_str(),
|
||||
settings.api_key.as_str(),
|
||||
upstream_model,
|
||||
prompt,
|
||||
negative_prompt,
|
||||
normalized_size.as_str(),
|
||||
candidate_count,
|
||||
reference_images,
|
||||
attempt_timeout_ms,
|
||||
)
|
||||
.await
|
||||
}
|
||||
} {
|
||||
let response = send_vector_engine_multipart_edit_request_with_curl_options(
|
||||
request_url.as_str(),
|
||||
settings.api_key.as_str(),
|
||||
upstream_model,
|
||||
prompt,
|
||||
negative_prompt,
|
||||
normalized_size.as_str(),
|
||||
candidate_count,
|
||||
reference_images,
|
||||
options,
|
||||
attempt_timeout_ms,
|
||||
)
|
||||
.await;
|
||||
let response = match response {
|
||||
Ok(response) => {
|
||||
if should_retry_vector_engine_upstream_response(
|
||||
response.status,
|
||||
|
||||
Reference in New Issue
Block a user