Constructs an instance of BatchInference with passed in options and external configuration.
The parameters to send to the service.
Private #apikeyFiles instance for managing batch inference files.
Optional projectURL required for watsonx inference endpoints
Optional spaceThe version date for the API of the form YYYY-MM-DD.
URL required for dataplatform endpoints
Static PLATFORM_Protected _formProtected Forms container ID headers based on project ID or space ID.
This method creates the appropriate IBM-specific headers for identifying the container (project or space) that the API request should operate within. It prioritizes parameters passed in the request over instance-level defaults.
Optional params: ContextIdentifiers = {}Container identifiers (projectId or spaceId). Default
is {}
An object containing either the project ID header, space ID header, or an empty object if neither is provided
Performs a POST request to the specified URL.
The parameters for the POST request.
Performs a POST request to the specified URL and returns a stream.
The parameters for the POST request.
Protected appendProtected Appends additional data to request headers.
This utility method merges override headers with existing headers in the parameters object, ensuring that custom headers are properly combined without losing existing header data.
The type of parameters, constrained to request parameter types with container identifiers
The request parameters containing existing headers
Additional headers to merge into the request
A new parameters object with merged headers
Cancel a batch inference job.
Cancels a batch inference job that is in progress. Once cancelled, the job cannot be resumed.
The parameters to send to the service.
A promise that resolves to the response with cancelled batch job data
Create a new batch inference job.
Creates a batch inference job with the specified input file, endpoint, and completion window. The batch job will process requests from the input file and generate results.
The parameters to send to the service.
A promise that resolves to the response with batch job data
Retrieve batch job details or list all batch jobs.
When called with batchId, retrieves details of a specific batch job. When called without
batchId, retrieves a list of all batch jobs.
The parameters to send to the service.
A promise that resolves to either a single batch job or a collection of batch jobs
List all batch jobs.
Retrieves a list of all batch jobs for the specified space or project.
The parameters to send to the service.
A promise that resolves to an array of batch jobs
Private resolvePrivate Resolves projectId and spaceId with fallback to instance values.
This method implements a priority-based resolution strategy:
This ensures that explicitly passed parameters always override instance configuration when both are present, preventing unintended mixing of project and space contexts.
Object containing optional projectId and spaceId
Optional projectThe project ID to use for the request
Optional spaceThe space ID to use for the request
Resolved projectId and spaceId values
Optional projectOptional space
Service for managing batch inference operations in watsonx.ai.
Provides methods to create, retrieve, list, and cancel batch inference jobs, as well as manage associated files through the Files instance.