APIBaseService class extends WatsonxBaseService and provides common API request functionalities.

Hierarchy (view full)

Constructors - constructor

Properties

serviceUrl: string

URL required for watsonx inference endpoints

version: string

The version date for the API of the form YYYY-MM-DD.

wxServiceUrl: string

URL required for dataplatform endpoints

PLATFORM_URLS_MAP: {
    https://ca-tor.ml.cloud.ibm.com: string;
    https://eu-de.ml.cloud.ibm.com: string;
    https://eu-gb.ml.cloud.ibm.com: string;
    https://jp-tok.ml.cloud.ibm.com: string;
    https://private.ca-tor.ml.cloud.ibm.com: string;
    https://private.eu-de.ml.cloud.ibm.com: string;
    https://private.eu-gb.ml.cloud.ibm.com: string;
    https://private.jp-tok.ml.cloud.ibm.com: string;
    https://private.us-south.ml.cloud.ibm.com: string;
    https://us-south.ml.cloud.ibm.com: string;
} = ...

Type declaration

  • https://ca-tor.ml.cloud.ibm.com: string
  • https://eu-de.ml.cloud.ibm.com: string
  • https://eu-gb.ml.cloud.ibm.com: string
  • https://jp-tok.ml.cloud.ibm.com: string
  • https://private.ca-tor.ml.cloud.ibm.com: string
  • https://private.eu-de.ml.cloud.ibm.com: string
  • https://private.eu-gb.ml.cloud.ibm.com: string
  • https://private.jp-tok.ml.cloud.ibm.com: string
  • https://private.us-south.ml.cloud.ibm.com: string
  • https://us-south.ml.cloud.ibm.com: string

Methods

  • Performs a DELETE request to the specified URL.

    Type Parameters

    • T

    Parameters

    Returns Promise<Response<T>>

    • A promise that resolves to the response from the DELETE request.
  • Performs a GET request to the specified URL.

    Type Parameters

    • T

    Parameters

    Returns Promise<Response<T>>

    • A promise that resolves to the response from the GET request.
  • Performs a POST request to the specified URL.

    Type Parameters

    • T

    Parameters

    Returns Promise<Response<T>>

    • A promise that resolves to the response from the POST request.
  • Performs a POST request to the specified URL and returns a stream.

    Type Parameters

    • T

    Parameters

    Returns Promise<Stream<string | T>>

    • A promise that resolves to a stream from the POST request.
  • Performs a PUT request to the specified URL.

    Type Parameters

    • T

    Parameters

    Returns Promise<Response<T>>

    • A promise that resolves to the response from the PUT request.