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) - 包含智能自动选项 */}