Fix the VSCode LM model picker

This commit is contained in:
Matt Rubens 2025-03-09 09:11:55 -04:00
parent d31b3b67e7
commit 68cfdc985e
2 changed files with 23 additions and 14 deletions

View file

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

View file

@ -1076,27 +1076,31 @@ const ApiOptions = ({
Language Model
</label>
{vsCodeLmModels.length > 0 ? (
<Dropdown
id="vscode-lm-model"
<Select
value={
apiConfiguration?.vsCodeLmModelSelector
? `${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("/")
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">
The VS Code Language Model API allows you to run models provided by other VS Code