From 9183244c2807d6bba258c5307e1bd538373e6998 Mon Sep 17 00:00:00 2001
From: Matt Rubens
Date: Thu, 9 Jan 2025 00:11:53 -0500
Subject: [PATCH] Warnings and error handling
---
src/shared/checkExistApiConfig.ts | 3 ++-
.../src/components/settings/ApiOptions.tsx | 16 +++++++++++++---
webview-ui/src/utils/validate.ts | 5 +++++
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/src/shared/checkExistApiConfig.ts b/src/shared/checkExistApiConfig.ts
index b347ccf..c876e81 100644
--- a/src/shared/checkExistApiConfig.ts
+++ b/src/shared/checkExistApiConfig.ts
@@ -13,7 +13,8 @@ export function checkExistKey(config: ApiConfiguration | undefined) {
config.lmStudioModelId,
config.geminiApiKey,
config.openAiNativeApiKey,
- config.deepSeekApiKey
+ config.deepSeekApiKey,
+ config.vsCodeLmModelSelector,
].some((key) => key !== undefined)
: false;
}
diff --git a/webview-ui/src/components/settings/ApiOptions.tsx b/webview-ui/src/components/settings/ApiOptions.tsx
index 6adac91..0374017 100644
--- a/webview-ui/src/components/settings/ApiOptions.tsx
+++ b/webview-ui/src/components/settings/ApiOptions.tsx
@@ -147,9 +147,9 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage }: ApiOptionsProps) =
GCP Vertex AI
AWS Bedrock
Glama
+ VS Code LM API
LM Studio
Ollama
- VS Code LM API
@@ -661,10 +661,20 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage }: ApiOptionsProps) =
marginTop: "5px",
color: "var(--vscode-descriptionForeground)",
}}>
- No language models available.
- You can use any VS Code extension that provides language model capabilities.
+ The VS Code Language Model API allows you to run models provided by other VS Code extensions (including but not limited to GitHub Copilot).
+ The easiest way to get started is to install the Copilot and Copilot Chat extensions from the VS Code Marketplace.
)}
+
+
+ Note: This is a very experimental integration and may not work as expected. Please report any issues to the Roo-Cline GitHub repository.
+
)}
diff --git a/webview-ui/src/utils/validate.ts b/webview-ui/src/utils/validate.ts
index 2ddc46d..ccb1551 100644
--- a/webview-ui/src/utils/validate.ts
+++ b/webview-ui/src/utils/validate.ts
@@ -57,6 +57,11 @@ export function validateApiConfiguration(apiConfiguration?: ApiConfiguration): s
return "You must provide a valid model ID."
}
break
+ case "vscode-lm":
+ if (!apiConfiguration.vsCodeLmModelSelector) {
+ return "You must provide a valid model selector."
+ }
+ break
}
}
return undefined