Use fetchwithRequestOptions for all calls in WatsonX.
Signed-off-by: Łukasz Dywicki <luke@code-house.org>
This commit is contained in:
parent
a2634fb22a
commit
075b785e19
1 changed files with 3 additions and 3 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue