隔离 Raw 图片代理实现
Project CI / Repository checks (pull_request) Failing after 14s
Project CI / Backend tests (pull_request) Failing after 14s
Project CI / Frontend tests (pull_request) Successful in 36m40s
Project CI / Native shell tests (pull_request) Successful in 54m1s

移除对现有图片编辑 client 与 curl transport 的复用

将 Raw GPT Image 2 请求、multipart 构造和响应解析收敛到独立文件

保持现有 editor 图片链路代码不变
This commit is contained in:
2026-09-08 13:54:31 +08:00
parent 7fc1b841be
commit f087ba3e2b
6 changed files with 179 additions and 179 deletions
+1 -5
View File
@@ -14,9 +14,7 @@ use crate::{
},
auth::AuthenticatedAccessToken,
http_error::AppError,
openai_image_generation::{
build_openai_image_http_client, map_platform_image_error, require_openai_image_settings,
},
openai_image_generation::{map_platform_image_error, require_openai_image_settings},
request_context::RequestContext,
state::AppState,
};
@@ -63,14 +61,12 @@ pub(crate) async fn edit_raw_image(
Some(authenticated.claims().user_id().to_string()),
None,
);
let http_client = build_openai_image_http_client(&settings)?;
let provider_settings = settings.provider_settings();
let user_id = authenticated.claims().user_id().to_string();
let request_id = request_context.request_id().to_string();
let points_cost = raw_image_edit_price(&state, prepared.width, prepared.height).await?;
let operation = async move {
let generated = create_vector_engine_raw_image_edit(
&http_client,
&provider_settings,
prepared.prompt.as_str(),
&prepared.image,