UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

29 lines 1.15 kB
"use strict"; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. Object.defineProperty(exports, "__esModule", { value: true }); exports.AI = void 0; const resource_1 = require("cloudflare/resource"); class AI extends resource_1.APIResource { /** * This endpoint provides users with the capability to run specific AI models * on-demand. * * By submitting the required input data, users can receive real-time predictions * or results generated by the chosen AI model. The endpoint supports various AI * model types, ensuring flexibility and adaptability for diverse use cases. * * Model specific inputs available in * [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). */ run(modelName, params, options) { const { account_id, ...body } = params; return this._client.post(`/accounts/${account_id}/ai/run/${modelName}`, { body, ...options, })._thenUnwrap((obj) => obj.result); } } exports.AI = AI; (function (AI) { })(AI = exports.AI || (exports.AI = {})); //# sourceMappingURL=ai.js.map