import { CancelAction, DefaultValues, Run, RunSelectField, RunStatus, ThreadState } from "../../schema.js"; import { StreamMode, TypedAsyncGenerator } from "../../types.stream.js"; import { RunsCreatePayload, RunsStreamPayload, RunsWaitPayload, StreamEvent } from "../../types.js"; import { BaseClient } from "../base.js"; //#region src/client/runs/index.d.ts declare class RunsClient extends BaseClient { stream(threadId: null, assistantId: string, payload?: Omit, "multitaskStrategy" | "onCompletion">): TypedAsyncGenerator; stream(threadId: string, assistantId: string, payload?: RunsStreamPayload): TypedAsyncGenerator; /** * Create a run. * * @param threadId The ID of the thread. * @param assistantId Assistant ID to use for this run. * @param payload Payload for creating a run. * @returns The created run. */ create(threadId: string | null, assistantId: string, payload?: RunsCreatePayload): Promise; /** * Create a batch of stateless background runs. * * @param payloads An array of payloads for creating runs. * @returns An array of created runs. */ createBatch(payloads: (Omit & { assistantId: string; })[], options?: { signal?: AbortSignal; }): Promise; wait(threadId: null, assistantId: string, payload?: Omit): Promise; wait(threadId: string, assistantId: string, payload?: RunsWaitPayload): Promise; /** * List all runs for a thread. * * @param threadId The ID of the thread. * @param options Filtering and pagination options. * @returns List of runs. */ list(threadId: string, options?: { limit?: number; offset?: number; status?: RunStatus; select?: RunSelectField[]; signal?: AbortSignal; }): Promise; /** * Get a run by ID. * * @param threadId The ID of the thread. * @param runId The ID of the run. * @returns The run. */ get(threadId: string, runId: string, options?: { signal?: AbortSignal; }): Promise; /** * Cancel a run. * * @param threadId The ID of the thread. * @param runId The ID of the run. * @param wait Whether to block when canceling * @param action Action to take when cancelling the run. Possible values are `interrupt` or `rollback`. Default is `interrupt`. * @returns */ cancel(threadId: string, runId: string, wait?: boolean, action?: CancelAction, options?: { signal?: AbortSignal; }): Promise; /** * Cancel one or more runs. * * @param options Options for cancelling runs. * @returns */ cancelMany(options: { threadId?: string; runIds?: string[]; status?: "pending" | "running" | "all"; action?: CancelAction; signal?: AbortSignal; }): Promise; /** * Block until a run is done. * * @param threadId The ID of the thread. * @param runId The ID of the run. * @returns */ join(threadId: string, runId: string, options?: { cancelOnDisconnect?: boolean; signal?: AbortSignal; }): Promise; /** * Stream output from a run in real-time, until the run is done. * * @param threadId The ID of the thread. * @param runId The ID of the run. * @param options Additional options for controlling the stream behavior. * @returns An async generator yielding stream parts. */ joinStream(threadId: string | undefined | null, runId: string, options?: { signal?: AbortSignal; cancelOnDisconnect?: boolean; lastEventId?: string; streamMode?: StreamMode | StreamMode[]; } | AbortSignal): AsyncGenerator<{ id?: string; event: StreamEvent; data: any; }>; /** * Delete a run. * * @param threadId The ID of the thread. * @param runId The ID of the run. * @returns */ delete(threadId: string, runId: string, options?: { signal?: AbortSignal; }): Promise; } //#endregion export { RunsClient }; //# sourceMappingURL=index.d.ts.map