// File generated from our OpenAPI spec by Stainless.

import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as AIAPI from 'cloudflare/resources/ai';

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.
   */
  run(
    accountId: string,
    modelName: string,
    body: AIRunParams,
    options?: Core.RequestOptions,
  ): Core.APIPromise<AIRunResponse> {
    return (
      this._client.post(`/accounts/${accountId}/ai/run/${modelName}`, {
        body,
        ...options,
      }) as Core.APIPromise<{ result: AIRunResponse }>
    )._thenUnwrap((obj) => obj.result);
  }
}

export type AIRunResponse = unknown;

export type AIRunParams = unknown;

export namespace AI {
  export import AIRunResponse = AIAPI.AIRunResponse;
  export import AIRunParams = AIAPI.AIRunParams;
}
