From 6c269c17b39f98950c362d894f09693ded540fed Mon Sep 17 00:00:00 2001 From: Prasang Prajapati Date: Thu, 28 Aug 2025 18:29:50 -0400 Subject: [PATCH] add ibm-cloud-sdk-core dependency --- pnpm-lock.yaml | 3 +++ src/api/providers/fetchers/watsonx.ts | 14 +++++++------- src/package.json | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7101b9230d..5c2382e364 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -658,6 +658,9 @@ importers: i18next: specifier: ^25.0.0 version: 25.2.1(typescript@5.8.3) + ibm-cloud-sdk-core: + specifier: ^5.4.2 + version: 5.4.2 ignore: specifier: ^7.0.3 version: 7.0.4 diff --git a/src/api/providers/fetchers/watsonx.ts b/src/api/providers/fetchers/watsonx.ts index 374cb7cf54..568639ed9d 100644 --- a/src/api/providers/fetchers/watsonx.ts +++ b/src/api/providers/fetchers/watsonx.ts @@ -30,9 +30,13 @@ export async function getWatsonxModels( } if (platform === "ibmCloud" || !platform) { - options.authenticator = new IamAuthenticator({ - apikey: apiKey, - }) + if (apiKey) { + options.authenticator = new IamAuthenticator({ + apikey: apiKey, + }) + } else { + return {} + } } else if (platform === "cloudPak") { if (!baseUrl) { throw new Error("Base URL is required for IBM Cloud Pak for Data") @@ -52,10 +56,6 @@ export async function getWatsonxModels( apikey: apiKey, }) } - } else { - options.authenticator = new IamAuthenticator({ - apikey: apiKey, - }) } } diff --git a/src/package.json b/src/package.json index 8a8354f678..fea2d7e5f3 100644 --- a/src/package.json +++ b/src/package.json @@ -454,6 +454,7 @@ "google-auth-library": "^9.15.1", "gray-matter": "^4.0.3", "i18next": "^25.0.0", + "ibm-cloud-sdk-core": "^5.4.2", "ignore": "^7.0.3", "isbinaryfile": "^5.0.2", "lodash.debounce": "^4.0.8",