From 84668e23070299a39b7eb7765206ef6f7eb17a07 Mon Sep 17 00:00:00 2001 From: liuxxxu <2429875446@qq.com> Date: Tue, 10 Mar 2026 16:53:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(openClaw=20form):=20add=20input=20type=20s?= =?UTF-8?q?election=20for=20models=20Advanced=20Options=20/=20=E4=B8=BA?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E9=AB=98=E7=BA=A7=E9=80=89=E9=A1=B9=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=BE=93=E5=85=A5=E7=B1=BB=E5=9E=8B=E9=80=89=E6=8B=A9?= =?UTF-8?q?=20(#1368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(openClaw form): add input type selection for models Advanced Options / 为模型高级选项添加输入类型选择 * fix(i18n): add missing openclaw.inputTypes key to all locales The new inputTypes field in OpenClawFormFields used defaultValue fallback, causing English and Japanese users to see Chinese text. --------- Co-authored-by: xu.liu2 Co-authored-by: Jason --- .../providers/forms/OpenClawFormFields.tsx | 88 +++++++++++++------ src/i18n/locales/en.json | 1 + src/i18n/locales/ja.json | 1 + src/i18n/locales/zh.json | 1 + 4 files changed, 66 insertions(+), 25 deletions(-) diff --git a/src/components/providers/forms/OpenClawFormFields.tsx b/src/components/providers/forms/OpenClawFormFields.tsx index 745682645..8c35e0df6 100644 --- a/src/components/providers/forms/OpenClawFormFields.tsx +++ b/src/components/providers/forms/OpenClawFormFields.tsx @@ -17,6 +17,7 @@ import { CollapsibleTrigger, } from "@/components/ui/collapsible"; import { Plus, Trash2, ChevronDown, ChevronRight } from "lucide-react"; +import { Checkbox } from "@/components/ui/checkbox"; import { ApiKeySection } from "./shared"; import { openclawApiProtocols } from "@/config/openclawProviderPresets"; import type { ProviderCategory, OpenClawModel } from "@/types"; @@ -101,6 +102,7 @@ export function OpenClawFormFields({ contextWindow: undefined, maxTokens: undefined, cost: undefined, + input: ["text"], }, ]); }; @@ -339,7 +341,66 @@ export function OpenClawFormFields({ - {/* Context Window, Max Tokens and Reasoning row */} + {/* Reasoning, Input Types row */} +
+
+ +
+ + handleModelChange(index, "reasoning", checked) + } + /> + + {model.reasoning + ? t("openclaw.reasoningOn", { + defaultValue: "启用", + }) + : t("openclaw.reasoningOff", { + defaultValue: "关闭", + })} + +
+
+
+ + {/* "text" is checked by default but can be unchecked — + some models genuinely don't support text input, and + OpenClaw works fine with an empty or image-only array. */} +
+ {(["text", "image"] as const).map((type) => ( + + ))} +
+
+
+
+ + {/* Context Window and Max Tokens row */}
-
- -
- - handleModelChange(index, "reasoning", checked) - } - /> - - {model.reasoning - ? t("openclaw.reasoningOn", { - defaultValue: "启用", - }) - : t("openclaw.reasoningOff", { - defaultValue: "关闭", - })} - -
-
+
{/* Cost row */} diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 8eadfd453..afad6ea35 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -1336,6 +1336,7 @@ "reasoning": "Reasoning Mode", "reasoningOn": "Enabled", "reasoningOff": "Disabled", + "inputTypes": "Input Types", "inputCost": "Input Cost ($/M tokens)", "outputCost": "Output Cost ($/M tokens)", "advancedOptions": "Advanced Options", diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json index 56c450795..915d4a705 100644 --- a/src/i18n/locales/ja.json +++ b/src/i18n/locales/ja.json @@ -1336,6 +1336,7 @@ "reasoning": "推論モード", "reasoningOn": "有効", "reasoningOff": "無効", + "inputTypes": "入力タイプ", "inputCost": "入力コスト ($/M トークン)", "outputCost": "出力コスト ($/M トークン)", "advancedOptions": "詳細オプション", diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json index a850fcd66..45bacbb1f 100644 --- a/src/i18n/locales/zh.json +++ b/src/i18n/locales/zh.json @@ -1336,6 +1336,7 @@ "reasoning": "推理模式", "reasoningOn": "启用", "reasoningOff": "关闭", + "inputTypes": "输入类型", "inputCost": "输入价格 ($/M tokens)", "outputCost": "输出价格 ($/M tokens)", "advancedOptions": "高级选项",