Adds unbound provider to roo cline

This commit is contained in:
Pugazhendhi
2025-01-22 16:15:25 +05:30
committed by Vignesh Subbiah
parent db0ec64d1c
commit 62dcfbe549
5 changed files with 118 additions and 0 deletions

View File

@@ -26,6 +26,8 @@ import {
openRouterDefaultModelInfo,
vertexDefaultModelId,
vertexModels,
unboundDefaultModelId,
unboundModels,
} from "../../../../src/shared/api"
import { ExtensionMessage } from "../../../../src/shared/ExtensionMessage"
import { useExtensionState } from "../../context/ExtensionStateContext"
@@ -147,6 +149,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage }: ApiOptionsProps) =
{ value: "mistral", label: "Mistral" },
{ value: "lmstudio", label: "LM Studio" },
{ value: "ollama", label: "Ollama" },
{ value: "unbound", label: "Unbound" },
]}
/>
</div>
@@ -1283,6 +1286,27 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage }: ApiOptionsProps) =
</div>
)}
{selectedProvider === "unbound" && (
<div>
<VSCodeTextField
value={apiConfiguration?.unboundApiKey || ""}
style={{ width: "100%" }}
type="password"
onChange={handleInputChange("unboundApiKey")}
placeholder="Enter API Key...">
<span style={{ fontWeight: 500 }}>Unbound API Key</span>
</VSCodeTextField>
<p
style={{
fontSize: "12px",
marginTop: 3,
color: "var(--vscode-descriptionForeground)",
}}>
This key is stored locally and only used to make API requests from this extension.
</p>
</div>
)}
{apiErrorMessage && (
<p
style={{
@@ -1315,6 +1339,7 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage }: ApiOptionsProps) =
{selectedProvider === "openai-native" && createDropdown(openAiNativeModels)}
{selectedProvider === "deepseek" && createDropdown(deepSeekModels)}
{selectedProvider === "mistral" && createDropdown(mistralModels)}
{selectedProvider === "unbound" && createDropdown(unboundModels)}
</div>
<ModelInfoView
@@ -1552,6 +1577,13 @@ export function normalizeApiConfiguration(apiConfiguration?: ApiConfiguration) {
supportsImages: false, // VSCode LM API currently doesn't support images
},
}
case "unbound":
return getProviderData(unboundModels, unboundDefaultModelId)
// return {
// selectedProvider: provider,
// selectedModelId: apiConfiguration?.unboundModelId || unboundDefaultModelId,
// selectedModelInfo: openAiModelInfoSaneDefaults,
// }
default:
return getProviderData(anthropicModels, anthropicDefaultModelId)
}