/** * Batch Processing Types and Interfaces */ export declare enum BatchStatus { PENDING = "pending", VALIDATING = "validating", IN_PROGRESS = "in_progress", FINALIZING = "finalizing", COMPLETED = "completed", FAILED = "failed", CANCELLED = "cancelled", EXPIRED = "expired" } export declare enum BatchPriority { LOW = "low", NORMAL = "normal", HIGH = "high", URGENT = "urgent" } export interface ChatMessage { role: string; content: string; } export type RequestParamValue = string | number | boolean | null | string[] | number[] | boolean[] | ChatMessage[] | Record; export interface BatchRequestParams { messages?: ChatMessage[]; prompt?: string; maxTokens?: number; temperature?: number; topP?: number; frequencyPenalty?: number; presencePenalty?: number; stop?: string | string[]; [key: string]: RequestParamValue | undefined; } export interface BatchRequest { /** Unique request ID */ customId: string; /** Model to use */ model?: string; /** Request parameters */ params: BatchRequestParams; /** Request metadata */ metadata?: Record; } export interface BatchResponseMetadata { [key: string]: string | number | boolean; } export interface BatchErrorDetails { [key: string]: string | number | boolean | null; } export interface BatchRequestResult { /** Custom ID from request */ customId: string; /** Status of this request */ status: 'completed' | 'failed'; /** Response data (if successful) */ response?: { id: string; model: string; content: string; tokens: { prompt: number; completion: number; total: number; }; finishReason?: string; metadata?: BatchResponseMetadata; }; /** Error information (if failed) */ error?: { code: string; message: string; details?: BatchErrorDetails; }; /** Processing time (ms) */ processingTimeMs?: number; } export interface BatchJob { /** Batch job ID */ id: string; /** Job name/description */ name?: string; /** Current status */ status: BatchStatus; /** Priority level */ priority: BatchPriority; /** Total requests in batch */ totalRequests: number; /** Completed requests */ completedRequests: number; /** Failed requests */ failedRequests: number; /** Pending requests */ pendingRequests: number; /** Input file URI */ inputFileUri?: string; /** Output file URI */ outputFileUri?: string; /** Error file URI */ errorFileUri?: string; /** Default model for requests */ defaultModel?: string; /** Processing configuration */ config: BatchConfig; /** Job statistics */ stats?: BatchStats; /** Error information */ error?: { message: string; code?: string; }; /** Created timestamp */ createdAt: Date; /** Started timestamp */ startedAt?: Date; /** Completed timestamp */ completedAt?: Date; /** Expires at */ expiresAt?: Date; /** Creator user ID */ createdBy: string; /** Project ID */ projectId: string; /** Estimated cost */ estimatedCost?: number; /** Actual cost */ actualCost?: number; /** Progress percentage (0-100) */ progress?: number; } export interface AggregationResult { content: string; tokens?: number; metadata?: Record; } export interface BatchConfig { /** Max concurrent requests */ maxConcurrency?: number; /** Retry failed requests */ retryFailed?: boolean; /** Max retries per request */ maxRetries?: number; /** Timeout per request (ms) */ requestTimeout?: number; /** Batch timeout (ms) */ batchTimeout?: number; /** Callback URL for completion */ callbackUrl?: string; /** Enable result streaming */ streamResults?: boolean; /** Aggregation strategy */ aggregation?: 'none' | 'concatenate' | 'summarize' | 'custom'; /** Custom aggregation function */ aggregationFn?: (results: BatchRequestResult[]) => AggregationResult; } export interface BatchStats { /** Total tokens used */ totalTokens: number; /** Prompt tokens */ promptTokens: number; /** Completion tokens */ completionTokens: number; /** Average latency per request (ms) */ avgLatency: number; /** Min latency (ms) */ minLatency: number; /** Max latency (ms) */ maxLatency: number; /** Success rate (0-1) */ successRate: number; /** Total processing time (ms) */ totalProcessingTime: number; /** Requests per second */ requestsPerSecond?: number; } export interface BatchJobCreate { /** Job name */ name?: string; /** Input requests */ requests: BatchRequest[]; /** Default model */ defaultModel?: string; /** Priority */ priority?: BatchPriority; /** Configuration */ config?: BatchConfig; /** Project ID */ projectId: string; /** Creator user ID */ createdBy: string; /** Expiration (hours) */ expiresInHours?: number; } export interface BatchJobFilter { /** Filter by project */ projectId?: string; /** Filter by status */ status?: BatchStatus[]; /** Filter by priority */ priority?: BatchPriority[]; /** Filter by creator */ createdBy?: string; /** Created after */ createdAfter?: Date; /** Created before */ createdBefore?: Date; /** Include expired */ includeExpired?: boolean; } export interface BatchProgress { /** Job ID */ jobId: string; /** Current status */ status: BatchStatus; /** Progress percentage */ progress: number; /** Completed count */ completed: number; /** Failed count */ failed: number; /** Pending count */ pending: number; /** Total count */ total: number; /** Estimated time remaining (seconds) */ estimatedTimeRemaining?: number; /** Current throughput (requests/sec) */ throughput?: number; } export interface BatchAggregation { /** Aggregation type */ type: 'concatenate' | 'summarize' | 'custom'; /** Aggregated result */ result: AggregationResult; /** Source request count */ sourceCount: number; /** Tokens used in aggregation */ tokensUsed?: number; /** Aggregation metadata */ metadata?: Record; } //# sourceMappingURL=types.d.ts.map