import { APIResource } from "../../core/resource.js"; import { APIPromise } from "../../core/api-promise.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class Versions extends APIResource { /** * Example cURL request: * * ```console * curl -s \ * -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ * https://api.replicate.com/v1/models/replicate/hello-world/versions * ``` * * The response will be a JSON array of model version objects, sorted with the most * recent version first: * * ```json * { * "next": null, * "previous": null, * "results": [ * { * "id": "5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa", * "created_at": "2022-04-26T19:29:04.418669Z", * "cog_version": "0.3.0", * "openapi_schema": {...} * } * ] * } * ``` * * @example * ```ts * await replicate.models.versions.list({ * model_owner: 'model_owner', * model_name: 'model_name', * }); * ``` */ list(params: VersionListParams, options?: RequestOptions): APIPromise; /** * Delete a model version and all associated predictions, including all output * files. * * Model version deletion has some restrictions: * * - You can only delete versions from models you own. * - You can only delete versions from private models. * - You cannot delete a version if someone other than you has run predictions with * it. * - You cannot delete a version if it is being used as the base model for a fine * tune/training. * - You cannot delete a version if it has an associated deployment. * - You cannot delete a version if another model version is overridden to use it. * * Example cURL request: * * ```command * curl -s -X DELETE \ * -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ * https://api.replicate.com/v1/models/replicate/hello-world/versions/5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa * ``` * * The response will be an empty 202, indicating the deletion request has been * accepted. It might take a few minutes to be processed. * * @example * ```ts * await replicate.models.versions.delete({ * model_owner: 'model_owner', * model_name: 'model_name', * version_id: 'version_id', * }); * ``` */ delete(params: VersionDeleteParams, options?: RequestOptions): APIPromise; /** * Example cURL request: * * ```console * curl -s \ * -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ * https://api.replicate.com/v1/models/replicate/hello-world/versions/5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa * ``` * * The response will be the version object: * * ```json * { * "id": "5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa", * "created_at": "2022-04-26T19:29:04.418669Z", * "cog_version": "0.3.0", * "openapi_schema": {...} * } * ``` * * Every model describes its inputs and outputs with * [OpenAPI Schema Objects](https://spec.openapis.org/oas/latest.html#schemaObject) * in the `openapi_schema` property. * * The `openapi_schema.components.schemas.Input` property for the * [replicate/hello-world](https://replicate.com/replicate/hello-world) model looks * like this: * * ```json * { * "type": "object", * "title": "Input", * "required": ["text"], * "properties": { * "text": { * "x-order": 0, * "type": "string", * "title": "Text", * "description": "Text to prefix with 'hello '" * } * } * } * ``` * * The `openapi_schema.components.schemas.Output` property for the * [replicate/hello-world](https://replicate.com/replicate/hello-world) model looks * like this: * * ```json * { * "type": "string", * "title": "Output" * } * ``` * * For more details, see the docs on * [Cog's supported input and output types](https://github.com/replicate/cog/blob/75b7802219e7cd4cee845e34c4c22139558615d4/docs/python.md#input-and-output-types) * * @example * ```ts * await replicate.models.versions.get({ * model_owner: 'model_owner', * model_name: 'model_name', * version_id: 'version_id', * }); * ``` */ get(params: VersionGetParams, options?: RequestOptions): APIPromise; } export interface VersionListParams { /** * The name of the user or organization that owns the model. */ model_owner: string; /** * The name of the model. */ model_name: string; } export interface VersionDeleteParams { /** * The name of the user or organization that owns the model. */ model_owner: string; /** * The name of the model. */ model_name: string; /** * The ID of the version. */ version_id: string; } export interface VersionGetParams { /** * The name of the user or organization that owns the model. */ model_owner: string; /** * The name of the model. */ model_name: string; /** * The ID of the version. */ version_id: string; } export declare namespace Versions { export { type VersionListParams as VersionListParams, type VersionDeleteParams as VersionDeleteParams, type VersionGetParams as VersionGetParams, }; } //# sourceMappingURL=versions.d.ts.map