cloudflare
Version:
The official TypeScript library for the Cloudflare API
25 lines • 1.01 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
export class AI extends 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);
}
}
(function (AI) {
})(AI || (AI = {}));
//# sourceMappingURL=ai.mjs.map