diff --git a/server-rs/crates/api-server/src/editor_project_icon_specs.rs b/server-rs/crates/api-server/src/editor_project_icon_specs.rs index fdd85d2a8..eafff07d1 100644 --- a/server-rs/crates/api-server/src/editor_project_icon_specs.rs +++ b/server-rs/crates/api-server/src/editor_project_icon_specs.rs @@ -5,7 +5,7 @@ use axum::{ extract::{Extension, State}, http::StatusCode, }; -use platform_llm::{LlmMessage, LlmRunRequest}; +use platform_llm::{EDITOR_AGENT_GPT5_MODEL, LlmMessage, LlmRunRequest}; use serde::{Deserialize, Deserializer, Serialize, Serializer, de}; use serde_json::{Value, json}; use shared_contracts::assets::EditorCanvasGenerationCompletionPayload; @@ -260,15 +260,17 @@ async fn run_icon_spec_extra_param_llm( state: &AppState, prompt: String, ) -> Result { - let configured_llm_client = state.llm_client().ok_or_else(|| { + let configured_llm_client = state.vector_engine_llm_client().ok_or_else(|| { AppError::from_status(StatusCode::SERVICE_UNAVAILABLE).with_details(json!({ "provider": "editor-icon-spec-llm", - "message": "服务端尚未配置可用的 LLM API Key", + "message": "服务端尚未配置可用的 VectorEngine LLM API Key", })) })?; let retry_backoff_ms = configured_llm_client.config().retry_backoff_ms(); let llm_client = configured_llm_client.clone().with_max_retries(0); - let request = LlmRunRequest::new(vec![LlmMessage::user(prompt)]); + let request = LlmRunRequest::new(vec![LlmMessage::user(prompt)]) + .with_model(EDITOR_AGENT_GPT5_MODEL) + .with_openai_chat(); for attempt in 1..=ICON_SPEC_LLM_MAX_ATTEMPTS { match llm_client.run(request.clone()).await { diff --git a/server-rs/crates/api-server/src/llm/icon_specs.rs b/server-rs/crates/api-server/src/llm/icon_specs.rs index f8591159d..9ab92221d 100644 --- a/server-rs/crates/api-server/src/llm/icon_specs.rs +++ b/server-rs/crates/api-server/src/llm/icon_specs.rs @@ -3,7 +3,7 @@ use axum::{ extract::{Extension, State}, http::StatusCode, }; -use platform_llm::{LlmMessage, LlmRunRequest}; +use platform_llm::{EDITOR_AGENT_GPT5_MODEL, LlmMessage, LlmRunRequest}; use serde::Deserialize; use serde_json::{Value, json}; use std::time::Duration; @@ -144,15 +144,17 @@ fn normalize_refined_text(value: &str) -> Result { } async fn run_refine_text_llm(state: &AppState, prompt: String) -> Result { - let configured_llm_client = state.llm_client().ok_or_else(|| { + let configured_llm_client = state.vector_engine_llm_client().ok_or_else(|| { AppError::from_status(StatusCode::SERVICE_UNAVAILABLE).with_details(json!({ "provider": "editor-icon-spec-llm", - "message": "服务端尚未配置可用的 LLM API Key", + "message": "服务端尚未配置可用的 VectorEngine LLM API Key", })) })?; let retry_backoff_ms = configured_llm_client.config().retry_backoff_ms(); let llm_client = configured_llm_client.clone().with_max_retries(0); - let request = LlmRunRequest::new(vec![LlmMessage::user(prompt)]); + let request = LlmRunRequest::new(vec![LlmMessage::user(prompt)]) + .with_model(EDITOR_AGENT_GPT5_MODEL) + .with_openai_chat(); for attempt in 1..=ICON_SPEC_LLM_MAX_ATTEMPTS { match llm_client.run(request.clone()).await {