/** * Extended ClassifyRuns client with polling utilities. * * @example * ```typescript * import { ExtendClient } from "extend-ai"; * * const client = new ExtendClient({ token: "..." }); * * // Create and poll until completion * const result = await client.classifyRuns.createAndPoll({ * file: { url: "https://example.com/document.pdf" }, * classifier: { id: "classifier_abc123" }, * }); * * if (result.status === "PROCESSED") { * console.log(result.output); * } * ``` */ import { ClassifyRunsClient as GeneratedClassifyRunsClient } from "../../../api/resources/classifyRuns/client/Client"; import * as Extend from "../../../api"; import { PollingOptions, PollingTimeoutError } from "../../utilities/polling"; export { PollingTimeoutError }; export interface CreateAndPollOptions extends PollingOptions { /** * Request options passed to both create and retrieve calls. */ requestOptions?: GeneratedClassifyRunsClient.RequestOptions; } export declare class ClassifyRunsClient extends GeneratedClassifyRunsClient { /** * Creates a classify run and polls until it reaches a terminal state. * * This is a convenience method that combines `create()` and polling via * `retrieve()` with exponential backoff and jitter. * * Terminal states: PROCESSED, FAILED, CANCELLED * * @param request - The classify run creation request * @param options - Polling and request options * @returns The final classify run when processing is complete * @throws {PollingTimeoutError} If the run doesn't complete within maxWaitMs * * @example * ```typescript * const result = await client.classifyRuns.createAndPoll({ * file: { url: "https://example.com/doc.pdf" }, * classifier: { id: "classifier_abc123" }, * }); * * if (result.status === "PROCESSED") { * console.log(result.output); * } * ``` */ createAndPoll(request: Extend.ClassifyRunsCreateRequest, options?: CreateAndPollOptions): Promise; }