Skip to content

Commit 9183244

Browse files
committed
Warnings and error handling
1 parent d1c39c1 commit 9183244

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

src/shared/checkExistApiConfig.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export function checkExistKey(config: ApiConfiguration | undefined) {
1313
config.lmStudioModelId,
1414
config.geminiApiKey,
1515
config.openAiNativeApiKey,
16-
config.deepSeekApiKey
16+
config.deepSeekApiKey,
17+
config.vsCodeLmModelSelector,
1718
].some((key) => key !== undefined)
1819
: false;
1920
}

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage }: ApiOptionsProps) =
147147
<VSCodeOption value="vertex">GCP Vertex AI</VSCodeOption>
148148
<VSCodeOption value="bedrock">AWS Bedrock</VSCodeOption>
149149
<VSCodeOption value="glama">Glama</VSCodeOption>
150+
<VSCodeOption value="vscode-lm">VS Code LM API</VSCodeOption>
150151
<VSCodeOption value="lmstudio">LM Studio</VSCodeOption>
151152
<VSCodeOption value="ollama">Ollama</VSCodeOption>
152-
<VSCodeOption value="vscode-lm">VS Code LM API</VSCodeOption>
153153
</VSCodeDropdown>
154154
</div>
155155

@@ -661,10 +661,20 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage }: ApiOptionsProps) =
661661
marginTop: "5px",
662662
color: "var(--vscode-descriptionForeground)",
663663
}}>
664-
No language models available.<br />
665-
You can use any VS Code extension that provides language model capabilities.
664+
The VS Code Language Model API allows you to run models provided by other VS Code extensions (including but not limited to GitHub Copilot).
665+
The easiest way to get started is to install the Copilot and Copilot Chat extensions from the VS Code Marketplace.
666666
</p>
667667
)}
668+
669+
<p
670+
style={{
671+
fontSize: "12px",
672+
marginTop: "5px",
673+
color: "var(--vscode-errorForeground)",
674+
fontWeight: 500,
675+
}}>
676+
Note: This is a very experimental integration and may not work as expected. Please report any issues to the Roo-Cline GitHub repository.
677+
</p>
668678
</div>
669679
</div>
670680
)}

webview-ui/src/utils/validate.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ export function validateApiConfiguration(apiConfiguration?: ApiConfiguration): s
5757
return "You must provide a valid model ID."
5858
}
5959
break
60+
case "vscode-lm":
61+
if (!apiConfiguration.vsCodeLmModelSelector) {
62+
return "You must provide a valid model selector."
63+
}
64+
break
6065
}
6166
}
6267
return undefined

0 commit comments

Comments
 (0)