|
|
@@ -7,24 +7,20 @@ import { ExternalLinkIcon } from "@radix-ui/react-icons"
|
|
|
import {
|
|
|
type ProviderName,
|
|
|
type ProviderSettings,
|
|
|
+ isRetiredProvider,
|
|
|
DEFAULT_CONSECUTIVE_MISTAKE_LIMIT,
|
|
|
openRouterDefaultModelId,
|
|
|
requestyDefaultModelId,
|
|
|
- unboundDefaultModelId,
|
|
|
litellmDefaultModelId,
|
|
|
openAiNativeDefaultModelId,
|
|
|
openAiCodexDefaultModelId,
|
|
|
anthropicDefaultModelId,
|
|
|
- doubaoDefaultModelId,
|
|
|
qwenCodeDefaultModelId,
|
|
|
geminiDefaultModelId,
|
|
|
deepSeekDefaultModelId,
|
|
|
moonshotDefaultModelId,
|
|
|
mistralDefaultModelId,
|
|
|
xaiDefaultModelId,
|
|
|
- groqDefaultModelId,
|
|
|
- cerebrasDefaultModelId,
|
|
|
- chutesDefaultModelId,
|
|
|
basetenDefaultModelId,
|
|
|
bedrockDefaultModelId,
|
|
|
vertexDefaultModelId,
|
|
|
@@ -32,11 +28,8 @@ import {
|
|
|
internationalZAiDefaultModelId,
|
|
|
mainlandZAiDefaultModelId,
|
|
|
fireworksDefaultModelId,
|
|
|
- featherlessDefaultModelId,
|
|
|
- ioIntelligenceDefaultModelId,
|
|
|
rooDefaultModelId,
|
|
|
vercelAiGatewayDefaultModelId,
|
|
|
- deepInfraDefaultModelId,
|
|
|
minimaxDefaultModelId,
|
|
|
} from "@roo-code/types"
|
|
|
|
|
|
@@ -75,14 +68,8 @@ import {
|
|
|
Anthropic,
|
|
|
Baseten,
|
|
|
Bedrock,
|
|
|
- Cerebras,
|
|
|
- Chutes,
|
|
|
DeepSeek,
|
|
|
- Doubao,
|
|
|
Gemini,
|
|
|
- Groq,
|
|
|
- HuggingFace,
|
|
|
- IOIntelligence,
|
|
|
LMStudio,
|
|
|
LiteLLM,
|
|
|
Mistral,
|
|
|
@@ -96,15 +83,12 @@ import {
|
|
|
Requesty,
|
|
|
Roo,
|
|
|
SambaNova,
|
|
|
- Unbound,
|
|
|
Vertex,
|
|
|
VSCodeLM,
|
|
|
XAI,
|
|
|
ZAi,
|
|
|
Fireworks,
|
|
|
- Featherless,
|
|
|
VercelAiGateway,
|
|
|
- DeepInfra,
|
|
|
MiniMax,
|
|
|
} from "./providers"
|
|
|
|
|
|
@@ -196,6 +180,11 @@ const ApiOptions = ({
|
|
|
id: selectedModelId,
|
|
|
info: selectedModelInfo,
|
|
|
} = useSelectedModel(apiConfiguration)
|
|
|
+ const activeSelectedProvider: ProviderName | undefined = isRetiredProvider(selectedProvider)
|
|
|
+ ? undefined
|
|
|
+ : selectedProvider
|
|
|
+ const isRetiredSelectedProvider =
|
|
|
+ typeof apiConfiguration.apiProvider === "string" && isRetiredProvider(apiConfiguration.apiProvider)
|
|
|
|
|
|
const { data: routerModels, refetch: refetchRouterModels } = useRouterModels()
|
|
|
|
|
|
@@ -213,12 +202,16 @@ const ApiOptions = ({
|
|
|
|
|
|
// Update `apiModelId` whenever `selectedModelId` changes.
|
|
|
useEffect(() => {
|
|
|
+ if (isRetiredSelectedProvider) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
if (selectedModelId && apiConfiguration.apiModelId !== selectedModelId) {
|
|
|
// Pass false as third parameter to indicate this is not a user action
|
|
|
// This is an internal sync, not a user-initiated change
|
|
|
setApiConfigurationField("apiModelId", selectedModelId, false)
|
|
|
}
|
|
|
- }, [selectedModelId, setApiConfigurationField, apiConfiguration.apiModelId])
|
|
|
+ }, [selectedModelId, setApiConfigurationField, apiConfiguration.apiModelId, isRetiredSelectedProvider])
|
|
|
|
|
|
// Debounced refresh model updates, only executed 250ms after the user
|
|
|
// stops typing.
|
|
|
@@ -243,11 +236,7 @@ const ApiOptions = ({
|
|
|
vscode.postMessage({ type: "requestLmStudioModels" })
|
|
|
} else if (selectedProvider === "vscode-lm") {
|
|
|
vscode.postMessage({ type: "requestVsCodeLmModels" })
|
|
|
- } else if (
|
|
|
- selectedProvider === "litellm" ||
|
|
|
- selectedProvider === "deepinfra" ||
|
|
|
- selectedProvider === "roo"
|
|
|
- ) {
|
|
|
+ } else if (selectedProvider === "litellm" || selectedProvider === "roo") {
|
|
|
vscode.postMessage({ type: "requestRouterModels" })
|
|
|
}
|
|
|
},
|
|
|
@@ -261,20 +250,23 @@ const ApiOptions = ({
|
|
|
apiConfiguration?.lmStudioBaseUrl,
|
|
|
apiConfiguration?.litellmBaseUrl,
|
|
|
apiConfiguration?.litellmApiKey,
|
|
|
- apiConfiguration?.deepInfraApiKey,
|
|
|
- apiConfiguration?.deepInfraBaseUrl,
|
|
|
customHeaders,
|
|
|
],
|
|
|
)
|
|
|
|
|
|
useEffect(() => {
|
|
|
+ if (isRetiredSelectedProvider) {
|
|
|
+ setErrorMessage(undefined)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
const apiValidationResult = validateApiConfigurationExcludingModelErrors(
|
|
|
apiConfiguration,
|
|
|
routerModels,
|
|
|
organizationAllowList,
|
|
|
)
|
|
|
setErrorMessage(apiValidationResult)
|
|
|
- }, [apiConfiguration, routerModels, organizationAllowList, setErrorMessage])
|
|
|
+ }, [apiConfiguration, routerModels, organizationAllowList, setErrorMessage, isRetiredSelectedProvider])
|
|
|
|
|
|
const onProviderChange = useCallback(
|
|
|
(value: ProviderName) => {
|
|
|
@@ -282,7 +274,7 @@ const ApiOptions = ({
|
|
|
|
|
|
// It would be much easier to have a single attribute that stores
|
|
|
// the modelId, but we have a separate attribute for each of
|
|
|
- // OpenRouter, Unbound, and Requesty.
|
|
|
+ // OpenRouter and Requesty.
|
|
|
// If you switch to one of these providers and the corresponding
|
|
|
// modelId is not set then you immediately end up in an error state.
|
|
|
// To address that we set the modelId to the default value for th
|
|
|
@@ -336,25 +328,19 @@ const ApiOptions = ({
|
|
|
}
|
|
|
>
|
|
|
> = {
|
|
|
- deepinfra: { field: "deepInfraModelId", default: deepInfraDefaultModelId },
|
|
|
openrouter: { field: "openRouterModelId", default: openRouterDefaultModelId },
|
|
|
- unbound: { field: "unboundModelId", default: unboundDefaultModelId },
|
|
|
requesty: { field: "requestyModelId", default: requestyDefaultModelId },
|
|
|
litellm: { field: "litellmModelId", default: litellmDefaultModelId },
|
|
|
anthropic: { field: "apiModelId", default: anthropicDefaultModelId },
|
|
|
- cerebras: { field: "apiModelId", default: cerebrasDefaultModelId },
|
|
|
"openai-codex": { field: "apiModelId", default: openAiCodexDefaultModelId },
|
|
|
"qwen-code": { field: "apiModelId", default: qwenCodeDefaultModelId },
|
|
|
"openai-native": { field: "apiModelId", default: openAiNativeDefaultModelId },
|
|
|
gemini: { field: "apiModelId", default: geminiDefaultModelId },
|
|
|
deepseek: { field: "apiModelId", default: deepSeekDefaultModelId },
|
|
|
- doubao: { field: "apiModelId", default: doubaoDefaultModelId },
|
|
|
moonshot: { field: "apiModelId", default: moonshotDefaultModelId },
|
|
|
minimax: { field: "apiModelId", default: minimaxDefaultModelId },
|
|
|
mistral: { field: "apiModelId", default: mistralDefaultModelId },
|
|
|
xai: { field: "apiModelId", default: xaiDefaultModelId },
|
|
|
- groq: { field: "apiModelId", default: groqDefaultModelId },
|
|
|
- chutes: { field: "apiModelId", default: chutesDefaultModelId },
|
|
|
baseten: { field: "apiModelId", default: basetenDefaultModelId },
|
|
|
bedrock: { field: "apiModelId", default: bedrockDefaultModelId },
|
|
|
vertex: { field: "apiModelId", default: vertexDefaultModelId },
|
|
|
@@ -367,8 +353,6 @@ const ApiOptions = ({
|
|
|
: internationalZAiDefaultModelId,
|
|
|
},
|
|
|
fireworks: { field: "apiModelId", default: fireworksDefaultModelId },
|
|
|
- featherless: { field: "apiModelId", default: featherlessDefaultModelId },
|
|
|
- "io-intelligence": { field: "ioIntelligenceModelId", default: ioIntelligenceDefaultModelId },
|
|
|
roo: { field: "apiModelId", default: rooDefaultModelId },
|
|
|
"vercel-ai-gateway": { field: "vercelAiGatewayModelId", default: vercelAiGatewayDefaultModelId },
|
|
|
openai: { field: "openAiModelId" },
|
|
|
@@ -500,379 +484,355 @@ const ApiOptions = ({
|
|
|
|
|
|
{errorMessage && <ApiErrorMessage errorMessage={errorMessage} />}
|
|
|
|
|
|
- {selectedProvider === "openrouter" && (
|
|
|
- <OpenRouter
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- routerModels={routerModels}
|
|
|
- selectedModelId={selectedModelId}
|
|
|
- uriScheme={uriScheme}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- organizationAllowList={organizationAllowList}
|
|
|
- modelValidationError={modelValidationError}
|
|
|
- />
|
|
|
- )}
|
|
|
-
|
|
|
- {selectedProvider === "requesty" && (
|
|
|
- <Requesty
|
|
|
- uriScheme={uriScheme}
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- routerModels={routerModels}
|
|
|
- refetchRouterModels={refetchRouterModels}
|
|
|
- organizationAllowList={organizationAllowList}
|
|
|
- modelValidationError={modelValidationError}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
-
|
|
|
- {selectedProvider === "unbound" && (
|
|
|
- <Unbound
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- routerModels={routerModels}
|
|
|
- organizationAllowList={organizationAllowList}
|
|
|
- modelValidationError={modelValidationError}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
-
|
|
|
- {selectedProvider === "deepinfra" && (
|
|
|
- <DeepInfra
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- routerModels={routerModels}
|
|
|
- refetchRouterModels={refetchRouterModels}
|
|
|
- organizationAllowList={organizationAllowList}
|
|
|
- modelValidationError={modelValidationError}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
-
|
|
|
- {selectedProvider === "anthropic" && (
|
|
|
- <Anthropic
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
-
|
|
|
- {selectedProvider === "openai-codex" && (
|
|
|
- <OpenAICodex
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- openAiCodexIsAuthenticated={openAiCodexIsAuthenticated}
|
|
|
- />
|
|
|
- )}
|
|
|
-
|
|
|
- {selectedProvider === "openai-native" && (
|
|
|
- <OpenAI
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- selectedModelInfo={selectedModelInfo}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
-
|
|
|
- {selectedProvider === "mistral" && (
|
|
|
- <Mistral
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
-
|
|
|
- {selectedProvider === "baseten" && (
|
|
|
- <Baseten
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
-
|
|
|
- {selectedProvider === "bedrock" && (
|
|
|
- <Bedrock
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- selectedModelInfo={selectedModelInfo}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
-
|
|
|
- {selectedProvider === "vertex" && (
|
|
|
- <Vertex apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
- )}
|
|
|
+ {isRetiredSelectedProvider ? (
|
|
|
+ <div
|
|
|
+ className="rounded-md border border-vscode-panel-border px-3 py-2 text-sm text-vscode-descriptionForeground"
|
|
|
+ data-testid="retired-provider-message">
|
|
|
+ {t("settings:providers.retiredProviderMessage")}
|
|
|
+ </div>
|
|
|
+ ) : (
|
|
|
+ <>
|
|
|
+ {selectedProvider === "openrouter" && (
|
|
|
+ <OpenRouter
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ routerModels={routerModels}
|
|
|
+ selectedModelId={selectedModelId}
|
|
|
+ uriScheme={uriScheme}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
+ organizationAllowList={organizationAllowList}
|
|
|
+ modelValidationError={modelValidationError}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "gemini" && (
|
|
|
- <Gemini apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
- )}
|
|
|
+ {selectedProvider === "requesty" && (
|
|
|
+ <Requesty
|
|
|
+ uriScheme={uriScheme}
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ routerModels={routerModels}
|
|
|
+ refetchRouterModels={refetchRouterModels}
|
|
|
+ organizationAllowList={organizationAllowList}
|
|
|
+ modelValidationError={modelValidationError}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "openai" && (
|
|
|
- <OpenAICompatible
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- organizationAllowList={organizationAllowList}
|
|
|
- modelValidationError={modelValidationError}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
+ {selectedProvider === "anthropic" && (
|
|
|
+ <Anthropic
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "lmstudio" && (
|
|
|
- <LMStudio apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
- )}
|
|
|
+ {selectedProvider === "openai-codex" && (
|
|
|
+ <OpenAICodex
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
+ openAiCodexIsAuthenticated={openAiCodexIsAuthenticated}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "deepseek" && (
|
|
|
- <DeepSeek
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
+ {selectedProvider === "openai-native" && (
|
|
|
+ <OpenAI
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ selectedModelInfo={selectedModelInfo}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "doubao" && (
|
|
|
- <Doubao
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
+ {selectedProvider === "mistral" && (
|
|
|
+ <Mistral
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "qwen-code" && (
|
|
|
- <QwenCode
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
+ {selectedProvider === "baseten" && (
|
|
|
+ <Baseten
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "moonshot" && (
|
|
|
- <Moonshot
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
+ {selectedProvider === "bedrock" && (
|
|
|
+ <Bedrock
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ selectedModelInfo={selectedModelInfo}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "minimax" && (
|
|
|
- <MiniMax apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
- )}
|
|
|
+ {selectedProvider === "vertex" && (
|
|
|
+ <Vertex
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "vscode-lm" && (
|
|
|
- <VSCodeLM apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
- )}
|
|
|
+ {selectedProvider === "gemini" && (
|
|
|
+ <Gemini
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "ollama" && (
|
|
|
- <Ollama apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
- )}
|
|
|
+ {selectedProvider === "openai" && (
|
|
|
+ <OpenAICompatible
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ organizationAllowList={organizationAllowList}
|
|
|
+ modelValidationError={modelValidationError}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "xai" && (
|
|
|
- <XAI apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
- )}
|
|
|
+ {selectedProvider === "lmstudio" && (
|
|
|
+ <LMStudio
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "groq" && (
|
|
|
- <Groq apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
- )}
|
|
|
+ {selectedProvider === "deepseek" && (
|
|
|
+ <DeepSeek
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "huggingface" && (
|
|
|
- <HuggingFace apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
- )}
|
|
|
+ {selectedProvider === "qwen-code" && (
|
|
|
+ <QwenCode
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "cerebras" && (
|
|
|
- <Cerebras apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
- )}
|
|
|
+ {selectedProvider === "moonshot" && (
|
|
|
+ <Moonshot
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "chutes" && (
|
|
|
- <Chutes
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- routerModels={routerModels}
|
|
|
- organizationAllowList={organizationAllowList}
|
|
|
- modelValidationError={modelValidationError}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
+ {selectedProvider === "minimax" && (
|
|
|
+ <MiniMax
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "litellm" && (
|
|
|
- <LiteLLM
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- organizationAllowList={organizationAllowList}
|
|
|
- modelValidationError={modelValidationError}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
+ {selectedProvider === "vscode-lm" && (
|
|
|
+ <VSCodeLM
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "sambanova" && (
|
|
|
- <SambaNova apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
- )}
|
|
|
+ {selectedProvider === "ollama" && (
|
|
|
+ <Ollama
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "zai" && (
|
|
|
- <ZAi apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
- )}
|
|
|
+ {selectedProvider === "xai" && (
|
|
|
+ <XAI apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "io-intelligence" && (
|
|
|
- <IOIntelligence
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- organizationAllowList={organizationAllowList}
|
|
|
- modelValidationError={modelValidationError}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
+ {selectedProvider === "litellm" && (
|
|
|
+ <LiteLLM
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ organizationAllowList={organizationAllowList}
|
|
|
+ modelValidationError={modelValidationError}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "vercel-ai-gateway" && (
|
|
|
- <VercelAiGateway
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- routerModels={routerModels}
|
|
|
- organizationAllowList={organizationAllowList}
|
|
|
- modelValidationError={modelValidationError}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
+ {selectedProvider === "sambanova" && (
|
|
|
+ <SambaNova
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "fireworks" && (
|
|
|
- <Fireworks apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
- )}
|
|
|
+ {selectedProvider === "zai" && (
|
|
|
+ <ZAi apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "roo" && (
|
|
|
- <Roo
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- routerModels={routerModels}
|
|
|
- cloudIsAuthenticated={cloudIsAuthenticated}
|
|
|
- organizationAllowList={organizationAllowList}
|
|
|
- modelValidationError={modelValidationError}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- />
|
|
|
- )}
|
|
|
+ {selectedProvider === "vercel-ai-gateway" && (
|
|
|
+ <VercelAiGateway
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ routerModels={routerModels}
|
|
|
+ organizationAllowList={organizationAllowList}
|
|
|
+ modelValidationError={modelValidationError}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {selectedProvider === "featherless" && (
|
|
|
- <Featherless apiConfiguration={apiConfiguration} setApiConfigurationField={setApiConfigurationField} />
|
|
|
- )}
|
|
|
+ {selectedProvider === "fireworks" && (
|
|
|
+ <Fireworks
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ />
|
|
|
+ )}
|
|
|
|
|
|
- {/* Generic model picker for providers with static models */}
|
|
|
- {shouldUseGenericModelPicker(selectedProvider) && (
|
|
|
- <>
|
|
|
- <ModelPicker
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- defaultModelId={getDefaultModelIdForProvider(selectedProvider, apiConfiguration)}
|
|
|
- models={getStaticModelsForProvider(selectedProvider, t("settings:labels.useCustomArn"))}
|
|
|
- modelIdKey="apiModelId"
|
|
|
- serviceName={getProviderServiceConfig(selectedProvider).serviceName}
|
|
|
- serviceUrl={getProviderServiceConfig(selectedProvider).serviceUrl}
|
|
|
- organizationAllowList={organizationAllowList}
|
|
|
- errorMessage={modelValidationError}
|
|
|
- simplifySettings={fromWelcomeView}
|
|
|
- onModelChange={(modelId) =>
|
|
|
- handleModelChangeSideEffects(selectedProvider, modelId, setApiConfigurationField)
|
|
|
- }
|
|
|
- />
|
|
|
-
|
|
|
- {selectedProvider === "bedrock" && selectedModelId === "custom-arn" && (
|
|
|
- <BedrockCustomArn
|
|
|
+ {selectedProvider === "roo" && (
|
|
|
+ <Roo
|
|
|
apiConfiguration={apiConfiguration}
|
|
|
setApiConfigurationField={setApiConfigurationField}
|
|
|
+ routerModels={routerModels}
|
|
|
+ cloudIsAuthenticated={cloudIsAuthenticated}
|
|
|
+ organizationAllowList={organizationAllowList}
|
|
|
+ modelValidationError={modelValidationError}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
/>
|
|
|
)}
|
|
|
- </>
|
|
|
- )}
|
|
|
|
|
|
- {!fromWelcomeView && (
|
|
|
- <ThinkingBudget
|
|
|
- key={`${selectedProvider}-${selectedModelId}`}
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- modelInfo={selectedModelInfo}
|
|
|
- />
|
|
|
- )}
|
|
|
+ {/* Generic model picker for providers with static models */}
|
|
|
+ {activeSelectedProvider && shouldUseGenericModelPicker(activeSelectedProvider) && (
|
|
|
+ <>
|
|
|
+ <ModelPicker
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ defaultModelId={getDefaultModelIdForProvider(activeSelectedProvider, apiConfiguration)}
|
|
|
+ models={getStaticModelsForProvider(
|
|
|
+ activeSelectedProvider,
|
|
|
+ t("settings:labels.useCustomArn"),
|
|
|
+ )}
|
|
|
+ modelIdKey="apiModelId"
|
|
|
+ serviceName={getProviderServiceConfig(activeSelectedProvider).serviceName}
|
|
|
+ serviceUrl={getProviderServiceConfig(activeSelectedProvider).serviceUrl}
|
|
|
+ organizationAllowList={organizationAllowList}
|
|
|
+ errorMessage={modelValidationError}
|
|
|
+ simplifySettings={fromWelcomeView}
|
|
|
+ onModelChange={(modelId) =>
|
|
|
+ handleModelChangeSideEffects(
|
|
|
+ activeSelectedProvider,
|
|
|
+ modelId,
|
|
|
+ setApiConfigurationField,
|
|
|
+ )
|
|
|
+ }
|
|
|
+ />
|
|
|
|
|
|
- {/* Gate Verbosity UI by capability flag */}
|
|
|
- {!fromWelcomeView && selectedModelInfo?.supportsVerbosity && (
|
|
|
- <Verbosity
|
|
|
- apiConfiguration={apiConfiguration}
|
|
|
- setApiConfigurationField={setApiConfigurationField}
|
|
|
- modelInfo={selectedModelInfo}
|
|
|
- />
|
|
|
- )}
|
|
|
+ {selectedProvider === "bedrock" && selectedModelId === "custom-arn" && (
|
|
|
+ <BedrockCustomArn
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ </>
|
|
|
+ )}
|
|
|
|
|
|
- {!fromWelcomeView && (
|
|
|
- <Collapsible open={isAdvancedSettingsOpen} onOpenChange={setIsAdvancedSettingsOpen}>
|
|
|
- <CollapsibleTrigger className="flex items-center gap-1 w-full cursor-pointer hover:opacity-80 mb-2">
|
|
|
- <span className={`codicon codicon-chevron-${isAdvancedSettingsOpen ? "down" : "right"}`}></span>
|
|
|
- <span className="font-medium">{t("settings:advancedSettings.title")}</span>
|
|
|
- </CollapsibleTrigger>
|
|
|
- <CollapsibleContent className="space-y-3">
|
|
|
- <TodoListSettingsControl
|
|
|
- todoListEnabled={apiConfiguration.todoListEnabled}
|
|
|
- onChange={(field, value) => setApiConfigurationField(field, value)}
|
|
|
- />
|
|
|
- {selectedModelInfo?.supportsTemperature !== false && (
|
|
|
- <TemperatureControl
|
|
|
- value={apiConfiguration.modelTemperature}
|
|
|
- onChange={handleInputChange("modelTemperature", noTransform)}
|
|
|
- maxValue={2}
|
|
|
- defaultValue={selectedModelInfo?.defaultTemperature}
|
|
|
- />
|
|
|
- )}
|
|
|
- <RateLimitSecondsControl
|
|
|
- value={apiConfiguration.rateLimitSeconds || 0}
|
|
|
- onChange={(value) => setApiConfigurationField("rateLimitSeconds", value)}
|
|
|
+ {!fromWelcomeView && (
|
|
|
+ <ThinkingBudget
|
|
|
+ key={`${selectedProvider}-${selectedModelId}`}
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ modelInfo={selectedModelInfo}
|
|
|
/>
|
|
|
- <ConsecutiveMistakeLimitControl
|
|
|
- value={
|
|
|
- apiConfiguration.consecutiveMistakeLimit !== undefined
|
|
|
- ? apiConfiguration.consecutiveMistakeLimit
|
|
|
- : DEFAULT_CONSECUTIVE_MISTAKE_LIMIT
|
|
|
- }
|
|
|
- onChange={(value) => setApiConfigurationField("consecutiveMistakeLimit", value)}
|
|
|
+ )}
|
|
|
+
|
|
|
+ {/* Gate Verbosity UI by capability flag */}
|
|
|
+ {!fromWelcomeView && selectedModelInfo?.supportsVerbosity && (
|
|
|
+ <Verbosity
|
|
|
+ apiConfiguration={apiConfiguration}
|
|
|
+ setApiConfigurationField={setApiConfigurationField}
|
|
|
+ modelInfo={selectedModelInfo}
|
|
|
/>
|
|
|
- {selectedProvider === "openrouter" &&
|
|
|
- openRouterModelProviders &&
|
|
|
- Object.keys(openRouterModelProviders).length > 0 && (
|
|
|
- <div>
|
|
|
- <div className="flex items-center gap-1">
|
|
|
- <label className="block font-medium mb-1">
|
|
|
- {t("settings:providers.openRouter.providerRouting.title")}
|
|
|
- </label>
|
|
|
- <a href={`https://openrouter.ai/${selectedModelId}/providers`}>
|
|
|
- <ExternalLinkIcon className="w-4 h-4" />
|
|
|
- </a>
|
|
|
- </div>
|
|
|
- <Select
|
|
|
- value={
|
|
|
- apiConfiguration?.openRouterSpecificProvider ||
|
|
|
- OPENROUTER_DEFAULT_PROVIDER_NAME
|
|
|
- }
|
|
|
- onValueChange={(value) =>
|
|
|
- setApiConfigurationField("openRouterSpecificProvider", value)
|
|
|
- }>
|
|
|
- <SelectTrigger className="w-full">
|
|
|
- <SelectValue placeholder={t("settings:common.select")} />
|
|
|
- </SelectTrigger>
|
|
|
- <SelectContent>
|
|
|
- <SelectItem value={OPENROUTER_DEFAULT_PROVIDER_NAME}>
|
|
|
- {OPENROUTER_DEFAULT_PROVIDER_NAME}
|
|
|
- </SelectItem>
|
|
|
- {Object.entries(openRouterModelProviders).map(([value, { label }]) => (
|
|
|
- <SelectItem key={value} value={value}>
|
|
|
- {label}
|
|
|
- </SelectItem>
|
|
|
- ))}
|
|
|
- </SelectContent>
|
|
|
- </Select>
|
|
|
- <div className="text-sm text-vscode-descriptionForeground mt-1">
|
|
|
- {t("settings:providers.openRouter.providerRouting.description")}{" "}
|
|
|
- <a href="https://openrouter.ai/docs/features/provider-routing">
|
|
|
- {t("settings:providers.openRouter.providerRouting.learnMore")}.
|
|
|
- </a>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- )}
|
|
|
- </CollapsibleContent>
|
|
|
- </Collapsible>
|
|
|
+ )}
|
|
|
+
|
|
|
+ {!fromWelcomeView && (
|
|
|
+ <Collapsible open={isAdvancedSettingsOpen} onOpenChange={setIsAdvancedSettingsOpen}>
|
|
|
+ <CollapsibleTrigger className="flex items-center gap-1 w-full cursor-pointer hover:opacity-80 mb-2">
|
|
|
+ <span
|
|
|
+ className={`codicon codicon-chevron-${isAdvancedSettingsOpen ? "down" : "right"}`}></span>
|
|
|
+ <span className="font-medium">{t("settings:advancedSettings.title")}</span>
|
|
|
+ </CollapsibleTrigger>
|
|
|
+ <CollapsibleContent className="space-y-3">
|
|
|
+ <TodoListSettingsControl
|
|
|
+ todoListEnabled={apiConfiguration.todoListEnabled}
|
|
|
+ onChange={(field, value) => setApiConfigurationField(field, value)}
|
|
|
+ />
|
|
|
+ {selectedModelInfo?.supportsTemperature !== false && (
|
|
|
+ <TemperatureControl
|
|
|
+ value={apiConfiguration.modelTemperature}
|
|
|
+ onChange={handleInputChange("modelTemperature", noTransform)}
|
|
|
+ maxValue={2}
|
|
|
+ defaultValue={selectedModelInfo?.defaultTemperature}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ <RateLimitSecondsControl
|
|
|
+ value={apiConfiguration.rateLimitSeconds || 0}
|
|
|
+ onChange={(value) => setApiConfigurationField("rateLimitSeconds", value)}
|
|
|
+ />
|
|
|
+ <ConsecutiveMistakeLimitControl
|
|
|
+ value={
|
|
|
+ apiConfiguration.consecutiveMistakeLimit !== undefined
|
|
|
+ ? apiConfiguration.consecutiveMistakeLimit
|
|
|
+ : DEFAULT_CONSECUTIVE_MISTAKE_LIMIT
|
|
|
+ }
|
|
|
+ onChange={(value) => setApiConfigurationField("consecutiveMistakeLimit", value)}
|
|
|
+ />
|
|
|
+ {selectedProvider === "openrouter" &&
|
|
|
+ openRouterModelProviders &&
|
|
|
+ Object.keys(openRouterModelProviders).length > 0 && (
|
|
|
+ <div>
|
|
|
+ <div className="flex items-center gap-1">
|
|
|
+ <label className="block font-medium mb-1">
|
|
|
+ {t("settings:providers.openRouter.providerRouting.title")}
|
|
|
+ </label>
|
|
|
+ <a href={`https://openrouter.ai/${selectedModelId}/providers`}>
|
|
|
+ <ExternalLinkIcon className="w-4 h-4" />
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ <Select
|
|
|
+ value={
|
|
|
+ apiConfiguration?.openRouterSpecificProvider ||
|
|
|
+ OPENROUTER_DEFAULT_PROVIDER_NAME
|
|
|
+ }
|
|
|
+ onValueChange={(value) =>
|
|
|
+ setApiConfigurationField("openRouterSpecificProvider", value)
|
|
|
+ }>
|
|
|
+ <SelectTrigger className="w-full">
|
|
|
+ <SelectValue placeholder={t("settings:common.select")} />
|
|
|
+ </SelectTrigger>
|
|
|
+ <SelectContent>
|
|
|
+ <SelectItem value={OPENROUTER_DEFAULT_PROVIDER_NAME}>
|
|
|
+ {OPENROUTER_DEFAULT_PROVIDER_NAME}
|
|
|
+ </SelectItem>
|
|
|
+ {Object.entries(openRouterModelProviders).map(
|
|
|
+ ([value, { label }]) => (
|
|
|
+ <SelectItem key={value} value={value}>
|
|
|
+ {label}
|
|
|
+ </SelectItem>
|
|
|
+ ),
|
|
|
+ )}
|
|
|
+ </SelectContent>
|
|
|
+ </Select>
|
|
|
+ <div className="text-sm text-vscode-descriptionForeground mt-1">
|
|
|
+ {t("settings:providers.openRouter.providerRouting.description")}{" "}
|
|
|
+ <a href="https://openrouter.ai/docs/features/provider-routing">
|
|
|
+ {t("settings:providers.openRouter.providerRouting.learnMore")}.
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </CollapsibleContent>
|
|
|
+ </Collapsible>
|
|
|
+ )}
|
|
|
+ </>
|
|
|
)}
|
|
|
</div>
|
|
|
)
|