Skip to content

Commit 68cfdc9

Browse files
committed
Fix the VSCode LM model picker
1 parent d31b3b6 commit 68cfdc9

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

.changeset/eleven-birds-doubt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Fix VS Code LM API model picker

webview-ui/src/components/settings/ApiOptions.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,27 +1076,31 @@ const ApiOptions = ({
10761076
Language Model
10771077
</label>
10781078
{vsCodeLmModels.length > 0 ? (
1079-
<Dropdown
1080-
id="vscode-lm-model"
1079+
<Select
10811080
value={
10821081
apiConfiguration?.vsCodeLmModelSelector
10831082
? `${apiConfiguration.vsCodeLmModelSelector.vendor ?? ""}/${apiConfiguration.vsCodeLmModelSelector.family ?? ""}`
10841083
: ""
10851084
}
1086-
onChange={handleInputChange("vsCodeLmModelSelector", (e) => {
1087-
const valueStr = (e as DropdownOption)?.value
1085+
onValueChange={handleInputChange("vsCodeLmModelSelector", (valueStr) => {
10881086
const [vendor, family] = valueStr.split("/")
10891087
return { vendor, family }
1090-
})}
1091-
options={[
1092-
{ value: "", label: "Select a model..." },
1093-
...vsCodeLmModels.map((model) => ({
1094-
value: `${model.vendor}/${model.family}`,
1095-
label: `${model.vendor} - ${model.family}`,
1096-
})),
1097-
]}
1098-
className="w-full"
1099-
/>
1088+
})}>
1089+
<SelectTrigger className="w-full">
1090+
<SelectValue placeholder="Select a model..." />
1091+
</SelectTrigger>
1092+
<SelectContent>
1093+
<SelectGroup>
1094+
{vsCodeLmModels.map((model) => (
1095+
<SelectItem
1096+
key={`${model.vendor}/${model.family}`}
1097+
value={`${model.vendor}/${model.family}`}>
1098+
{`${model.vendor} - ${model.family}`}
1099+
</SelectItem>
1100+
))}
1101+
</SelectGroup>
1102+
</SelectContent>
1103+
</Select>
11001104
) : (
11011105
<div className="text-sm text-vscode-descriptionForeground">
11021106
The VS Code Language Model API allows you to run models provided by other VS Code

0 commit comments

Comments
 (0)