Skip to content

Commit a8e52b8

Browse files
committed
Refactor Mistral API options: remove unused default headers and improve UI elements, wrong merge. defaultModel removed
1 parent 8d796c2 commit a8e52b8

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed

src/api/providers/mistral.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,24 +83,6 @@ const INITIAL_RETRY_DELAY = 1000 // Initial retry delay in milliseconds
8383
const MAX_RETRY_DELAY = 32000 // Maximum retry delay in milliseconds
8484
const JITTER_FACTOR = 0.2 // Jitter factor for randomization (20%)
8585

86-
// Define default headers
87-
export const defaultHeaders = {
88-
"HTTP-Referer": "https://github.com/RooVetGit/Roo-Cline",
89-
"X-Title": "Roo Code",
90-
}
91-
92-
interface TextContent {
93-
type: "text"
94-
text: string
95-
}
96-
97-
interface ImageURLContent {
98-
type: "image_url"
99-
url: string
100-
}
101-
102-
type MistralContent = string | (TextContent | ImageURLContent)[]
103-
10486
interface MistralErrorResponse {
10587
error: {
10688
message: string

webview-ui/src/components/settings/ApiOptions.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,10 +428,9 @@ const ApiOptions = ({
428428
<>
429429
<VSCodeTextField
430430
value={apiConfiguration?.mistralApiKey || ""}
431-
style={{ width: "100%" }}
432431
type="password"
433432
onInput={handleInputChange("mistralApiKey")}
434-
placeholder="Enter API Key..."
433+
placeholder={t("settings:placeholders.apiKey")}
435434
className="w-full">
436435
<span className="font-medium">{t("settings:providers.mistralApiKey")}</span>
437436
</VSCodeTextField>
@@ -443,18 +442,21 @@ const ApiOptions = ({
443442
{t("settings:providers.getMistralApiKey")}
444443
</VSCodeButtonLink>
445444
)}
446-
{shouldShowCodestralUrl() && (
445+
{(apiConfiguration?.apiModelId?.startsWith("codestral-") ||
446+
(!apiConfiguration?.apiModelId && mistralDefaultModelId.startsWith("codestral-"))) && (
447447
<>
448448
<VSCodeTextField
449449
value={apiConfiguration?.mistralCodestralUrl || ""}
450450
type="url"
451451
onInput={handleInputChange("mistralCodestralUrl")}
452452
placeholder="https://codestral.mistral.ai"
453453
className="w-full">
454-
<span className="font-medium">{t("settings:providers.codestralBaseUrl")}</span>
454+
<label className="block font-medium mb-1">
455+
{t("settings:providers.codestralBaseUrl")}
456+
</label>
455457
</VSCodeTextField>
456458
<div className="text-sm text-vscode-descriptionForeground -mt-2">
457-
<>{t("settings:providers.codestralBaseUrlDesc")}</>
459+
{t("settings:providers.codestralBaseUrlDesc")}
458460
</div>
459461
</>
460462
)}

0 commit comments

Comments
 (0)