chore(ui): rename auto model to Agent模式
This commit is contained in:
parent
b30ebc58b9
commit
d5ad5faa5f
@ -2842,7 +2842,7 @@ export function AdminSettingsClient() {
|
|||||||
<div className="space-y-0.5">
|
<div className="space-y-0.5">
|
||||||
<Label htmlFor="showAutoModel">显示"自动"模型选项</Label>
|
<Label htmlFor="showAutoModel">显示"自动"模型选项</Label>
|
||||||
<div className="text-sm text-muted-foreground">
|
<div className="text-sm text-muted-foreground">
|
||||||
开启后,用户可以选择"智能自动"模型,系统将根据场景智能选择最佳模型
|
开启后,用户可以选择"Agent模式"模型,系统将根据场景智能选择最佳模型
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Switch
|
<Switch
|
||||||
@ -2998,7 +2998,7 @@ export function AdminSettingsClient() {
|
|||||||
<SelectValue placeholder="选择默认模型" />
|
<SelectValue placeholder="选择默认模型" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="auto">智能自动(推荐)</SelectItem>
|
<SelectItem value="auto">Agent模式(推荐)</SelectItem>
|
||||||
{modelsData?.models?.filter((m: any) => m.supportsImageGen).map((model: any) => (
|
{modelsData?.models?.filter((m: any) => m.supportsImageGen).map((model: any) => (
|
||||||
<SelectItem key={model.id} value={model.id}>
|
<SelectItem key={model.id} value={model.id}>
|
||||||
{model.displayName}
|
{model.displayName}
|
||||||
@ -3007,13 +3007,13 @@ export function AdminSettingsClient() {
|
|||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
<div className="text-xs text-muted-foreground">
|
<div className="text-xs text-muted-foreground">
|
||||||
设置无限画布中用户的默认生图模型。"智能自动"会根据用户需求自动选择最佳模型。
|
设置无限画布中用户的默认生图模型。"Agent模式"会根据用户需求自动选择最佳模型。
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 智能自动模式下的默认生图模型 */}
|
{/* Agent模式下的默认生图模型 */}
|
||||||
<div className="space-y-2 mt-4 pt-4 border-t">
|
<div className="space-y-2 mt-4 pt-4 border-t">
|
||||||
<Label htmlFor="canvasAutoModeDefaultModelId">智能自动模式 - 默认生图模型</Label>
|
<Label htmlFor="canvasAutoModeDefaultModelId">Agent模式 - 默认生图模型</Label>
|
||||||
<Select
|
<Select
|
||||||
value={siteSettings.canvasAutoModeDefaultModelId || "system"}
|
value={siteSettings.canvasAutoModeDefaultModelId || "system"}
|
||||||
onValueChange={(value) => setSiteSettings({
|
onValueChange={(value) => setSiteSettings({
|
||||||
@ -3034,7 +3034,7 @@ export function AdminSettingsClient() {
|
|||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
<div className="text-xs text-muted-foreground">
|
<div className="text-xs text-muted-foreground">
|
||||||
当用户选择"智能自动"模式时,系统实际使用的生图模型。"系统智能选择"会根据用户意图(如抠图、换背景等)自动路由到最佳模型。
|
当用户选择"Agent模式"时,系统实际使用的生图模型。"系统智能选择"会根据用户意图(如抠图、换背景等)自动路由到最佳模型。
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -726,22 +726,22 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF
|
|||||||
// 过滤支持图片生成的模型
|
// 过滤支持图片生成的模型
|
||||||
const imageModels = modelsData?.models?.filter(m => m.supportsImageGen) || [];
|
const imageModels = modelsData?.models?.filter(m => m.supportsImageGen) || [];
|
||||||
|
|
||||||
// 智能自动模型选项
|
// Agent模式(自动路由)模型选项
|
||||||
const SMART_AUTO_MODEL = {
|
const SMART_AUTO_MODEL = {
|
||||||
id: "auto",
|
id: "auto",
|
||||||
modelId: "auto",
|
modelId: "auto",
|
||||||
displayName: "智能自动",
|
displayName: "Agent模式",
|
||||||
providerType: "auto",
|
providerType: "auto",
|
||||||
supportsImageGen: true,
|
supportsImageGen: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
// 所有可选模型(智能自动 + 生图模型)
|
// 所有可选模型(Agent模式 + 生图模型)
|
||||||
const allModels = [SMART_AUTO_MODEL, ...imageModels];
|
const allModels = [SMART_AUTO_MODEL, ...imageModels];
|
||||||
|
|
||||||
// 默认选择模型(根据系统设置)
|
// 默认选择模型(根据系统设置)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!selectedModelId && siteSettings) {
|
if (!selectedModelId && siteSettings) {
|
||||||
// 使用系统设置的默认模型,如果没有设置则使用智能自动
|
// 使用系统设置的默认模型,如果没有设置则使用Agent模式
|
||||||
const defaultModel = siteSettings.canvasDefaultModelId || "auto";
|
const defaultModel = siteSettings.canvasDefaultModelId || "auto";
|
||||||
setSelectedModelId(defaultModel);
|
setSelectedModelId(defaultModel);
|
||||||
}
|
}
|
||||||
@ -1153,7 +1153,7 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF
|
|||||||
return result;
|
return result;
|
||||||
}, [messages, nodes, selectedImageNodes]);
|
}, [messages, nodes, selectedImageNodes]);
|
||||||
|
|
||||||
// 🆕 智能自动模式上下文(画布图片布局)
|
// 🆕 Agent模式上下文(画布图片布局)
|
||||||
const buildAutoContext = useCallback(() => {
|
const buildAutoContext = useCallback(() => {
|
||||||
const imageNodes = nodes.filter(n => n.type === 'image' && (n.data as any)?.src);
|
const imageNodes = nodes.filter(n => n.type === 'image' && (n.data as any)?.src);
|
||||||
if (imageNodes.length === 0) return "";
|
if (imageNodes.length === 0) return "";
|
||||||
@ -2036,7 +2036,7 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF
|
|||||||
<Paperclip className="h-4 w-4" />
|
<Paperclip className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{/* Agent Selector (Model) - 包含智能自动选项 */}
|
{/* Agent Selector (Model) - 包含Agent模式选项 */}
|
||||||
<Select value={selectedModelId} onValueChange={setSelectedModelId}>
|
<Select value={selectedModelId} onValueChange={setSelectedModelId}>
|
||||||
<SelectTrigger className={cn(
|
<SelectTrigger className={cn(
|
||||||
"h-8 text-xs transition-colors rounded-full px-3 gap-1 w-auto flex-shrink-0",
|
"h-8 text-xs transition-colors rounded-full px-3 gap-1 w-auto flex-shrink-0",
|
||||||
@ -2050,15 +2050,15 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF
|
|||||||
<Sparkles className="h-3 w-3" />
|
<Sparkles className="h-3 w-3" />
|
||||||
)}
|
)}
|
||||||
<span className="truncate max-w-[60px]">
|
<span className="truncate max-w-[60px]">
|
||||||
{allModels.find(m => m.id === selectedModelId)?.displayName || "智能自动"}
|
{allModels.find(m => m.id === selectedModelId)?.displayName || "Agent模式"}
|
||||||
</span>
|
</span>
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
{/* 智能自动选项 */}
|
{/* Agent模式选项 */}
|
||||||
<SelectItem value="auto" className="text-xs">
|
<SelectItem value="auto" className="text-xs">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Zap className="h-3 w-3 text-purple-500" />
|
<Zap className="h-3 w-3 text-purple-500" />
|
||||||
<span>智能自动</span>
|
<span>Agent模式</span>
|
||||||
<span className="text-[10px] text-muted-foreground">先对话再生图</span>
|
<span className="text-[10px] text-muted-foreground">先对话再生图</span>
|
||||||
</div>
|
</div>
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
|
|||||||
@ -313,7 +313,7 @@ export function LovartHome({
|
|||||||
{
|
{
|
||||||
id: "auto",
|
id: "auto",
|
||||||
modelId: "auto",
|
modelId: "auto",
|
||||||
displayName: "智能自动",
|
displayName: "Agent模式",
|
||||||
providerType: "auto",
|
providerType: "auto",
|
||||||
supportsImageGen: true,
|
supportsImageGen: true,
|
||||||
},
|
},
|
||||||
@ -1016,12 +1016,12 @@ export function LovartHome({
|
|||||||
<Select value={selectedModelId || "auto"} onValueChange={setSelectedModelId}>
|
<Select value={selectedModelId || "auto"} onValueChange={setSelectedModelId}>
|
||||||
<SelectTrigger className="h-8 w-auto min-w-[110px] rounded-full border border-blue-100 bg-blue-50 px-3 text-xs text-blue-600">
|
<SelectTrigger className="h-8 w-auto min-w-[110px] rounded-full border border-blue-100 bg-blue-50 px-3 text-xs text-blue-600">
|
||||||
<span className="truncate max-w-[100px]">
|
<span className="truncate max-w-[100px]">
|
||||||
{currentComposerModel?.displayName || "智能自动"}
|
{currentComposerModel?.displayName || "Agent模式"}
|
||||||
</span>
|
</span>
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="auto" className="text-xs">
|
<SelectItem value="auto" className="text-xs">
|
||||||
智能自动
|
Agent模式
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
{imageModels.map((model) => (
|
{imageModels.map((model) => (
|
||||||
<SelectItem key={model.id} value={model.id} className="text-xs">
|
<SelectItem key={model.id} value={model.id} className="text-xs">
|
||||||
|
|||||||
@ -61,7 +61,7 @@ export function ModelSelector({
|
|||||||
const autoModel: DynamicModel = {
|
const autoModel: DynamicModel = {
|
||||||
id: "auto",
|
id: "auto",
|
||||||
modelId: "auto",
|
modelId: "auto",
|
||||||
displayName: "✨ 智能自动 (Auto)",
|
displayName: "Agent模式",
|
||||||
description: "AI 自动识别意图,为您选择最佳模型",
|
description: "AI 自动识别意图,为您选择最佳模型",
|
||||||
supportsVision: true,
|
supportsVision: true,
|
||||||
supportsImageGen: true,
|
supportsImageGen: true,
|
||||||
|
|||||||
@ -1043,7 +1043,7 @@ function PureModelSelectorCompact({
|
|||||||
// 定义自动模式
|
// 定义自动模式
|
||||||
const autoModel: DynamicModel = {
|
const autoModel: DynamicModel = {
|
||||||
id: "auto",
|
id: "auto",
|
||||||
displayName: "✨ 智能自动 (Auto)",
|
displayName: "Agent模式",
|
||||||
description: "根据您的意图自动选择最合适的模型",
|
description: "根据您的意图自动选择最合适的模型",
|
||||||
supportsVision: true,
|
supportsVision: true,
|
||||||
isDefault: false,
|
isDefault: false,
|
||||||
@ -1134,7 +1134,7 @@ function PureModelSelectorCompact({
|
|||||||
// 🆕 如果选择的是"自动"模式,直接传递 "auto" 给后端
|
// 🆕 如果选择的是"自动"模式,直接传递 "auto" 给后端
|
||||||
// 后端会使用智能分析器进行意图识别和模型选择
|
// 后端会使用智能分析器进行意图识别和模型选择
|
||||||
if (model.id === "auto") {
|
if (model.id === "auto") {
|
||||||
console.log("[自动模式] 选择智能自动模式,后端将进行意图分析和模型路由");
|
console.log("[自动模式] 选择Agent模式,后端将进行意图分析和模型路由");
|
||||||
setOptimisticModelId("auto");
|
setOptimisticModelId("auto");
|
||||||
onModelChange?.("auto");
|
onModelChange?.("auto");
|
||||||
startTransition(() => {
|
startTransition(() => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user