From 049795e26430bc27fc28e0bcbdb2295eed35ef83 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 1 Feb 2026 15:17:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=94=BB=E5=B8=83=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=99=BA=E8=83=BD=E8=87=AA=E5=8A=A8=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 添加「智能自动」模型选项(默认选中) 2. 使用 qwen3-vl 先对话理解需求、优化提示词 3. 然后自动调用最佳生图模型生成图片 4. 支持历史图片上下文自动关联 Co-authored-by: Cursor --- components/canvas/CanvasChatPanel.tsx | 56 +++++++++++++++++++++------ 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/components/canvas/CanvasChatPanel.tsx b/components/canvas/CanvasChatPanel.tsx index 5add067..ecb3d38 100644 --- a/components/canvas/CanvasChatPanel.tsx +++ b/components/canvas/CanvasChatPanel.tsx @@ -167,12 +167,24 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF // 过滤支持图片生成的模型 const imageModels = modelsData?.models?.filter(m => m.supportsImageGen) || []; - // 默认选择第一个图片模型 + // 智能自动模型选项 + const SMART_AUTO_MODEL = { + id: "auto", + modelId: "auto", + displayName: "智能自动", + providerType: "auto", + supportsImageGen: true, + }; + + // 所有可选模型(智能自动 + 生图模型) + const allModels = [SMART_AUTO_MODEL, ...imageModels]; + + // 默认选择智能自动模型 useEffect(() => { - if (imageModels.length > 0 && !selectedModelId) { - setSelectedModelId(imageModels[0].id); + if (!selectedModelId) { + setSelectedModelId("auto"); // 默认使用智能自动模式 } - }, [imageModels, selectedModelId]); + }, [selectedModelId]); const currentModelIdRef = useRef(selectedModelId); const imageParamsRef = useRef(imageParams); @@ -759,15 +771,37 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF - {/* Agent Selector (Model) */} + {/* Agent Selector (Model) - 包含智能自动选项 */}