diff --git a/src/components/providers/forms/OmoFormFields.tsx b/src/components/providers/forms/OmoFormFields.tsx index d0ffa02d2..52cced9cb 100644 --- a/src/components/providers/forms/OmoFormFields.tsx +++ b/src/components/providers/forms/OmoFormFields.tsx @@ -722,14 +722,23 @@ export function OmoFormFields({ return; } + let filledCount = 0; + let alreadySetCount = 0; + let unmatchedCount = 0; + const updatedAgents = { ...agents }; for (const agentDef of builtinAgentDefs) { const recommendedValue = resolveRecommendedModel(agentDef.recommended); - if (recommendedValue && !updatedAgents[agentDef.key]?.model) { + if (!recommendedValue) { + unmatchedCount++; + } else if (updatedAgents[agentDef.key]?.model) { + alreadySetCount++; + } else { updatedAgents[agentDef.key] = { ...updatedAgents[agentDef.key], model: recommendedValue, }; + filledCount++; } } onAgentsChange(updatedAgents); @@ -738,15 +747,50 @@ export function OmoFormFields({ const updatedCategories = { ...categories }; for (const catDef of OMO_BUILTIN_CATEGORIES) { const recommendedValue = resolveRecommendedModel(catDef.recommended); - if (recommendedValue && !updatedCategories[catDef.key]?.model) { + if (!recommendedValue) { + unmatchedCount++; + } else if (updatedCategories[catDef.key]?.model) { + alreadySetCount++; + } else { updatedCategories[catDef.key] = { ...updatedCategories[catDef.key], model: recommendedValue, }; + filledCount++; } } onCategoriesChange(updatedCategories); } + + if (filledCount > 0 && unmatchedCount === 0) { + toast.success( + t("omo.fillRecommendedSuccess", { + defaultValue: "Filled {{count}} recommended models", + count: filledCount, + }), + ); + } else if (filledCount > 0 && unmatchedCount > 0) { + toast.success( + t("omo.fillRecommendedPartial", { + defaultValue: + "Filled {{filled}} recommended models, {{unmatched}} unmatched", + filled: filledCount, + unmatched: unmatchedCount, + }), + ); + } else if (alreadySetCount > 0 && unmatchedCount === 0) { + toast.info( + t("omo.fillRecommendedAllSet", { + defaultValue: "All slots already have models configured", + }), + ); + } else { + toast.warning( + t("omo.fillRecommendedNoMatch", { + defaultValue: "Recommended models not found in configured providers", + }), + ); + } }; const configuredAgentCount = Object.keys(agents).length; diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 8ae71f854..fa5c497a2 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -1840,6 +1840,10 @@ "customCategories": "Custom Categories", "modelConfiguration": "Model Configuration", "fillRecommended": "Fill Recommended", + "fillRecommendedSuccess": "Filled {{count}} recommended models", + "fillRecommendedPartial": "Filled {{filled}} recommended models, {{unmatched}} unmatched", + "fillRecommendedAllSet": "All slots already have models configured", + "fillRecommendedNoMatch": "Recommended models not found in configured providers", "configSummary": "{{agents}} agents, {{categories}} categories configured · Click ⚙ for advanced params", "enabledModelsCount": "{{count}} configured models available", "source": "from:", diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json index c0b97460c..d0df8ba1e 100644 --- a/src/i18n/locales/ja.json +++ b/src/i18n/locales/ja.json @@ -1840,6 +1840,10 @@ "customCategories": "カスタムカテゴリ", "modelConfiguration": "モデル設定", "fillRecommended": "推奨を入力", + "fillRecommendedSuccess": "推奨モデル {{count}} 件を設定しました", + "fillRecommendedPartial": "推奨モデル {{filled}} 件を設定、{{unmatched}} 件は未一致", + "fillRecommendedAllSet": "すべてのスロットにモデルが設定済みです", + "fillRecommendedNoMatch": "推奨モデルが設定済みプロバイダーに見つかりませんでした", "configSummary": "{{agents}} 個の Agent、{{categories}} 個の Category を設定済み · ⚙ で詳細を展開", "enabledModelsCount": "設定済みモデル {{count}} 件", "source": "出典:", diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json index 2a2bfe007..8563c36fe 100644 --- a/src/i18n/locales/zh.json +++ b/src/i18n/locales/zh.json @@ -1840,6 +1840,10 @@ "customCategories": "自定义分类", "modelConfiguration": "模型配置", "fillRecommended": "填充推荐", + "fillRecommendedSuccess": "已填充 {{count}} 个推荐模型", + "fillRecommendedPartial": "已填充 {{filled}} 个推荐模型,{{unmatched}} 个未匹配", + "fillRecommendedAllSet": "所有槽位已有模型配置", + "fillRecommendedNoMatch": "推荐模型在已配置的供应商中未找到匹配", "configSummary": "已配置 {{agents}} 个 Agent,{{categories}} 个 Category · 点击 ⚙ 展开高级参数", "enabledModelsCount": "可选已配置模型 {{count}} 个", "source": "来源:",