cloudflare/cloudflare-typescript
Publicmirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable
src/resources/ai/tasks.ts
40lines · modecode
| 1 | // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | |
| 3 | import { APIResource } from '../../resource'; |
| 4 | import * as Core from '../../core'; |
| 5 | import { SinglePage } from '../../pagination'; |
| 6 | |
| 7 | export class Tasks extends APIResource { |
| 8 | /** |
| 9 | * Searches Workers AI models by task type (e.g., text-generation, embeddings). |
| 10 | */ |
| 11 | list( |
| 12 | params: TaskListParams, |
| 13 | options?: Core.RequestOptions, |
| 14 | ): Core.PagePromise<TaskListResponsesSinglePage, TaskListResponse> { |
| 15 | const { account_id } = params; |
| 16 | return this._client.getAPIList( |
| 17 | `/accounts/${account_id}/ai/tasks/search`, |
| 18 | TaskListResponsesSinglePage, |
| 19 | options, |
| 20 | ); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | export class TaskListResponsesSinglePage extends SinglePage<TaskListResponse> {} |
| 25 | |
| 26 | export type TaskListResponse = unknown; |
| 27 | |
| 28 | export interface TaskListParams { |
| 29 | account_id: string; |
| 30 | } |
| 31 | |
| 32 | Tasks.TaskListResponsesSinglePage = TaskListResponsesSinglePage; |
| 33 | |
| 34 | export declare namespace Tasks { |
| 35 | export { |
| 36 | type TaskListResponse as TaskListResponse, |
| 37 | TaskListResponsesSinglePage as TaskListResponsesSinglePage, |
| 38 | type TaskListParams as TaskListParams, |
| 39 | }; |
| 40 | } |
| 41 | |