Skip to content

Commit d18b143

Browse files
committed
fix: more changes from the feedback/review from daniel-lxs
1 parent 0d72f08 commit d18b143

File tree

19 files changed

+133
-148
lines changed

19 files changed

+133
-148
lines changed

webview-ui/src/components/settings/providers/Gemini.tsx

Lines changed: 97 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,9 @@ export const Gemini = ({ apiConfiguration, setApiConfigurationField, currentMode
8585
className="w-full mt-1"
8686
/>
8787
)}
88-
</div>
89-
90-
<div>
91-
<h3 className="font-semibold text-base mb-4">{t("settings:providers.geminiSections.tools")}</h3>
9288

9389
<Checkbox
90+
className="mt-6"
9491
data-testid="checkbox-url-context"
9592
checked={!!apiConfiguration.enableUrlContext}
9693
onChange={(checked: boolean) => setApiConfigurationField("enableUrlContext", checked)}>
@@ -109,104 +106,110 @@ export const Gemini = ({ apiConfiguration, setApiConfigurationField, currentMode
109106
<div className="text-sm text-vscode-descriptionForeground mb-3">
110107
{t("settings:providers.geminiParameters.groundingSearch.description")}
111108
</div>
112-
</div>
113109

114-
<div className="mb-2">
115-
<Collapsible onOpenChange={setIsModelParametersOpen}>
116-
<CollapsibleTrigger className="w-full text-left">
117-
<div className="flex items-center justify-between">
118-
<div className="flex flex-col">
119-
<h3 className="font-semibold text-base">
120-
{t("settings:providers.geminiSections.modelParameters.title")}
121-
</h3>
122-
<p className="text-sm text-vscode-descriptionForeground -mt-3">
123-
{t("settings:providers.geminiSections.modelParameters.description")}
124-
</p>
125-
</div>
126-
<ChevronRight
127-
className={`transform transition-transform duration-200 mr-2 ${
128-
isModelParametersOpen ? "rotate-90" : ""
129-
}`}
130-
size={20}
131-
/>
132-
</div>
133-
</CollapsibleTrigger>
134-
<CollapsibleContent>
135-
<div className="mt-4">
136-
<label className="block font-medium mb-1">
137-
{t("settings:providers.geminiParameters.topP.title")}
138-
</label>
139-
<div className="flex items-center space-x-2">
140-
<Slider
141-
data-testid="slider-top-p"
142-
min={0}
143-
max={1}
144-
step={0.01}
145-
value={[apiConfiguration.topP ?? 0.95]}
146-
onValueChange={(values: number[]) => setApiConfigurationField("topP", values[0])}
147-
className="flex-grow"
110+
<div className="mb-2">
111+
<Collapsible onOpenChange={setIsModelParametersOpen}>
112+
<CollapsibleTrigger className="w-full text-left">
113+
<div className="flex items-center justify-between">
114+
<div className="flex flex-col">
115+
<h3 className="font-semibold text-base">
116+
{t("settings:providers.geminiSections.modelParameters.title")}
117+
</h3>
118+
<p className="text-sm text-vscode-descriptionForeground -mt-3">
119+
{t("settings:providers.geminiSections.modelParameters.description")}
120+
</p>
121+
</div>
122+
<ChevronRight
123+
className={`transform transition-transform duration-200 mr-2 ${
124+
isModelParametersOpen ? "rotate-90" : ""
125+
}`}
126+
size={20}
148127
/>
149-
<span className="w-10 text-right">{(apiConfiguration.topP ?? 0.95).toFixed(2)}</span>
150128
</div>
151-
<div className="text-sm text-vscode-descriptionForeground">
152-
{t("settings:providers.geminiParameters.topP.description")}
129+
</CollapsibleTrigger>
130+
<CollapsibleContent>
131+
<div className="mt-4">
132+
<label className="block font-medium mb-1">
133+
{t("settings:providers.geminiParameters.topP.title")}
134+
</label>
135+
<div className="flex items-center space-x-2">
136+
<Slider
137+
data-testid="slider-top-p"
138+
min={0}
139+
max={1}
140+
step={0.01}
141+
value={[apiConfiguration.topP ?? 0.95]}
142+
onValueChange={(values: number[]) =>
143+
setApiConfigurationField("topP", values[0])
144+
}
145+
className="flex-grow"
146+
/>
147+
<span className="w-10 text-right">
148+
{(apiConfiguration.topP ?? 0.95).toFixed(2)}
149+
</span>
150+
</div>
151+
<div className="text-sm text-vscode-descriptionForeground">
152+
{t("settings:providers.geminiParameters.topP.description")}
153+
</div>
153154
</div>
154-
</div>
155155

156-
<div className="mt-4">
157-
<label className="block font-medium mb-1">
158-
{t("settings:providers.geminiParameters.topK.title")}
159-
</label>
160-
<div className="flex items-center space-x-2">
161-
<Slider
162-
data-testid="slider-top-k"
163-
min={0}
164-
max={100}
165-
step={1}
166-
value={[apiConfiguration.topK ?? 64]}
167-
onValueChange={(values: number[]) => setApiConfigurationField("topK", values[0])}
168-
className="flex-grow"
169-
/>
170-
<span className="w-10 text-right">{apiConfiguration.topK ?? 64}</span>
156+
<div className="mt-4">
157+
<label className="block font-medium mb-1">
158+
{t("settings:providers.geminiParameters.topK.title")}
159+
</label>
160+
<div className="flex items-center space-x-2">
161+
<Slider
162+
data-testid="slider-top-k"
163+
min={0}
164+
max={100}
165+
step={1}
166+
value={[apiConfiguration.topK ?? 64]}
167+
onValueChange={(values: number[]) =>
168+
setApiConfigurationField("topK", values[0])
169+
}
170+
className="flex-grow"
171+
/>
172+
<span className="w-10 text-right">{apiConfiguration.topK ?? 64}</span>
173+
</div>
174+
<div className="text-sm text-vscode-descriptionForeground">
175+
{t("settings:providers.geminiParameters.topK.description")}
176+
</div>
171177
</div>
172-
<div className="text-sm text-vscode-descriptionForeground">
173-
{t("settings:providers.geminiParameters.topK.description")}
174-
</div>
175-
</div>
176178

177-
<div className="mt-4">
178-
<label className="block font-medium mb-1">
179-
{t("settings:providers.geminiParameters.maxOutputTokens.title")}
180-
</label>
181-
<div className="flex items-center space-x-2">
182-
<Slider
183-
data-testid="slider-max-output-tokens"
184-
min={3000}
185-
max={modelInfo.maxTokens}
186-
step={1}
187-
value={[apiConfiguration.maxOutputTokens ?? modelInfo.maxTokens]}
188-
onValueChange={(values: number[]) =>
189-
setApiConfigurationField("maxOutputTokens", values[0])
190-
}
191-
className="flex-grow"
192-
/>
193-
<VSCodeTextField
194-
value={(apiConfiguration.maxOutputTokens ?? modelInfo.maxTokens).toString()}
195-
type="text"
196-
inputMode="numeric"
197-
onInput={handleInputChange("maxOutputTokens", (e) => {
198-
const val = parseInt((e as any).target.value, 10)
199-
return Number.isNaN(val) ? 0 : Math.min(val, modelInfo.maxTokens)
200-
})}
201-
className="w-16"
202-
/>
179+
<div className="mt-4">
180+
<label className="block font-medium mb-1">
181+
{t("settings:providers.geminiParameters.maxOutputTokens.title")}
182+
</label>
183+
<div className="flex items-center space-x-2">
184+
<Slider
185+
data-testid="slider-max-output-tokens"
186+
min={3000}
187+
max={modelInfo.maxTokens}
188+
step={1}
189+
value={[apiConfiguration.maxOutputTokens ?? modelInfo.maxTokens]}
190+
onValueChange={(values: number[]) =>
191+
setApiConfigurationField("maxOutputTokens", values[0])
192+
}
193+
className="flex-grow"
194+
/>
195+
<VSCodeTextField
196+
value={(apiConfiguration.maxOutputTokens ?? modelInfo.maxTokens).toString()}
197+
type="text"
198+
inputMode="numeric"
199+
onInput={handleInputChange("maxOutputTokens", (e) => {
200+
const val = parseInt((e as any).target.value, 10)
201+
return Number.isNaN(val) ? 0 : Math.min(val, modelInfo.maxTokens)
202+
})}
203+
className="w-16"
204+
/>
205+
</div>
206+
<div className="text-sm text-vscode-descriptionForeground">
207+
{t("settings:providers.geminiParameters.maxOutputTokens.description")}_{" "}
208+
</div>
203209
</div>
204-
<div className="text-sm text-vscode-descriptionForeground">
205-
{t("settings:providers.geminiParameters.maxOutputTokens.description")}_{" "}
206-
</div>
207-
</div>
208-
</CollapsibleContent>
209-
</Collapsible>
210+
</CollapsibleContent>
211+
</Collapsible>
212+
</div>
210213
</div>
211214
</>
212215
)

webview-ui/src/i18n/locales/ca/settings.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,9 @@
304304
},
305305
"geminiSections": {
306306
"modelParameters": {
307-
"title": "Paràmetres del model",
307+
"title": "Configuració avançada",
308308
"description": "Ajusta la temperatura, top-p i altres paràmetres avançats."
309-
},
310-
"tools": "Eines"
309+
}
311310
},
312311
"googleCloudSetup": {
313312
"title": "Per utilitzar Google Cloud Vertex AI, necessiteu:",

webview-ui/src/i18n/locales/de/settings.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,9 @@
300300
},
301301
"geminiSections": {
302302
"modelParameters": {
303-
"title": "Modellparameter",
303+
"title": "Erweiterte Einstellungen",
304304
"description": "Feinabstimmung von Temperatur, Top-P und anderen erweiterten Einstellungen."
305-
},
306-
"tools": "Werkzeuge"
305+
}
307306
},
308307
"googleCloudSetup": {
309308
"title": "Um Google Cloud Vertex AI zu verwenden, müssen Sie:",

webview-ui/src/i18n/locales/en/settings.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,9 @@
278278
"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.",
279279
"geminiSections": {
280280
"modelParameters": {
281-
"title": "Model Parameters",
281+
"title": "Advanced Settings",
282282
"description": "Fine-tune topP, topK and maxOutputTokens"
283-
},
284-
"tools": "Tools"
283+
}
285284
},
286285
"geminiParameters": {
287286
"topK": {

webview-ui/src/i18n/locales/es/settings.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,9 @@
300300
},
301301
"geminiSections": {
302302
"modelParameters": {
303-
"title": "Parámetros del modelo",
303+
"title": "Configuración avanzada",
304304
"description": "Ajusta la temperatura, top-p y otros parámetros avanzados."
305-
},
306-
"tools": "Herramientas"
305+
}
307306
},
308307
"googleCloudSetup": {
309308
"title": "Para usar Google Cloud Vertex AI, necesita:",

webview-ui/src/i18n/locales/fr/settings.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,9 @@
300300
},
301301
"geminiSections": {
302302
"modelParameters": {
303-
"title": "Paramètres du modèle",
303+
"title": "Paramètres avancés",
304304
"description": "Ajustez la température, top-p et d'autres paramètres avancés."
305-
},
306-
"tools": "Outils"
305+
}
307306
},
308307
"googleCloudSetup": {
309308
"title": "Pour utiliser Google Cloud Vertex AI, vous devez :",

webview-ui/src/i18n/locales/hi/settings.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,9 @@
300300
},
301301
"geminiSections": {
302302
"modelParameters": {
303-
"title": "मॉडल पैरामीटर",
303+
"title": "उन्नत सेटिंग्स",
304304
"description": "टेम्परेचर, टॉप-पी और अन्य उन्नत सेटिंग्स को फाइन-ट्यून करें।"
305-
},
306-
"tools": "उपकरण"
305+
}
307306
},
308307
"googleCloudSetup": {
309308
"title": "Google Cloud Vertex AI का उपयोग करने के लिए, आपको आवश्यकता है:",

webview-ui/src/i18n/locales/id/settings.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,9 @@
304304
},
305305
"geminiSections": {
306306
"modelParameters": {
307-
"title": "Parameter Model",
307+
"title": "Pengaturan Lanjutan",
308308
"description": "Menyesuaikan suhu, top-p, dan pengaturan lanjutan lainnya."
309-
},
310-
"tools": "Alat"
309+
}
311310
},
312311
"googleCloudSetup": {
313312
"title": "Untuk menggunakan Google Cloud Vertex AI, kamu perlu:",

webview-ui/src/i18n/locales/it/settings.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,9 @@
300300
},
301301
"geminiSections": {
302302
"modelParameters": {
303-
"title": "Parametri del modello",
303+
"title": "Impostazioni avanzate",
304304
"description": "Regola la temperatura, top-p e altre impostazioni avanzate."
305-
},
306-
"tools": "Strumenti"
305+
}
307306
},
308307
"googleCloudSetup": {
309308
"title": "Per utilizzare Google Cloud Vertex AI, è necessario:",

webview-ui/src/i18n/locales/ja/settings.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,9 @@
300300
},
301301
"geminiSections": {
302302
"modelParameters": {
303-
"title": "モデルパラメータ",
303+
"title": "詳細設定",
304304
"description": "温度、top-p、およびその他の詳細設定を調整します。"
305-
},
306-
"tools": "ツール"
305+
}
307306
},
308307
"googleCloudSetup": {
309308
"title": "Google Cloud Vertex AIを使用するには:",

0 commit comments

Comments
 (0)