Skip to content

Commit 8839606

Browse files
Add IBM watsonx AI provider in the list of AI providers
1 parent 69c3670 commit 8839606

File tree

21 files changed

+61
-3
lines changed

21 files changed

+61
-3
lines changed

src/api/providers/ibm-watsonx.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ export class WatsonxAIHandler extends BaseProvider implements SingleCompletionHa
148148
const watsonxMessages = [{ role: "system", content: systemPrompt }, ...convertToOpenAiMessages(messages)]
149149

150150
const params = this.createTextChatParams(this.projectId!, modelId, watsonxMessages)
151-
152151
const response = await this.service.textChat(params)
153152

154153
if (!response?.result?.choices?.[0]?.message?.content) {
@@ -172,7 +171,7 @@ export class WatsonxAIHandler extends BaseProvider implements SingleCompletionHa
172171
type: "usage",
173172
inputTokens: inputTokens,
174173
outputTokens,
175-
totalCost: totalCost,
174+
totalCost: totalCost.totalCost,
176175
}
177176
} catch (error) {
178177
const errorMessage = error?.message || String(error)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,7 @@ const ApiOptions = ({
860860
<DiffSettingsControl
861861
diffEnabled={apiConfiguration.diffEnabled}
862862
fuzzyMatchThreshold={apiConfiguration.fuzzyMatchThreshold}
863+
provider={apiConfiguration.apiProvider}
863864
onChange={(field, value) => setApiConfigurationField(field, value)}
864865
/>
865866
{selectedModelInfo?.supportsTemperature !== false && (

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
66
interface DiffSettingsControlProps {
77
diffEnabled?: boolean
88
fuzzyMatchThreshold?: number
9+
provider?: string
910
onChange: (field: "diffEnabled" | "fuzzyMatchThreshold", value: any) => void
1011
}
1112

1213
export const DiffSettingsControl: React.FC<DiffSettingsControlProps> = ({
1314
diffEnabled = true,
1415
fuzzyMatchThreshold = 1.0,
16+
provider,
1517
onChange,
1618
}) => {
1719
const { t } = useAppTranslation()
@@ -37,7 +39,9 @@ export const DiffSettingsControl: React.FC<DiffSettingsControlProps> = ({
3739
<span className="font-medium">{t("settings:advanced.diff.label")}</span>
3840
</VSCodeCheckbox>
3941
<div className="text-vscode-descriptionForeground text-sm">
40-
{t("settings:advanced.diff.description")}
42+
{provider === "ibm-watsonx"
43+
? t("settings:advanced.diff.watsonx.description")
44+
: t("settings:advanced.diff.description")}
4145
</div>
4246
</div>
4347

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

Lines changed: 3 additions & 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: 3 additions & 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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,9 @@
723723
"standard": "Standard diff strategy applies changes to a single code block at a time.",
724724
"unified": "Unified diff strategy takes multiple approaches to applying diffs and chooses the best approach.",
725725
"multiBlock": "Multi-block diff strategy allows updating multiple code blocks in a file in one request."
726+
},
727+
"watsonx": {
728+
"description": "When enabled, Roo will be able to edit files more quickly and will automatically reject truncated full-file writes."
726729
}
727730
},
728731
"matchPrecision": {

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

Lines changed: 3 additions & 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: 3 additions & 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: 3 additions & 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: 3 additions & 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)