mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Use or instead of null coalescing instead since state may return non undefined for new values
This commit is contained in:
@@ -42,7 +42,7 @@ export class OllamaHandler implements ApiHandler {
|
|||||||
|
|
||||||
getModel(): { id: string; info: ModelInfo } {
|
getModel(): { id: string; info: ModelInfo } {
|
||||||
return {
|
return {
|
||||||
id: this.options.ollamaModelId ?? "",
|
id: this.options.ollamaModelId || "",
|
||||||
info: openAiModelInfoSaneDefaults,
|
info: openAiModelInfoSaneDefaults,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -724,19 +724,19 @@ export function normalizeApiConfiguration(apiConfiguration?: ApiConfiguration) {
|
|||||||
case "openrouter":
|
case "openrouter":
|
||||||
return {
|
return {
|
||||||
selectedProvider: provider,
|
selectedProvider: provider,
|
||||||
selectedModelId: apiConfiguration?.openRouterModelId ?? openRouterDefaultModelId,
|
selectedModelId: apiConfiguration?.openRouterModelId || openRouterDefaultModelId,
|
||||||
selectedModelInfo: apiConfiguration?.openRouterModelInfo ?? openRouterDefaultModelInfo,
|
selectedModelInfo: apiConfiguration?.openRouterModelInfo || openRouterDefaultModelInfo,
|
||||||
}
|
}
|
||||||
case "openai":
|
case "openai":
|
||||||
return {
|
return {
|
||||||
selectedProvider: provider,
|
selectedProvider: provider,
|
||||||
selectedModelId: apiConfiguration?.openAiModelId ?? "",
|
selectedModelId: apiConfiguration?.openAiModelId || "",
|
||||||
selectedModelInfo: openAiModelInfoSaneDefaults,
|
selectedModelInfo: openAiModelInfoSaneDefaults,
|
||||||
}
|
}
|
||||||
case "ollama":
|
case "ollama":
|
||||||
return {
|
return {
|
||||||
selectedProvider: provider,
|
selectedProvider: provider,
|
||||||
selectedModelId: apiConfiguration?.ollamaModelId ?? "",
|
selectedModelId: apiConfiguration?.ollamaModelId || "",
|
||||||
selectedModelInfo: openAiModelInfoSaneDefaults,
|
selectedModelInfo: openAiModelInfoSaneDefaults,
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export function validateModelId(
|
|||||||
if (apiConfiguration) {
|
if (apiConfiguration) {
|
||||||
switch (apiConfiguration.apiProvider) {
|
switch (apiConfiguration.apiProvider) {
|
||||||
case "openrouter":
|
case "openrouter":
|
||||||
const modelId = apiConfiguration.openRouterModelId ?? openRouterDefaultModelId // in case the user hasn't changed the model id, it will be undefined by default
|
const modelId = apiConfiguration.openRouterModelId || openRouterDefaultModelId // in case the user hasn't changed the model id, it will be undefined by default
|
||||||
if (!modelId) {
|
if (!modelId) {
|
||||||
return "You must provide a model ID."
|
return "You must provide a model ID."
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user