import type { BatchJobRef, BatchJobState, BatchJobStatus, BatchProviderCallContext } from '../types/batch.js'; import type { EmbeddingProviderMediaPart } from '../types/embeddings.js'; import type { EmbeddingBatchOutputItem, EmbeddingBatchProvider, EmbeddingBatchProviderCapabilities, EmbeddingBatchProviderInfo, EmbeddingBatchProviderRequest } from './batch.js'; /** Options for the mock embedding batch tier. */ export interface MockEmbeddingBatchProviderOptions { /** Its name, which its refs carry. Defaults to `mock`. */ name?: string; /** Capabilities reported, merged over the defaults. */ capabilities?: Partial; /** * Statuses successive polls of a batch return; the last repeats, so `['in_progress', 'completed']` * finishes on the second poll. Defaults to completing at once. */ statuses?: readonly BatchJobStatus[]; /** customIds that come back as errors instead of vectors. */ failItems?: readonly string[]; /** Vector width when the request sets none. Defaults to 16. */ dimensions?: number; /** Reports input tokens per item, a word count. Defaults to true; false leaves the cost to be estimated. */ reportTokens?: boolean; /** The text a media part's vector is hashed from, as `MockEmbeddingProviderOptions.describeMedia`. */ describeMedia?: (part: EmbeddingProviderMediaPart) => string; } /** * A deterministic embedding batch tier, in memory. Each input's vector is the one * `MockEmbeddingProvider` returns for it, so a test can compare the batch path with the direct one. It * keeps every batch it was given in `submitted`. */ export declare class MockEmbeddingBatchProvider implements EmbeddingBatchProvider { private readonly options; /** Its name and capabilities. */ readonly info: EmbeddingBatchProviderInfo; /** Every batch submitted, in order. */ readonly submitted: EmbeddingBatchProviderRequest[]; private readonly batches; constructor(options?: MockEmbeddingBatchProviderOptions); /** Accepts a batch and returns its ref. */ submit(request: EmbeddingBatchProviderRequest, context: BatchProviderCallContext): Promise; /** The next scripted status. */ poll(ref: BatchJobRef): Promise; /** Every input's vector, or its scripted failure. */ results(ref: BatchJobRef): Promise; /** Cancels a batch: its next poll reports `cancelled`. */ cancel(ref: BatchJobRef): Promise; }