From 19c38a36686fc17f910214e76de25ae8c17f44b2 Mon Sep 17 00:00:00 2001 From: "d.o.it" <6849456+d-oit@users.noreply.github.com> Date: Wed, 12 Feb 2025 15:21:35 +0100 Subject: [PATCH] Add mistralCodestralUrl to global state management in ClineProvider --- src/api/providers/mistral.ts | 3 ++- src/core/webview/ClineProvider.ts | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/api/providers/mistral.ts b/src/api/providers/mistral.ts index a70d21754a..a8743ab12d 100644 --- a/src/api/providers/mistral.ts +++ b/src/api/providers/mistral.ts @@ -23,7 +23,8 @@ export class MistralHandler implements ApiHandler { constructor(options: ApiHandlerOptions) { this.options = options const baseUrl = this.getBaseUrl() - console.log("MistralHandler: baseUrl", baseUrl) + // OR Option 2: Using the built-in debug logger + console.debug(`[Roo Code] MistralHandler using baseUrl: ${baseUrl}`) this.client = new Mistral({ serverURL: baseUrl, apiKey: this.options.mistralApiKey, diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 031e7960f9..496bb0147f 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -127,6 +127,7 @@ type GlobalStateKey = | "requestyModelInfo" | "unboundModelInfo" | "modelTemperature" + | "mistralCodestralUrl" export const GlobalFileNames = { apiConversationHistory: "api_conversation_history.json", @@ -1631,6 +1632,7 @@ export class ClineProvider implements vscode.WebviewViewProvider { openRouterUseMiddleOutTransform, vsCodeLmModelSelector, mistralApiKey, + mistralCodestralUrl, unboundApiKey, unboundModelId, unboundModelInfo, @@ -1676,6 +1678,7 @@ export class ClineProvider implements vscode.WebviewViewProvider { await this.updateGlobalState("openRouterUseMiddleOutTransform", openRouterUseMiddleOutTransform) await this.updateGlobalState("vsCodeLmModelSelector", vsCodeLmModelSelector) await this.storeSecret("mistralApiKey", mistralApiKey) + await this.updateGlobalState("mistralCodestralUrl", mistralCodestralUrl) await this.storeSecret("unboundApiKey", unboundApiKey) await this.updateGlobalState("unboundModelId", unboundModelId) await this.updateGlobalState("unboundModelInfo", unboundModelInfo) @@ -2490,6 +2493,7 @@ export class ClineProvider implements vscode.WebviewViewProvider { openAiNativeApiKey, deepSeekApiKey, mistralApiKey, + mistralCodestralUrl, azureApiVersion, openAiStreamingEnabled, openRouterModelId, @@ -2570,6 +2574,7 @@ export class ClineProvider implements vscode.WebviewViewProvider { this.getSecret("openAiNativeApiKey") as Promise, this.getSecret("deepSeekApiKey") as Promise, this.getSecret("mistralApiKey") as Promise, + this.getGlobalState("mistralCodestralUrl") as Promise, this.getGlobalState("azureApiVersion") as Promise, this.getGlobalState("openAiStreamingEnabled") as Promise, this.getGlobalState("openRouterModelId") as Promise, @@ -2667,6 +2672,7 @@ export class ClineProvider implements vscode.WebviewViewProvider { openAiNativeApiKey, deepSeekApiKey, mistralApiKey, + mistralCodestralUrl, azureApiVersion, openAiStreamingEnabled, openRouterModelId,