Skip to content

Commit d7e10bc

Browse files
committed
fix: improve IO Intelligence provider implementation
- Fix inconsistent error messaging in fetcher (use consistent 'IO Intelligence API key is required') - Add translation for hardcoded placeholder text in IOIntelligence component - Add ioIntelligenceApiKeyPlaceholder translation key to all language files
1 parent 839ca8a commit d7e10bc

File tree

20 files changed

+21
-3
lines changed

20 files changed

+21
-3
lines changed

src/api/providers/fetchers/io-intelligence.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ export async function getIOIntelligenceModels(apiKey?: string): Promise<ModelRec
117117
if (apiKey) {
118118
headers.Authorization = `Bearer ${apiKey}`
119119
} else {
120-
console.error("You have to provide an API key")
121-
throw new Error("Invalid API Key for IO Intelligence")
120+
console.error("IO Intelligence API key is required")
121+
throw new Error("IO Intelligence API key is required")
122122
}
123123

124124
const response = await axios.get<IOIntelligenceApiResponse>(

webview-ui/src/components/settings/providers/IOIntelligence.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const IOIntelligence = ({
4444
value={apiConfiguration?.ioIntelligenceApiKey || ""}
4545
type="password"
4646
onInput={handleInputChange("ioIntelligenceApiKey")}
47-
placeholder="Enter your IO Intelligence API key"
47+
placeholder={t("settings:providers.ioIntelligenceApiKeyPlaceholder")}
4848
className="w-full">
4949
<label className="block font-medium mb-1">{t("settings:providers.ioIntelligenceApiKey")}</label>
5050
</VSCodeTextField>

webview-ui/src/i18n/locales/ca/settings.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/de/settings.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/en/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@
263263
"fireworksApiKey": "Fireworks API Key",
264264
"getFireworksApiKey": "Get Fireworks API Key",
265265
"ioIntelligenceApiKey": "IO Intelligence API Key",
266+
"ioIntelligenceApiKeyPlaceholder": "Enter your IO Intelligence API key",
266267
"getIoIntelligenceApiKey": "Get IO Intelligence API Key",
267268
"deepSeekApiKey": "DeepSeek API Key",
268269
"getDeepSeekApiKey": "Get DeepSeek API Key",

webview-ui/src/i18n/locales/es/settings.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/fr/settings.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/hi/settings.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/id/settings.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/it/settings.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)