From 828b3e1173f90c10dbd1018bf8a8d5db4f615142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sat, 5 Sep 2026 13:02:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E9=99=A4=E8=81=94=E5=90=88=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E5=88=9D=E5=A7=8B=E5=8C=96=E5=B4=A9=E6=BA=83=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 provider client 与配置 unwrap 改为显式错误 --- .../src/ui_editor/commands/recognition_and_binding.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition_and_binding.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition_and_binding.rs index 396107949..9a9c4ba79 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition_and_binding.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition_and_binding.rs @@ -713,7 +713,14 @@ pub(crate) async fn recognition_and_binding_impl_with_provider( .await .map_err(platform_llm::LlmError::InvalidRequest) } else { - request_ui_editor_llm(client.as_ref().unwrap(), llm.as_ref().unwrap(), request).await + request_ui_editor_llm( + client + .as_ref() + .ok_or_else(|| "LLM client 未初始化".to_string())?, + llm.as_ref().ok_or_else(|| "LLM 配置未初始化".to_string())?, + request, + ) + .await } .map_err(|error| format!("UI 编辑器单次计算失败:{error}"))?; let call = response