fix: more changes from the feedback/review from daniel-lxs

This commit is contained in:
Ton Hoang Nguyen (Bill) 2025-07-09 22:30:36 +01:00
parent 0d72f08946
commit d18b143f41
19 changed files with 133 additions and 148 deletions

View file

@ -85,12 +85,9 @@ export const Gemini = ({ apiConfiguration, setApiConfigurationField, currentMode
className="w-full mt-1"
/>
)}
</div>
<div>
<h3 className="font-semibold text-base mb-4">{t("settings:providers.geminiSections.tools")}</h3>
<Checkbox
className="mt-6"
data-testid="checkbox-url-context"
checked={!!apiConfiguration.enableUrlContext}
onChange={(checked: boolean) => setApiConfigurationField("enableUrlContext", checked)}>
@ -109,104 +106,110 @@ export const Gemini = ({ apiConfiguration, setApiConfigurationField, currentMode
<div className="text-sm text-vscode-descriptionForeground mb-3">
{t("settings:providers.geminiParameters.groundingSearch.description")}
</div>
</div>
<div className="mb-2">
<Collapsible onOpenChange={setIsModelParametersOpen}>
<CollapsibleTrigger className="w-full text-left">
<div className="flex items-center justify-between">
<div className="flex flex-col">
<h3 className="font-semibold text-base">
{t("settings:providers.geminiSections.modelParameters.title")}
</h3>
<p className="text-sm text-vscode-descriptionForeground -mt-3">
{t("settings:providers.geminiSections.modelParameters.description")}
</p>
</div>
<ChevronRight
className={`transform transition-transform duration-200 mr-2 ${
isModelParametersOpen ? "rotate-90" : ""
}`}
size={20}
/>
</div>
</CollapsibleTrigger>
<CollapsibleContent>
<div className="mt-4">
<label className="block font-medium mb-1">
{t("settings:providers.geminiParameters.topP.title")}
</label>
<div className="flex items-center space-x-2">
<Slider
data-testid="slider-top-p"
min={0}
max={1}
step={0.01}
value={[apiConfiguration.topP ?? 0.95]}
onValueChange={(values: number[]) => setApiConfigurationField("topP", values[0])}
className="flex-grow"
<div className="mb-2">
<Collapsible onOpenChange={setIsModelParametersOpen}>
<CollapsibleTrigger className="w-full text-left">
<div className="flex items-center justify-between">
<div className="flex flex-col">
<h3 className="font-semibold text-base">
{t("settings:providers.geminiSections.modelParameters.title")}
</h3>
<p className="text-sm text-vscode-descriptionForeground -mt-3">
{t("settings:providers.geminiSections.modelParameters.description")}
</p>
</div>
<ChevronRight
className={`transform transition-transform duration-200 mr-2 ${
isModelParametersOpen ? "rotate-90" : ""
}`}
size={20}
/>
<span className="w-10 text-right">{(apiConfiguration.topP ?? 0.95).toFixed(2)}</span>
</div>
<div className="text-sm text-vscode-descriptionForeground">
{t("settings:providers.geminiParameters.topP.description")}
</CollapsibleTrigger>
<CollapsibleContent>
<div className="mt-4">
<label className="block font-medium mb-1">
{t("settings:providers.geminiParameters.topP.title")}
</label>
<div className="flex items-center space-x-2">
<Slider
data-testid="slider-top-p"
min={0}
max={1}
step={0.01}
value={[apiConfiguration.topP ?? 0.95]}
onValueChange={(values: number[]) =>
setApiConfigurationField("topP", values[0])
}
className="flex-grow"
/>
<span className="w-10 text-right">
{(apiConfiguration.topP ?? 0.95).toFixed(2)}
</span>
</div>
<div className="text-sm text-vscode-descriptionForeground">
{t("settings:providers.geminiParameters.topP.description")}
</div>
</div>
</div>
<div className="mt-4">
<label className="block font-medium mb-1">
{t("settings:providers.geminiParameters.topK.title")}
</label>
<div className="flex items-center space-x-2">
<Slider
data-testid="slider-top-k"
min={0}
max={100}
step={1}
value={[apiConfiguration.topK ?? 64]}
onValueChange={(values: number[]) => setApiConfigurationField("topK", values[0])}
className="flex-grow"
/>
<span className="w-10 text-right">{apiConfiguration.topK ?? 64}</span>
<div className="mt-4">
<label className="block font-medium mb-1">
{t("settings:providers.geminiParameters.topK.title")}
</label>
<div className="flex items-center space-x-2">
<Slider
data-testid="slider-top-k"
min={0}
max={100}
step={1}
value={[apiConfiguration.topK ?? 64]}
onValueChange={(values: number[]) =>
setApiConfigurationField("topK", values[0])
}
className="flex-grow"
/>
<span className="w-10 text-right">{apiConfiguration.topK ?? 64}</span>
</div>
<div className="text-sm text-vscode-descriptionForeground">
{t("settings:providers.geminiParameters.topK.description")}
</div>
</div>
<div className="text-sm text-vscode-descriptionForeground">
{t("settings:providers.geminiParameters.topK.description")}
</div>
</div>
<div className="mt-4">
<label className="block font-medium mb-1">
{t("settings:providers.geminiParameters.maxOutputTokens.title")}
</label>
<div className="flex items-center space-x-2">
<Slider
data-testid="slider-max-output-tokens"
min={3000}
max={modelInfo.maxTokens}
step={1}
value={[apiConfiguration.maxOutputTokens ?? modelInfo.maxTokens]}
onValueChange={(values: number[]) =>
setApiConfigurationField("maxOutputTokens", values[0])
}
className="flex-grow"
/>
<VSCodeTextField
value={(apiConfiguration.maxOutputTokens ?? modelInfo.maxTokens).toString()}
type="text"
inputMode="numeric"
onInput={handleInputChange("maxOutputTokens", (e) => {
const val = parseInt((e as any).target.value, 10)
return Number.isNaN(val) ? 0 : Math.min(val, modelInfo.maxTokens)
})}
className="w-16"
/>
<div className="mt-4">
<label className="block font-medium mb-1">
{t("settings:providers.geminiParameters.maxOutputTokens.title")}
</label>
<div className="flex items-center space-x-2">
<Slider
data-testid="slider-max-output-tokens"
min={3000}
max={modelInfo.maxTokens}
step={1}
value={[apiConfiguration.maxOutputTokens ?? modelInfo.maxTokens]}
onValueChange={(values: number[]) =>
setApiConfigurationField("maxOutputTokens", values[0])
}
className="flex-grow"
/>
<VSCodeTextField
value={(apiConfiguration.maxOutputTokens ?? modelInfo.maxTokens).toString()}
type="text"
inputMode="numeric"
onInput={handleInputChange("maxOutputTokens", (e) => {
const val = parseInt((e as any).target.value, 10)
return Number.isNaN(val) ? 0 : Math.min(val, modelInfo.maxTokens)
})}
className="w-16"
/>
</div>
<div className="text-sm text-vscode-descriptionForeground">
{t("settings:providers.geminiParameters.maxOutputTokens.description")}_{" "}
</div>
</div>
<div className="text-sm text-vscode-descriptionForeground">
{t("settings:providers.geminiParameters.maxOutputTokens.description")}_{" "}
</div>
</div>
</CollapsibleContent>
</Collapsible>
</CollapsibleContent>
</Collapsible>
</div>
</div>
</>
)

View file

@ -304,10 +304,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "Paràmetres del model",
"title": "Configuració avançada",
"description": "Ajusta la temperatura, top-p i altres paràmetres avançats."
},
"tools": "Eines"
}
},
"googleCloudSetup": {
"title": "Per utilitzar Google Cloud Vertex AI, necessiteu:",

View file

@ -300,10 +300,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "Modellparameter",
"title": "Erweiterte Einstellungen",
"description": "Feinabstimmung von Temperatur, Top-P und anderen erweiterten Einstellungen."
},
"tools": "Werkzeuge"
}
},
"googleCloudSetup": {
"title": "Um Google Cloud Vertex AI zu verwenden, müssen Sie:",

View file

@ -278,10 +278,9 @@
"vscodeLmWarning": "Note: This is a very experimental integration and provider support will vary. If you get an error about a model not being supported, that's an issue on the provider's end.",
"geminiSections": {
"modelParameters": {
"title": "Model Parameters",
"title": "Advanced Settings",
"description": "Fine-tune topP, topK and maxOutputTokens"
},
"tools": "Tools"
}
},
"geminiParameters": {
"topK": {

View file

@ -300,10 +300,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "Parámetros del modelo",
"title": "Configuración avanzada",
"description": "Ajusta la temperatura, top-p y otros parámetros avanzados."
},
"tools": "Herramientas"
}
},
"googleCloudSetup": {
"title": "Para usar Google Cloud Vertex AI, necesita:",

View file

@ -300,10 +300,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "Paramètres du modèle",
"title": "Paramètres avancés",
"description": "Ajustez la température, top-p et d'autres paramètres avancés."
},
"tools": "Outils"
}
},
"googleCloudSetup": {
"title": "Pour utiliser Google Cloud Vertex AI, vous devez :",

View file

@ -300,10 +300,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "मॉडल पैरामीटर",
"title": "उन्नत सेटिंग्स",
"description": "टेम्परेचर, टॉप-पी और अन्य उन्नत सेटिंग्स को फाइन-ट्यून करें।"
},
"tools": "उपकरण"
}
},
"googleCloudSetup": {
"title": "Google Cloud Vertex AI का उपयोग करने के लिए, आपको आवश्यकता है:",

View file

@ -304,10 +304,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "Parameter Model",
"title": "Pengaturan Lanjutan",
"description": "Menyesuaikan suhu, top-p, dan pengaturan lanjutan lainnya."
},
"tools": "Alat"
}
},
"googleCloudSetup": {
"title": "Untuk menggunakan Google Cloud Vertex AI, kamu perlu:",

View file

@ -300,10 +300,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "Parametri del modello",
"title": "Impostazioni avanzate",
"description": "Regola la temperatura, top-p e altre impostazioni avanzate."
},
"tools": "Strumenti"
}
},
"googleCloudSetup": {
"title": "Per utilizzare Google Cloud Vertex AI, è necessario:",

View file

@ -300,10 +300,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "モデルパラメータ",
"title": "詳細設定",
"description": "温度、top-p、およびその他の詳細設定を調整します。"
},
"tools": "ツール"
}
},
"googleCloudSetup": {
"title": "Google Cloud Vertex AIを使用するには",

View file

@ -300,10 +300,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "모델 매개변수",
"title": "고급 설정",
"description": "온도, top-p 및 기타 고급 설정을 조정합니다."
},
"tools": "도구"
}
},
"googleCloudSetup": {
"title": "Google Cloud Vertex AI를 사용하려면:",

View file

@ -300,10 +300,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "Modelparameters",
"title": "Geavanceerde instellingen",
"description": "Pas de temperatuur, top-p en andere geavanceerde instellingen aan."
},
"tools": "Gereedschap"
}
},
"googleCloudSetup": {
"title": "Om Google Cloud Vertex AI te gebruiken, moet je:",

View file

@ -300,10 +300,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "Parametry modelu",
"title": "Ustawienia zaawansowane",
"description": "Dostosuj temperaturę, top-p i inne zaawansowane ustawienia."
},
"tools": "Narzędzia"
}
},
"googleCloudSetup": {
"title": "Aby korzystać z Google Cloud Vertex AI, potrzebujesz:",

View file

@ -300,10 +300,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "Parâmetros do modelo",
"title": "Configurações Avançadas",
"description": "Ajuste a temperatura, top-p e outras configurações avançadas."
},
"tools": "Ferramentas"
}
},
"googleCloudSetup": {
"title": "Para usar o Google Cloud Vertex AI, você precisa:",

View file

@ -300,10 +300,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "Параметры модели",
"title": "Расширенные настройки",
"description": "Настройте температуру, top-p и другие расширенные параметры."
},
"tools": "Инструменты"
}
},
"googleCloudSetup": {
"title": "Для использования Google Cloud Vertex AI необходимо:",

View file

@ -300,10 +300,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "Model Parametreleri",
"title": "Gelişmiş Ayarlar",
"description": "Sıcaklık, top-p ve diğer gelişmiş ayarları yapın."
},
"tools": "Araçlar"
}
},
"googleCloudSetup": {
"title": "Google Cloud Vertex AI'yi kullanmak için şunları yapmanız gerekir:",

View file

@ -300,10 +300,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "Tham số mô hình",
"title": "Cài đặt nâng cao",
"description": "Điều chỉnh nhiệt độ, top-p và các cài đặt nâng cao khác."
},
"tools": "Công cụ"
}
},
"googleCloudSetup": {
"title": "Để sử dụng Google Cloud Vertex AI, bạn cần:",

View file

@ -300,10 +300,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "模型参数",
"title": "高级设置",
"description": "调整温度、top-p 和其他高级设置。"
},
"tools": "工具"
}
},
"googleCloudSetup": {
"title": "要使用 Google Cloud Vertex AI您需要",

View file

@ -300,10 +300,9 @@
},
"geminiSections": {
"modelParameters": {
"title": "模型參數",
"title": "進階設定",
"description": "調整溫度、top-p 和其他進階設定。"
},
"tools": "工具"
}
},
"googleCloudSetup": {
"title": "要使用 Google Cloud Vertex AI您需要",