/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { llmBatchesCancel } from "../funcs/llmBatchesCancel.js"; import { llmBatchesCreate } from "../funcs/llmBatchesCreate.js"; import { llmBatchesGet } from "../funcs/llmBatchesGet.js"; import { llmBatchesList } from "../funcs/llmBatchesList.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Batches extends ClientSDK { /** * Create a batch * * @remarks * Creates and executes a batch from an uploaded JSONL file of requests. Each line must have custom_id, method, url, and body fields. */ async create( request: operations.CreateBatchRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmBatchesCreate( this, request, options, )); } /** * List batches * * @remarks * Returns a paginated list of batches owned by the authenticated user. */ async list( request: operations.ListBatchesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmBatchesList( this, request, options, )); } /** * Get a batch * * @remarks * Retrieves a batch by its ID. */ async get( request: operations.GetBatchRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmBatchesGet( this, request, options, )); } /** * Cancel a batch * * @remarks * Cancels an in-progress batch. The batch status changes to cancelling, and remaining requests will not be processed. */ async cancel( request: operations.CancelBatchRequest, options?: RequestOptions, ): Promise { return unwrapAsync(llmBatchesCancel( this, request, options, )); } }