UNPKG

replicate-api

Version:

A typed client library for the replicate.com API

31 lines (30 loc) 1.13 kB
import { ReplicateRequestOptions } from "./helpers/makeApiRequest"; import { PagedRequestOptions } from "./listPredictions"; import { ModelNameOptions } from "./predict"; /** Options for `listVersions` */ export type ListVersionsOptions = PagedRequestOptions & ModelNameOptions & ReplicateRequestOptions; export type ModelVersion = { id: string; createdAt: Date; cogVersion: string; schema: unknown; }; export type ListOfVersions = { /** The id of the latest version */ version: string | undefined; /** Up to 100 versions */ versions: ModelVersion[]; /** Get the next versions */ next: () => Promise<ListOfVersions>; /** Cursor to get the next versions manually. You should probably use the `.next()` method instead */ nextCursor?: string; }; /** List all versions that are availabe for a model * ```typescript * const {versions, version} = await listVersions({ * model: "stability-ai/stable-diffusion", * token: "Get your token at https://replicate.com/account" * }) * ``` */ export declare const listVersions: (options: ListVersionsOptions) => Promise<ListOfVersions>;