import type { BatchJobRef, BatchJobState, BatchOutputItem, BatchProvider, BatchProviderCallContext, BatchProviderInfo, BatchSubmitRequest } from '../types/batch.js'; import { type OpenAIBatchClientOptions } from './openai-client.js'; /** Options for the OpenAI batch provider. */ export interface OpenAIBatchProviderOptions extends OpenAIBatchClientOptions { /** * Endpoint every item targets. Defaults to chat completions. Embeddings are batched by * `OpenAIEmbeddingBatchProvider`, on `nexus-ai-pro/embeddings/batch/openai`; this adapter refuses * `/v1/embeddings`, since its items are completions. */ endpoint?: '/v1/chat/completions' | '/v1/embeddings' | (string & {}); } /** * OpenAI's Batch API: half price, 24-hour window. * * The wire protocol is a JSONL upload, a batch pointing at it, then JSONL downloads of what succeeded * and what failed — three different content types across four endpoints, which is why this adapter * is larger than a synchronous one. */ export declare class OpenAIBatchProvider implements BatchProvider { private readonly options; /** Always `openai`, with its batch limits. */ readonly info: BatchProviderInfo; private readonly client; constructor(options: OpenAIBatchProviderOptions); /** Uploads the items as JSONL and creates a batch over them. */ submit(request: BatchSubmitRequest, context: BatchProviderCallContext): Promise; /** Reads a batch's status and counts. */ poll(ref: BatchJobRef, context: BatchProviderCallContext): Promise; /** Downloads a finished batch's results: what succeeded and what failed. Empty until they exist. */ results(ref: BatchJobRef, context: BatchProviderCallContext): Promise; /** Cancels a batch. Items already processed keep their results. */ cancel(ref: BatchJobRef, context: BatchProviderCallContext): Promise; }