diff --git a/core/llm/llms/WatsonX.ts b/core/llm/llms/WatsonX.ts index 561f4f2d9b..7f1fe2e0c4 100644 --- a/core/llm/llms/WatsonX.ts +++ b/core/llm/llms/WatsonX.ts @@ -21,7 +21,7 @@ class WatsonX extends BaseLLM { if (this.apiBase?.includes("cloud.ibm.com")) { // watsonx SaaS const wxToken = await ( - await fetch( + await this.fetch( `https://iam.cloud.ibm.com/identity/token?apikey=${this.apiKey}&grant_type=urn:ibm:params:oauth:grant-type:apikey`, { method: "POST", @@ -48,7 +48,7 @@ class WatsonX extends BaseLLM { // Using username/password auth const userPass = this.apiKey?.split(":"); const wxToken = await ( - await fetch(`${this.apiBase}/icp4d-api/v1/authorize`, { + await this.fetch(`${this.apiBase}/icp4d-api/v1/authorize`, { method: "POST", headers: { "Content-Type": "application/json", @@ -61,7 +61,7 @@ class WatsonX extends BaseLLM { }) ).json(); const wxTokenExpiry = await ( - await fetch(`${this.apiBase}/usermgmt/v1/user/tokenExpiry`, { + await this.fetch(`${this.apiBase}/usermgmt/v1/user/tokenExpiry`, { method: "GET", headers: { Accept: "application/json",