Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fetchwithRequestOptions for all calls in WatsonX. #4812

Merged
merged 1 commit into from
Apr 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/llm/llms/WatsonX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
Loading