Browse Source

Fix the VSCode LM model picker

Matt Rubens 11 months ago
parent
commit
68cfdc985e
2 changed files with 23 additions and 14 deletions
  1. 5 0
      .changeset/eleven-birds-doubt.md
  2. 18 14
      webview-ui/src/components/settings/ApiOptions.tsx

+ 5 - 0
.changeset/eleven-birds-doubt.md

@@ -0,0 +1,5 @@
+---
+"roo-cline": patch
+---
+
+Fix VS Code LM API model picker

+ 18 - 14
webview-ui/src/components/settings/ApiOptions.tsx

@@ -1076,27 +1076,31 @@ const ApiOptions = ({
 							Language Model
 							Language Model
 						</label>
 						</label>
 						{vsCodeLmModels.length > 0 ? (
 						{vsCodeLmModels.length > 0 ? (
-							<Dropdown
-								id="vscode-lm-model"
+							<Select
 								value={
 								value={
 									apiConfiguration?.vsCodeLmModelSelector
 									apiConfiguration?.vsCodeLmModelSelector
 										? `${apiConfiguration.vsCodeLmModelSelector.vendor ?? ""}/${apiConfiguration.vsCodeLmModelSelector.family ?? ""}`
 										? `${apiConfiguration.vsCodeLmModelSelector.vendor ?? ""}/${apiConfiguration.vsCodeLmModelSelector.family ?? ""}`
 										: ""
 										: ""
 								}
 								}
-								onChange={handleInputChange("vsCodeLmModelSelector", (e) => {
-									const valueStr = (e as DropdownOption)?.value
+								onValueChange={handleInputChange("vsCodeLmModelSelector", (valueStr) => {
 									const [vendor, family] = valueStr.split("/")
 									const [vendor, family] = valueStr.split("/")
 									return { vendor, family }
 									return { vendor, family }
-								})}
-								options={[
-									{ value: "", label: "Select a model..." },
-									...vsCodeLmModels.map((model) => ({
-										value: `${model.vendor}/${model.family}`,
-										label: `${model.vendor} - ${model.family}`,
-									})),
-								]}
-								className="w-full"
-							/>
+								})}>
+								<SelectTrigger className="w-full">
+									<SelectValue placeholder="Select a model..." />
+								</SelectTrigger>
+								<SelectContent>
+									<SelectGroup>
+										{vsCodeLmModels.map((model) => (
+											<SelectItem
+												key={`${model.vendor}/${model.family}`}
+												value={`${model.vendor}/${model.family}`}>
+												{`${model.vendor} - ${model.family}`}
+											</SelectItem>
+										))}
+									</SelectGroup>
+								</SelectContent>
+							</Select>
 						) : (
 						) : (
 							<div className="text-sm text-vscode-descriptionForeground">
 							<div className="text-sm text-vscode-descriptionForeground">
 								The VS Code Language Model API allows you to run models provided by other VS Code
 								The VS Code Language Model API allows you to run models provided by other VS Code