import { ReplicateRequestOptions } from "./helpers/makeApiRequest"; /** Option for the model name; e.g. `stability-ai/stable-diffusion` */ export type ModelNameOptions = { /** The name of the model; e.g. `stability-ai/stable-diffusion` */ model: string; }; /** Option for the model version */ export type ModelVersionOptions = { /** The ID of the model version that you want to run. */ version: string; }; /** Select which events trigger webhook request * * - `"start"`: immediately on prediction start * - `"output"`: each time a prediction generates an output (note that predictions can generate multiple outputs) * - `"logs"`: each time log output is generated by a prediction * - `"completed"`: when the prediction reaches a terminal state (succeeded/canceled/failed) * * See https://replicate.com/docs/reference/http#create-prediction--webhook_events_filter for more information. */ export type WebhookEventType = "start" | "output" | "logs" | "completed"; /** Options for creating a new prediction */ export type PredictOptions = { /** The model's input as a JSON object. This differs for each model */ input: Record; /** Set to true to poll until the prediction is completed */ poll?: boolean; /** A webhook that is called when the prediction has completed. */ webhook?: string; /** Select which events trigger webhook request * * @default ["completed"] */ webhookEvents?: WebhookEventType[]; } & (ModelVersionOptions | ModelNameOptions) & ReplicateRequestOptions; /** Create a new prediction * * ```typescript * const result = await predict({ * model: "stability-ai/stable-diffusion", * input: { prompt: "multicolor hyperspace" }, * token: "Get your token at https://replicate.com/account", * poll: true, * }) * ``` * * Then you can check `result.status` to see if it's `"starting"`, `"processing"` or `succeeded`. If it's `"succeeded"` you can get the outputs with `result.outputs`. If not you can check back later with `getPrediction` and the id from result (`result.id`). * * If you set the `poll` option this function will return a promise that waits until the prediction is completed. */ export declare const predict: (options: PredictOptions) => Promise;