import { APIResource } from "../../../core/resource.js"; import * as TasksAPI from "./tasks.js"; import { APIPromise } from "../../../core/api-promise.js"; import { RequestOptions } from "../../../internal/request-options.js"; export declare class Tasks extends APIResource { /** * List async message tasks with filtering and pagination */ list(params?: TaskListParams | null | undefined, options?: RequestOptions): APIPromise; /** * Cancel an ongoing async message task */ delete(taskID: string, params?: TaskDeleteParams | null | undefined, options?: RequestOptions): APIPromise; } /** * Task status enumeration. */ export type TaskStatus = 'pending' | 'processing' | 'completed' | 'failed' | 'cancelled'; /** * Response model for task list. */ export interface TaskListResponse { tasks: Array; tasks_count: number; cursor?: string | null; } export declare namespace TaskListResponse { /** * Response model for a single task in list. */ interface Task { assistant_message_id: string; created_at: string; /** * Task status enumeration. */ status: TasksAPI.TaskStatus; task_id: string; updated_at: string; user_message_id: string; cancelled_at?: string | null; chatbot_id?: string | null; completed_at?: string | null; conversation_id?: string | null; /** * Task metadata, e.g. is_regenerated, regenerated_message_id. */ metadata?: { [key: string]: unknown; }; } } /** * Response model for task cancellation. */ export interface TaskDeleteResponse { cancelled_at: string; task_id: string; /** * Task status enumeration. */ status?: TaskStatus; } export interface TaskListParams { /** * Query param: Filter by chatbot ID */ chatbot_id?: string | null; /** * Query param: Filter by conversation ID */ conversation_id?: string | null; /** * Query param: Pagination cursor (ISO 8601 datetime string) */ cursor?: string | null; /** * Query param: Number of tasks per page (max 100) */ limit?: number | null; /** * Query param: Filter by task status(es) */ status?: Array | null; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export interface TaskDeleteParams { 'Accept-Language'?: string; /** * Set to `structured` to receive errors in the structured envelope. Omit it to * keep the legacy error body. */ 'X-Error-Format'?: string; } export declare namespace Tasks { export { type TaskStatus as TaskStatus, type TaskListResponse as TaskListResponse, type TaskDeleteResponse as TaskDeleteResponse, type TaskListParams as TaskListParams, type TaskDeleteParams as TaskDeleteParams, }; } //# sourceMappingURL=tasks.d.ts.map