WatsonxBaseService class extends BaseService and provides common functionalities for Watsonx services.

Hierarchy (view full)

Constructors - Constructor

Properties

httpsAgentMap: WatsonXAI.HttpsAgentMap = ...
projectId?: string
serviceUrl: string

URL required for watsonx inference endpoints

spaceId?: string
version: string

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

wxServiceUrl: string

URL required for dataplatform endpoints

PLATFORM_URLS_MAP: Record<string, string> = PLATFORM_URL_MAPPINGS

Methods

  • Private

    Resolves projectId and spaceId with fallback to instance values.

    This method implements a priority-based resolution strategy:

    1. If both instance values (this.projectId/this.spaceId) AND parameter values exist, parameter values take absolute precedence and instance values are ignored
    2. Otherwise, parameter values are used if provided, falling back to instance values

    This ensures that explicitly passed parameters always override instance configuration when both are present, preventing unintended mixing of project and space contexts.

    Parameters

    • params: {
          projectId?: string;
          spaceId?: string;
      }

      Object containing optional projectId and spaceId

      • Optional projectId?: string

        The project ID to use for the request

      • Optional spaceId?: string

        The space ID to use for the request

    Returns {
        projectId?: string;
        spaceId?: string;
    }

    Resolved projectId and spaceId values

    • Optional projectId?: string
    • Optional spaceId?: string