@cloudflare/workers-types 4.20250913.0 → 4.20250918.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -301,13 +301,6 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
301
301
  FixedLengthStream: typeof FixedLengthStream;
302
302
  IdentityTransformStream: typeof IdentityTransformStream;
303
303
  HTMLRewriter: typeof HTMLRewriter;
304
- Performance: typeof Performance;
305
- PerformanceEntry: typeof PerformanceEntry;
306
- PerformanceMark: typeof PerformanceMark;
307
- PerformanceMeasure: typeof PerformanceMeasure;
308
- PerformanceResourceTiming: typeof PerformanceResourceTiming;
309
- PerformanceObserver: typeof PerformanceObserver;
310
- PerformanceObserverEntryList: typeof PerformanceObserverEntryList;
311
304
  }
312
305
  export declare function addEventListener<
313
306
  Type extends keyof WorkerGlobalScopeEventMap,
@@ -490,6 +483,18 @@ export declare abstract class Navigator {
490
483
  readonly languages: string[];
491
484
  readonly storage: StorageManager;
492
485
  }
486
+ /**
487
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
488
+ * as well as timing of subrequests and other operations.
489
+ *
490
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
491
+ */
492
+ export interface Performance {
493
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
494
+ readonly timeOrigin: number;
495
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
496
+ now(): number;
497
+ }
493
498
  export interface AlarmInvocationInfo {
494
499
  readonly isRetry: boolean;
495
500
  readonly retryCount: number;
@@ -3434,174 +3439,6 @@ export interface WorkerLoaderWorkerCode {
3434
3439
  tails?: Fetcher[];
3435
3440
  streamingTails?: Fetcher[];
3436
3441
  }
3437
- /**
3438
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3439
- * as well as timing of subrequests and other operations.
3440
- *
3441
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3442
- */
3443
- export declare abstract class Performance extends EventTarget {
3444
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3445
- get timeOrigin(): number;
3446
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3447
- now(): number;
3448
- get eventCounts(): EventCounts;
3449
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMarks) */
3450
- clearMarks(name?: string): void;
3451
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures) */
3452
- clearMeasures(name?: string): void;
3453
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearResourceTimings) */
3454
- clearResourceTimings(): void;
3455
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntries) */
3456
- getEntries(): PerformanceEntry[];
3457
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName) */
3458
- getEntriesByName(name: string, type?: string): PerformanceEntry[];
3459
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType) */
3460
- getEntriesByType(type: string): PerformanceEntry[];
3461
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/mark) */
3462
- mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
3463
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/measure) */
3464
- measure(
3465
- measureName: string,
3466
- measureOptionsOrStartMark: PerformanceMeasureOptions | string,
3467
- maybeEndMark?: string,
3468
- ): PerformanceMeasure;
3469
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize) */
3470
- setResourceTimingBufferSize(size: number): void;
3471
- eventLoopUtilization(): void;
3472
- markResourceTiming(): void;
3473
- timerify(fn: () => void): () => void;
3474
- }
3475
- /**
3476
- * PerformanceMark is an abstract interface for PerformanceEntry objects with an entryType of "mark". Entries of this type are created by calling performance.mark() to add a named DOMHighResTimeStamp (the mark) to the browser's performance timeline.
3477
- *
3478
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark)
3479
- */
3480
- export declare class PerformanceMark extends PerformanceEntry {
3481
- constructor(name: string, maybeOptions?: PerformanceMarkOptions);
3482
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail) */
3483
- get detail(): any | undefined;
3484
- toJSON(): any;
3485
- }
3486
- /**
3487
- * PerformanceMeasure is an abstract interface for PerformanceEntry objects with an entryType of "measure". Entries of this type are created by calling performance.measure() to add a named DOMHighResTimeStamp (the measure) between two marks to the browser's performance timeline.
3488
- *
3489
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure)
3490
- */
3491
- export declare abstract class PerformanceMeasure extends PerformanceEntry {
3492
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure/detail) */
3493
- get detail(): any | undefined;
3494
- toJSON(): any;
3495
- }
3496
- export interface PerformanceMarkOptions {
3497
- detail?: any;
3498
- startTime?: number;
3499
- }
3500
- export interface PerformanceMeasureOptions {
3501
- detail?: any;
3502
- start?: number;
3503
- duration?: number;
3504
- end?: number;
3505
- }
3506
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList) */
3507
- export declare abstract class PerformanceObserverEntryList {
3508
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntries) */
3509
- getEntries(): PerformanceEntry[];
3510
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByType) */
3511
- getEntriesByType(type: string): PerformanceEntry[];
3512
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByName) */
3513
- getEntriesByName(name: string, type?: string): PerformanceEntry[];
3514
- }
3515
- /**
3516
- * Encapsulates a single performance metric that is part of the performance timeline. A performance entry can be directly created by making a performance mark or measure (for example by calling the mark() method) at an explicit point in an application. Performance entries are also created in indirect ways such as loading a resource (such as an image).
3517
- *
3518
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry)
3519
- */
3520
- export declare abstract class PerformanceEntry {
3521
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/name) */
3522
- get name(): string;
3523
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/entryType) */
3524
- get entryType(): string;
3525
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/startTime) */
3526
- get startTime(): number;
3527
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/duration) */
3528
- get duration(): number;
3529
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/toJSON) */
3530
- toJSON(): any;
3531
- }
3532
- /**
3533
- * Enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources. An application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource, such as an XMLHttpRequest, <SVG>, image, or script.
3534
- *
3535
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming)
3536
- */
3537
- export declare abstract class PerformanceResourceTiming extends PerformanceEntry {
3538
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectEnd) */
3539
- get connectEnd(): number;
3540
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectStart) */
3541
- get connectStart(): number;
3542
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/decodedBodySize) */
3543
- get decodedBodySize(): number;
3544
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupEnd) */
3545
- get domainLookupEnd(): number;
3546
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupStart) */
3547
- get domainLookupStart(): number;
3548
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/encodedBodySize) */
3549
- get encodedBodySize(): number;
3550
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/fetchStart) */
3551
- get fetchStart(): number;
3552
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/initiatorType) */
3553
- get initiatorType(): string;
3554
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/nextHopProtocol) */
3555
- get nextHopProtocol(): string;
3556
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectEnd) */
3557
- get redirectEnd(): number;
3558
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectStart) */
3559
- get redirectStart(): number;
3560
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/requestStart) */
3561
- get requestStart(): number;
3562
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseEnd) */
3563
- get responseEnd(): number;
3564
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStart) */
3565
- get responseStart(): number;
3566
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStatus) */
3567
- get responseStatus(): number;
3568
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/secureConnectionStart) */
3569
- get secureConnectionStart(): number | undefined;
3570
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/transferSize) */
3571
- get transferSize(): number;
3572
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/workerStart) */
3573
- get workerStart(): number;
3574
- }
3575
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver) */
3576
- export declare class PerformanceObserver {
3577
- constructor(callback: any);
3578
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/disconnect) */
3579
- disconnect(): void;
3580
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/observe) */
3581
- observe(options?: PerformanceObserverObserveOptions): void;
3582
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/takeRecords) */
3583
- takeRecords(): PerformanceEntry[];
3584
- readonly supportedEntryTypes: string[];
3585
- }
3586
- export interface PerformanceObserverObserveOptions {
3587
- buffered?: boolean;
3588
- durationThreshold?: number;
3589
- entryTypes?: string[];
3590
- type?: string;
3591
- }
3592
- export interface EventCounts {
3593
- get size(): number;
3594
- get(eventType: string): number | undefined;
3595
- has(eventType: string): boolean;
3596
- entries(): IterableIterator<string[]>;
3597
- keys(): IterableIterator<string>;
3598
- values(): IterableIterator<number>;
3599
- forEach(
3600
- param1: (param0: number, param1: string, param2: EventCounts) => void,
3601
- param2?: any,
3602
- ): void;
3603
- [Symbol.iterator](): IterableIterator<string[]>;
3604
- }
3605
3442
  export type AiImageClassificationInput = {
3606
3443
  image: number[];
3607
3444
  };
@@ -3656,6 +3493,18 @@ export declare abstract class BaseAiImageTextToText {
3656
3493
  inputs: AiImageTextToTextInput;
3657
3494
  postProcessedOutputs: AiImageTextToTextOutput;
3658
3495
  }
3496
+ export type AiMultimodalEmbeddingsInput = {
3497
+ image: string;
3498
+ text: string[];
3499
+ };
3500
+ export type AiIMultimodalEmbeddingsOutput = {
3501
+ data: number[][];
3502
+ shape: number[];
3503
+ };
3504
+ export declare abstract class BaseAiMultimodalEmbeddings {
3505
+ inputs: AiImageTextToTextInput;
3506
+ postProcessedOutputs: AiImageTextToTextOutput;
3507
+ }
3659
3508
  export type AiObjectDetectionInput = {
3660
3509
  image: number[];
3661
3510
  };
@@ -3794,12 +3643,28 @@ export type AiTextGenerationInput = {
3794
3643
  | (object & NonNullable<unknown>);
3795
3644
  functions?: AiTextGenerationFunctionsInput[];
3796
3645
  };
3646
+ export type AiTextGenerationToolLegacyOutput = {
3647
+ name: string;
3648
+ arguments: unknown;
3649
+ };
3650
+ export type AiTextGenerationToolOutput = {
3651
+ id: string;
3652
+ type: "function";
3653
+ function: {
3654
+ name: string;
3655
+ arguments: string;
3656
+ };
3657
+ };
3658
+ export type UsageTags = {
3659
+ prompt_tokens: number;
3660
+ completion_tokens: number;
3661
+ total_tokens: number;
3662
+ };
3797
3663
  export type AiTextGenerationOutput = {
3798
3664
  response?: string;
3799
- tool_calls?: {
3800
- name: string;
3801
- arguments: unknown;
3802
- }[];
3665
+ tool_calls?: AiTextGenerationToolLegacyOutput[] &
3666
+ AiTextGenerationToolOutput[];
3667
+ usage?: UsageTags;
3803
3668
  };
3804
3669
  export declare abstract class BaseAiTextGeneration {
3805
3670
  inputs: AiTextGenerationInput;
@@ -4888,6 +4753,7 @@ export type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output =
4888
4753
  name?: string;
4889
4754
  }[];
4890
4755
  }
4756
+ | string
4891
4757
  | AsyncResponse;
4892
4758
  export declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast {
4893
4759
  inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input;
@@ -4964,7 +4830,6 @@ export interface Ai_Cf_Baai_Bge_Reranker_Base_Input {
4964
4830
  /**
4965
4831
  * A query you wish to perform against the provided contexts.
4966
4832
  */
4967
- query: string;
4968
4833
  /**
4969
4834
  * Number of returned results starting with the best score.
4970
4835
  */
@@ -6059,7 +5924,8 @@ export declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It {
6059
5924
  }
6060
5925
  export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input =
6061
5926
  | Ai_Cf_Meta_Llama_4_Prompt
6062
- | Ai_Cf_Meta_Llama_4_Messages;
5927
+ | Ai_Cf_Meta_Llama_4_Messages
5928
+ | Ai_Cf_Meta_Llama_4_Async_Batch;
6063
5929
  export interface Ai_Cf_Meta_Llama_4_Prompt {
6064
5930
  /**
6065
5931
  * The input text prompt for the model to generate a response.
@@ -6293,130 +6159,816 @@ export interface Ai_Cf_Meta_Llama_4_Messages {
6293
6159
  */
6294
6160
  presence_penalty?: number;
6295
6161
  }
6296
- export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = {
6162
+ export interface Ai_Cf_Meta_Llama_4_Async_Batch {
6163
+ requests: (
6164
+ | Ai_Cf_Meta_Llama_4_Prompt_Inner
6165
+ | Ai_Cf_Meta_Llama_4_Messages_Inner
6166
+ )[];
6167
+ }
6168
+ export interface Ai_Cf_Meta_Llama_4_Prompt_Inner {
6297
6169
  /**
6298
- * The generated text response from the model
6170
+ * The input text prompt for the model to generate a response.
6299
6171
  */
6300
- response: string;
6172
+ prompt: string;
6301
6173
  /**
6302
- * Usage statistics for the inference request
6174
+ * JSON schema that should be fulfilled for the response.
6303
6175
  */
6304
- usage?: {
6305
- /**
6306
- * Total number of tokens in input
6307
- */
6308
- prompt_tokens?: number;
6309
- /**
6310
- * Total number of tokens in output
6311
- */
6312
- completion_tokens?: number;
6313
- /**
6314
- * Total number of input and output tokens
6315
- */
6316
- total_tokens?: number;
6317
- };
6176
+ guided_json?: object;
6177
+ response_format?: JSONMode;
6318
6178
  /**
6319
- * An array of tool calls requests made during the response generation
6179
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6320
6180
  */
6321
- tool_calls?: {
6322
- /**
6323
- * The tool call id.
6324
- */
6325
- id?: string;
6181
+ raw?: boolean;
6182
+ /**
6183
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6184
+ */
6185
+ stream?: boolean;
6186
+ /**
6187
+ * The maximum number of tokens to generate in the response.
6188
+ */
6189
+ max_tokens?: number;
6190
+ /**
6191
+ * Controls the randomness of the output; higher values produce more random results.
6192
+ */
6193
+ temperature?: number;
6194
+ /**
6195
+ * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
6196
+ */
6197
+ top_p?: number;
6198
+ /**
6199
+ * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
6200
+ */
6201
+ top_k?: number;
6202
+ /**
6203
+ * Random seed for reproducibility of the generation.
6204
+ */
6205
+ seed?: number;
6206
+ /**
6207
+ * Penalty for repeated tokens; higher values discourage repetition.
6208
+ */
6209
+ repetition_penalty?: number;
6210
+ /**
6211
+ * Decreases the likelihood of the model repeating the same lines verbatim.
6212
+ */
6213
+ frequency_penalty?: number;
6214
+ /**
6215
+ * Increases the likelihood of the model introducing new topics.
6216
+ */
6217
+ presence_penalty?: number;
6218
+ }
6219
+ export interface Ai_Cf_Meta_Llama_4_Messages_Inner {
6220
+ /**
6221
+ * An array of message objects representing the conversation history.
6222
+ */
6223
+ messages: {
6326
6224
  /**
6327
- * Specifies the type of tool (e.g., 'function').
6225
+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
6328
6226
  */
6329
- type?: string;
6227
+ role?: string;
6330
6228
  /**
6331
- * Details of the function tool.
6229
+ * The tool call id. If you don't know what to put here you can fall back to 000000001
6332
6230
  */
6333
- function?: {
6334
- /**
6335
- * The name of the tool to be called
6336
- */
6337
- name?: string;
6338
- /**
6339
- * The arguments passed to be passed to the tool call request
6340
- */
6341
- arguments?: object;
6342
- };
6231
+ tool_call_id?: string;
6232
+ content?:
6233
+ | string
6234
+ | {
6235
+ /**
6236
+ * Type of the content provided
6237
+ */
6238
+ type?: string;
6239
+ text?: string;
6240
+ image_url?: {
6241
+ /**
6242
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
6243
+ */
6244
+ url?: string;
6245
+ };
6246
+ }[]
6247
+ | {
6248
+ /**
6249
+ * Type of the content provided
6250
+ */
6251
+ type?: string;
6252
+ text?: string;
6253
+ image_url?: {
6254
+ /**
6255
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
6256
+ */
6257
+ url?: string;
6258
+ };
6259
+ };
6343
6260
  }[];
6344
- };
6345
- export declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {
6346
- inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;
6347
- postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;
6348
- }
6349
- export interface AiModels {
6350
- "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
6351
- "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
6352
- "@cf/runwayml/stable-diffusion-v1-5-inpainting": BaseAiTextToImage;
6353
- "@cf/runwayml/stable-diffusion-v1-5-img2img": BaseAiTextToImage;
6354
- "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
6355
- "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
6356
- "@cf/myshell-ai/melotts": BaseAiTextToSpeech;
6357
- "@cf/microsoft/resnet-50": BaseAiImageClassification;
6358
- "@cf/facebook/detr-resnet-50": BaseAiObjectDetection;
6359
- "@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
6360
- "@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
6361
- "@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
6362
- "@hf/thebloke/llama-2-13b-chat-awq": BaseAiTextGeneration;
6363
- "@hf/thebloke/mistral-7b-instruct-v0.1-awq": BaseAiTextGeneration;
6364
- "@hf/thebloke/zephyr-7b-beta-awq": BaseAiTextGeneration;
6365
- "@hf/thebloke/openhermes-2.5-mistral-7b-awq": BaseAiTextGeneration;
6366
- "@hf/thebloke/neural-chat-7b-v3-1-awq": BaseAiTextGeneration;
6367
- "@hf/thebloke/llamaguard-7b-awq": BaseAiTextGeneration;
6368
- "@hf/thebloke/deepseek-coder-6.7b-base-awq": BaseAiTextGeneration;
6369
- "@hf/thebloke/deepseek-coder-6.7b-instruct-awq": BaseAiTextGeneration;
6370
- "@cf/deepseek-ai/deepseek-math-7b-instruct": BaseAiTextGeneration;
6371
- "@cf/defog/sqlcoder-7b-2": BaseAiTextGeneration;
6372
- "@cf/openchat/openchat-3.5-0106": BaseAiTextGeneration;
6373
- "@cf/tiiuae/falcon-7b-instruct": BaseAiTextGeneration;
6374
- "@cf/thebloke/discolm-german-7b-v1-awq": BaseAiTextGeneration;
6375
- "@cf/qwen/qwen1.5-0.5b-chat": BaseAiTextGeneration;
6376
- "@cf/qwen/qwen1.5-7b-chat-awq": BaseAiTextGeneration;
6377
- "@cf/qwen/qwen1.5-14b-chat-awq": BaseAiTextGeneration;
6378
- "@cf/tinyllama/tinyllama-1.1b-chat-v1.0": BaseAiTextGeneration;
6379
- "@cf/microsoft/phi-2": BaseAiTextGeneration;
6380
- "@cf/qwen/qwen1.5-1.8b-chat": BaseAiTextGeneration;
6381
- "@cf/mistral/mistral-7b-instruct-v0.2-lora": BaseAiTextGeneration;
6382
- "@hf/nousresearch/hermes-2-pro-mistral-7b": BaseAiTextGeneration;
6383
- "@hf/nexusflow/starling-lm-7b-beta": BaseAiTextGeneration;
6384
- "@hf/google/gemma-7b-it": BaseAiTextGeneration;
6385
- "@cf/meta-llama/llama-2-7b-chat-hf-lora": BaseAiTextGeneration;
6386
- "@cf/google/gemma-2b-it-lora": BaseAiTextGeneration;
6387
- "@cf/google/gemma-7b-it-lora": BaseAiTextGeneration;
6388
- "@hf/mistral/mistral-7b-instruct-v0.2": BaseAiTextGeneration;
6389
- "@cf/meta/llama-3-8b-instruct": BaseAiTextGeneration;
6390
- "@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
6391
- "@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
6392
- "@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
6393
- "@cf/meta/llama-3.1-8b-instruct": BaseAiTextGeneration;
6394
- "@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
6395
- "@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
6396
- "@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
6397
- "@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;
6398
- "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": BaseAiTextGeneration;
6399
- "@cf/facebook/bart-large-cnn": BaseAiSummarization;
6400
- "@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;
6401
- "@cf/baai/bge-base-en-v1.5": Base_Ai_Cf_Baai_Bge_Base_En_V1_5;
6402
- "@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper;
6403
- "@cf/meta/m2m100-1.2b": Base_Ai_Cf_Meta_M2M100_1_2B;
6404
- "@cf/baai/bge-small-en-v1.5": Base_Ai_Cf_Baai_Bge_Small_En_V1_5;
6405
- "@cf/baai/bge-large-en-v1.5": Base_Ai_Cf_Baai_Bge_Large_En_V1_5;
6406
- "@cf/unum/uform-gen2-qwen-500m": Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M;
6407
- "@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
6408
- "@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
6409
- "@cf/baai/bge-m3": Base_Ai_Cf_Baai_Bge_M3;
6410
- "@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
6411
- "@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct;
6412
- "@cf/meta/llama-3.3-70b-instruct-fp8-fast": Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast;
6413
- "@cf/meta/llama-guard-3-8b": Base_Ai_Cf_Meta_Llama_Guard_3_8B;
6414
- "@cf/baai/bge-reranker-base": Base_Ai_Cf_Baai_Bge_Reranker_Base;
6261
+ functions?: {
6262
+ name: string;
6263
+ code: string;
6264
+ }[];
6265
+ /**
6266
+ * A list of tools available for the assistant to use.
6267
+ */
6268
+ tools?: (
6269
+ | {
6270
+ /**
6271
+ * The name of the tool. More descriptive the better.
6272
+ */
6273
+ name: string;
6274
+ /**
6275
+ * A brief description of what the tool does.
6276
+ */
6277
+ description: string;
6278
+ /**
6279
+ * Schema defining the parameters accepted by the tool.
6280
+ */
6281
+ parameters: {
6282
+ /**
6283
+ * The type of the parameters object (usually 'object').
6284
+ */
6285
+ type: string;
6286
+ /**
6287
+ * List of required parameter names.
6288
+ */
6289
+ required?: string[];
6290
+ /**
6291
+ * Definitions of each parameter.
6292
+ */
6293
+ properties: {
6294
+ [k: string]: {
6295
+ /**
6296
+ * The data type of the parameter.
6297
+ */
6298
+ type: string;
6299
+ /**
6300
+ * A description of the expected parameter.
6301
+ */
6302
+ description: string;
6303
+ };
6304
+ };
6305
+ };
6306
+ }
6307
+ | {
6308
+ /**
6309
+ * Specifies the type of tool (e.g., 'function').
6310
+ */
6311
+ type: string;
6312
+ /**
6313
+ * Details of the function tool.
6314
+ */
6315
+ function: {
6316
+ /**
6317
+ * The name of the function.
6318
+ */
6319
+ name: string;
6320
+ /**
6321
+ * A brief description of what the function does.
6322
+ */
6323
+ description: string;
6324
+ /**
6325
+ * Schema defining the parameters accepted by the function.
6326
+ */
6327
+ parameters: {
6328
+ /**
6329
+ * The type of the parameters object (usually 'object').
6330
+ */
6331
+ type: string;
6332
+ /**
6333
+ * List of required parameter names.
6334
+ */
6335
+ required?: string[];
6336
+ /**
6337
+ * Definitions of each parameter.
6338
+ */
6339
+ properties: {
6340
+ [k: string]: {
6341
+ /**
6342
+ * The data type of the parameter.
6343
+ */
6344
+ type: string;
6345
+ /**
6346
+ * A description of the expected parameter.
6347
+ */
6348
+ description: string;
6349
+ };
6350
+ };
6351
+ };
6352
+ };
6353
+ }
6354
+ )[];
6355
+ response_format?: JSONMode;
6356
+ /**
6357
+ * JSON schema that should be fufilled for the response.
6358
+ */
6359
+ guided_json?: object;
6360
+ /**
6361
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6362
+ */
6363
+ raw?: boolean;
6364
+ /**
6365
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6366
+ */
6367
+ stream?: boolean;
6368
+ /**
6369
+ * The maximum number of tokens to generate in the response.
6370
+ */
6371
+ max_tokens?: number;
6372
+ /**
6373
+ * Controls the randomness of the output; higher values produce more random results.
6374
+ */
6375
+ temperature?: number;
6376
+ /**
6377
+ * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
6378
+ */
6379
+ top_p?: number;
6380
+ /**
6381
+ * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
6382
+ */
6383
+ top_k?: number;
6384
+ /**
6385
+ * Random seed for reproducibility of the generation.
6386
+ */
6387
+ seed?: number;
6388
+ /**
6389
+ * Penalty for repeated tokens; higher values discourage repetition.
6390
+ */
6391
+ repetition_penalty?: number;
6392
+ /**
6393
+ * Decreases the likelihood of the model repeating the same lines verbatim.
6394
+ */
6395
+ frequency_penalty?: number;
6396
+ /**
6397
+ * Increases the likelihood of the model introducing new topics.
6398
+ */
6399
+ presence_penalty?: number;
6400
+ }
6401
+ export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = {
6402
+ /**
6403
+ * The generated text response from the model
6404
+ */
6405
+ response: string;
6406
+ /**
6407
+ * Usage statistics for the inference request
6408
+ */
6409
+ usage?: {
6410
+ /**
6411
+ * Total number of tokens in input
6412
+ */
6413
+ prompt_tokens?: number;
6414
+ /**
6415
+ * Total number of tokens in output
6416
+ */
6417
+ completion_tokens?: number;
6418
+ /**
6419
+ * Total number of input and output tokens
6420
+ */
6421
+ total_tokens?: number;
6422
+ };
6423
+ /**
6424
+ * An array of tool calls requests made during the response generation
6425
+ */
6426
+ tool_calls?: {
6427
+ /**
6428
+ * The tool call id.
6429
+ */
6430
+ id?: string;
6431
+ /**
6432
+ * Specifies the type of tool (e.g., 'function').
6433
+ */
6434
+ type?: string;
6435
+ /**
6436
+ * Details of the function tool.
6437
+ */
6438
+ function?: {
6439
+ /**
6440
+ * The name of the tool to be called
6441
+ */
6442
+ name?: string;
6443
+ /**
6444
+ * The arguments passed to be passed to the tool call request
6445
+ */
6446
+ arguments?: object;
6447
+ };
6448
+ }[];
6449
+ };
6450
+ export declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {
6451
+ inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;
6452
+ postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;
6453
+ }
6454
+ export interface Ai_Cf_Deepgram_Nova_3_Input {
6455
+ audio: {
6456
+ body: object;
6457
+ contentType: string;
6458
+ };
6459
+ /**
6460
+ * Sets how the model will interpret strings submitted to the custom_topic param. When strict, the model will only return topics submitted using the custom_topic param. When extended, the model will return its own detected topics in addition to those submitted using the custom_topic param.
6461
+ */
6462
+ custom_topic_mode?: "extended" | "strict";
6463
+ /**
6464
+ * Custom topics you want the model to detect within your input audio or text if present Submit up to 100
6465
+ */
6466
+ custom_topic?: string;
6467
+ /**
6468
+ * Sets how the model will interpret intents submitted to the custom_intent param. When strict, the model will only return intents submitted using the custom_intent param. When extended, the model will return its own detected intents in addition those submitted using the custom_intents param
6469
+ */
6470
+ custom_intent_mode?: "extended" | "strict";
6471
+ /**
6472
+ * Custom intents you want the model to detect within your input audio if present
6473
+ */
6474
+ custom_intent?: string;
6475
+ /**
6476
+ * Identifies and extracts key entities from content in submitted audio
6477
+ */
6478
+ detect_entities?: boolean;
6479
+ /**
6480
+ * Identifies the dominant language spoken in submitted audio
6481
+ */
6482
+ detect_language?: boolean;
6483
+ /**
6484
+ * Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0
6485
+ */
6486
+ diarize?: boolean;
6487
+ /**
6488
+ * Identify and extract key entities from content in submitted audio
6489
+ */
6490
+ dictation?: boolean;
6491
+ /**
6492
+ * Specify the expected encoding of your submitted audio
6493
+ */
6494
+ encoding?:
6495
+ | "linear16"
6496
+ | "flac"
6497
+ | "mulaw"
6498
+ | "amr-nb"
6499
+ | "amr-wb"
6500
+ | "opus"
6501
+ | "speex"
6502
+ | "g729";
6503
+ /**
6504
+ * Arbitrary key-value pairs that are attached to the API response for usage in downstream processing
6505
+ */
6506
+ extra?: string;
6507
+ /**
6508
+ * Filler Words can help transcribe interruptions in your audio, like 'uh' and 'um'
6509
+ */
6510
+ filler_words?: boolean;
6511
+ /**
6512
+ * Key term prompting can boost or suppress specialized terminology and brands.
6513
+ */
6514
+ keyterm?: string;
6515
+ /**
6516
+ * Keywords can boost or suppress specialized terminology and brands.
6517
+ */
6518
+ keywords?: string;
6519
+ /**
6520
+ * The BCP-47 language tag that hints at the primary spoken language. Depending on the Model and API endpoint you choose only certain languages are available.
6521
+ */
6522
+ language?: string;
6523
+ /**
6524
+ * Spoken measurements will be converted to their corresponding abbreviations.
6525
+ */
6526
+ measurements?: boolean;
6527
+ /**
6528
+ * Opts out requests from the Deepgram Model Improvement Program. Refer to our Docs for pricing impacts before setting this to true. https://dpgr.am/deepgram-mip.
6529
+ */
6530
+ mip_opt_out?: boolean;
6531
+ /**
6532
+ * Mode of operation for the model representing broad area of topic that will be talked about in the supplied audio
6533
+ */
6534
+ mode?: "general" | "medical" | "finance";
6535
+ /**
6536
+ * Transcribe each audio channel independently.
6537
+ */
6538
+ multichannel?: boolean;
6539
+ /**
6540
+ * Numerals converts numbers from written format to numerical format.
6541
+ */
6542
+ numerals?: boolean;
6543
+ /**
6544
+ * Splits audio into paragraphs to improve transcript readability.
6545
+ */
6546
+ paragraphs?: boolean;
6547
+ /**
6548
+ * Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely.
6549
+ */
6550
+ profanity_filter?: boolean;
6551
+ /**
6552
+ * Add punctuation and capitalization to the transcript.
6553
+ */
6554
+ punctuate?: boolean;
6555
+ /**
6556
+ * Redaction removes sensitive information from your transcripts.
6557
+ */
6558
+ redact?: string;
6559
+ /**
6560
+ * Search for terms or phrases in submitted audio and replaces them.
6561
+ */
6562
+ replace?: string;
6563
+ /**
6564
+ * Search for terms or phrases in submitted audio.
6565
+ */
6566
+ search?: string;
6567
+ /**
6568
+ * Recognizes the sentiment throughout a transcript or text.
6569
+ */
6570
+ sentiment?: boolean;
6571
+ /**
6572
+ * Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability.
6573
+ */
6574
+ smart_format?: boolean;
6575
+ /**
6576
+ * Detect topics throughout a transcript or text.
6577
+ */
6578
+ topics?: boolean;
6579
+ /**
6580
+ * Segments speech into meaningful semantic units.
6581
+ */
6582
+ utterances?: boolean;
6583
+ /**
6584
+ * Seconds to wait before detecting a pause between words in submitted audio.
6585
+ */
6586
+ utt_split?: number;
6587
+ /**
6588
+ * The number of channels in the submitted audio
6589
+ */
6590
+ channels?: number;
6591
+ /**
6592
+ * Specifies whether the streaming endpoint should provide ongoing transcription updates as more audio is received. When set to true, the endpoint sends continuous updates, meaning transcription results may evolve over time. Note: Supported only for webosockets.
6593
+ */
6594
+ interim_results?: boolean;
6595
+ /**
6596
+ * Indicates how long model will wait to detect whether a speaker has finished speaking or pauses for a significant period of time. When set to a value, the streaming endpoint immediately finalizes the transcription for the processed time range and returns the transcript with a speech_final parameter set to true. Can also be set to false to disable endpointing
6597
+ */
6598
+ endpointing?: string;
6599
+ /**
6600
+ * Indicates that speech has started. You'll begin receiving Speech Started messages upon speech starting. Note: Supported only for webosockets.
6601
+ */
6602
+ vad_events?: boolean;
6603
+ /**
6604
+ * Indicates how long model will wait to send an UtteranceEnd message after a word has been transcribed. Use with interim_results. Note: Supported only for webosockets.
6605
+ */
6606
+ utterance_end_ms?: boolean;
6607
+ }
6608
+ export interface Ai_Cf_Deepgram_Nova_3_Output {
6609
+ results?: {
6610
+ channels?: {
6611
+ alternatives?: {
6612
+ confidence?: number;
6613
+ transcript?: string;
6614
+ words?: {
6615
+ confidence?: number;
6616
+ end?: number;
6617
+ start?: number;
6618
+ word?: string;
6619
+ }[];
6620
+ }[];
6621
+ }[];
6622
+ summary?: {
6623
+ result?: string;
6624
+ short?: string;
6625
+ };
6626
+ sentiments?: {
6627
+ segments?: {
6628
+ text?: string;
6629
+ start_word?: number;
6630
+ end_word?: number;
6631
+ sentiment?: string;
6632
+ sentiment_score?: number;
6633
+ }[];
6634
+ average?: {
6635
+ sentiment?: string;
6636
+ sentiment_score?: number;
6637
+ };
6638
+ };
6639
+ };
6640
+ }
6641
+ export declare abstract class Base_Ai_Cf_Deepgram_Nova_3 {
6642
+ inputs: Ai_Cf_Deepgram_Nova_3_Input;
6643
+ postProcessedOutputs: Ai_Cf_Deepgram_Nova_3_Output;
6644
+ }
6645
+ export type Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input =
6646
+ | {
6647
+ /**
6648
+ * readable stream with audio data and content-type specified for that data
6649
+ */
6650
+ audio: {
6651
+ body: object;
6652
+ contentType: string;
6653
+ };
6654
+ /**
6655
+ * type of data PCM data that's sent to the inference server as raw array
6656
+ */
6657
+ dtype?: "uint8" | "float32" | "float64";
6658
+ }
6659
+ | {
6660
+ /**
6661
+ * base64 encoded audio data
6662
+ */
6663
+ audio: string;
6664
+ /**
6665
+ * type of data PCM data that's sent to the inference server as raw array
6666
+ */
6667
+ dtype?: "uint8" | "float32" | "float64";
6668
+ };
6669
+ export interface Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output {
6670
+ /**
6671
+ * if true, end-of-turn was detected
6672
+ */
6673
+ is_complete?: boolean;
6674
+ /**
6675
+ * probability of the end-of-turn detection
6676
+ */
6677
+ probability?: number;
6678
+ }
6679
+ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
6680
+ inputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input;
6681
+ postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
6682
+ }
6683
+ export type Ai_Cf_Openai_Gpt_Oss_120B_Input =
6684
+ | GPT_OSS_120B_Responses
6685
+ | GPT_OSS_120B_Responses_Async;
6686
+ export interface GPT_OSS_120B_Responses {
6687
+ /**
6688
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6689
+ */
6690
+ input: string | unknown[];
6691
+ reasoning?: {
6692
+ /**
6693
+ * Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
6694
+ */
6695
+ effort?: "low" | "medium" | "high";
6696
+ /**
6697
+ * A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.
6698
+ */
6699
+ summary?: "auto" | "concise" | "detailed";
6700
+ };
6701
+ }
6702
+ export interface GPT_OSS_120B_Responses_Async {
6703
+ requests: {
6704
+ /**
6705
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6706
+ */
6707
+ input: string | unknown[];
6708
+ reasoning?: {
6709
+ /**
6710
+ * Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
6711
+ */
6712
+ effort?: "low" | "medium" | "high";
6713
+ /**
6714
+ * A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.
6715
+ */
6716
+ summary?: "auto" | "concise" | "detailed";
6717
+ };
6718
+ }[];
6719
+ }
6720
+ export type Ai_Cf_Openai_Gpt_Oss_120B_Output =
6721
+ | {}
6722
+ | (string & NonNullable<unknown>);
6723
+ export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
6724
+ inputs: Ai_Cf_Openai_Gpt_Oss_120B_Input;
6725
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_120B_Output;
6726
+ }
6727
+ export type Ai_Cf_Openai_Gpt_Oss_20B_Input =
6728
+ | GPT_OSS_20B_Responses
6729
+ | GPT_OSS_20B_Responses_Async;
6730
+ export interface GPT_OSS_20B_Responses {
6731
+ /**
6732
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6733
+ */
6734
+ input: string | unknown[];
6735
+ reasoning?: {
6736
+ /**
6737
+ * Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
6738
+ */
6739
+ effort?: "low" | "medium" | "high";
6740
+ /**
6741
+ * A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.
6742
+ */
6743
+ summary?: "auto" | "concise" | "detailed";
6744
+ };
6745
+ }
6746
+ export interface GPT_OSS_20B_Responses_Async {
6747
+ requests: {
6748
+ /**
6749
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6750
+ */
6751
+ input: string | unknown[];
6752
+ reasoning?: {
6753
+ /**
6754
+ * Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
6755
+ */
6756
+ effort?: "low" | "medium" | "high";
6757
+ /**
6758
+ * A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.
6759
+ */
6760
+ summary?: "auto" | "concise" | "detailed";
6761
+ };
6762
+ }[];
6763
+ }
6764
+ export type Ai_Cf_Openai_Gpt_Oss_20B_Output =
6765
+ | {}
6766
+ | (string & NonNullable<unknown>);
6767
+ export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
6768
+ inputs: Ai_Cf_Openai_Gpt_Oss_20B_Input;
6769
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_20B_Output;
6770
+ }
6771
+ export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
6772
+ /**
6773
+ * A text description of the image you want to generate.
6774
+ */
6775
+ prompt: string;
6776
+ /**
6777
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6778
+ */
6779
+ guidance?: number;
6780
+ /**
6781
+ * Random seed for reproducibility of the image generation
6782
+ */
6783
+ seed?: number;
6784
+ /**
6785
+ * The height of the generated image in pixels
6786
+ */
6787
+ height?: number;
6788
+ /**
6789
+ * The width of the generated image in pixels
6790
+ */
6791
+ width?: number;
6792
+ /**
6793
+ * The number of diffusion steps; higher values can improve quality but take longer
6794
+ */
6795
+ num_steps?: number;
6796
+ /**
6797
+ * Specify what to exclude from the generated images
6798
+ */
6799
+ negative_prompt?: string;
6800
+ }
6801
+ /**
6802
+ * The generated image in JPEG format
6803
+ */
6804
+ export type Ai_Cf_Leonardo_Phoenix_1_0_Output = string;
6805
+ export declare abstract class Base_Ai_Cf_Leonardo_Phoenix_1_0 {
6806
+ inputs: Ai_Cf_Leonardo_Phoenix_1_0_Input;
6807
+ postProcessedOutputs: Ai_Cf_Leonardo_Phoenix_1_0_Output;
6808
+ }
6809
+ export interface Ai_Cf_Leonardo_Lucid_Origin_Input {
6810
+ /**
6811
+ * A text description of the image you want to generate.
6812
+ */
6813
+ prompt: string;
6814
+ /**
6815
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6816
+ */
6817
+ guidance?: number;
6818
+ /**
6819
+ * Random seed for reproducibility of the image generation
6820
+ */
6821
+ seed?: number;
6822
+ /**
6823
+ * The height of the generated image in pixels
6824
+ */
6825
+ height?: number;
6826
+ /**
6827
+ * The width of the generated image in pixels
6828
+ */
6829
+ width?: number;
6830
+ /**
6831
+ * The number of diffusion steps; higher values can improve quality but take longer
6832
+ */
6833
+ num_steps?: number;
6834
+ /**
6835
+ * The number of diffusion steps; higher values can improve quality but take longer
6836
+ */
6837
+ steps?: number;
6838
+ }
6839
+ export interface Ai_Cf_Leonardo_Lucid_Origin_Output {
6840
+ /**
6841
+ * The generated image in Base64 format.
6842
+ */
6843
+ image?: string;
6844
+ }
6845
+ export declare abstract class Base_Ai_Cf_Leonardo_Lucid_Origin {
6846
+ inputs: Ai_Cf_Leonardo_Lucid_Origin_Input;
6847
+ postProcessedOutputs: Ai_Cf_Leonardo_Lucid_Origin_Output;
6848
+ }
6849
+ export interface Ai_Cf_Deepgram_Aura_1_Input {
6850
+ /**
6851
+ * Speaker used to produce the audio.
6852
+ */
6853
+ speaker?:
6854
+ | "angus"
6855
+ | "asteria"
6856
+ | "arcas"
6857
+ | "orion"
6858
+ | "orpheus"
6859
+ | "athena"
6860
+ | "luna"
6861
+ | "zeus"
6862
+ | "perseus"
6863
+ | "helios"
6864
+ | "hera"
6865
+ | "stella";
6866
+ /**
6867
+ * Encoding of the output audio.
6868
+ */
6869
+ encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac";
6870
+ /**
6871
+ * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..
6872
+ */
6873
+ container?: "none" | "wav" | "ogg";
6874
+ /**
6875
+ * The text content to be converted to speech
6876
+ */
6877
+ text: string;
6878
+ /**
6879
+ * Sample Rate specifies the sample rate for the output audio. Based on the encoding, different sample rates are supported. For some encodings, the sample rate is not configurable
6880
+ */
6881
+ sample_rate?: number;
6882
+ /**
6883
+ * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.
6884
+ */
6885
+ bit_rate?: number;
6886
+ }
6887
+ /**
6888
+ * The generated audio in MP3 format
6889
+ */
6890
+ export type Ai_Cf_Deepgram_Aura_1_Output = string;
6891
+ export declare abstract class Base_Ai_Cf_Deepgram_Aura_1 {
6892
+ inputs: Ai_Cf_Deepgram_Aura_1_Input;
6893
+ postProcessedOutputs: Ai_Cf_Deepgram_Aura_1_Output;
6894
+ }
6895
+ export interface AiModels {
6896
+ "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
6897
+ "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
6898
+ "@cf/runwayml/stable-diffusion-v1-5-inpainting": BaseAiTextToImage;
6899
+ "@cf/runwayml/stable-diffusion-v1-5-img2img": BaseAiTextToImage;
6900
+ "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
6901
+ "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
6902
+ "@cf/myshell-ai/melotts": BaseAiTextToSpeech;
6903
+ "@cf/google/embeddinggemma-300m": BaseAiTextEmbeddings;
6904
+ "@cf/microsoft/resnet-50": BaseAiImageClassification;
6905
+ "@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
6906
+ "@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
6907
+ "@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
6908
+ "@hf/thebloke/llama-2-13b-chat-awq": BaseAiTextGeneration;
6909
+ "@hf/thebloke/mistral-7b-instruct-v0.1-awq": BaseAiTextGeneration;
6910
+ "@hf/thebloke/zephyr-7b-beta-awq": BaseAiTextGeneration;
6911
+ "@hf/thebloke/openhermes-2.5-mistral-7b-awq": BaseAiTextGeneration;
6912
+ "@hf/thebloke/neural-chat-7b-v3-1-awq": BaseAiTextGeneration;
6913
+ "@hf/thebloke/llamaguard-7b-awq": BaseAiTextGeneration;
6914
+ "@hf/thebloke/deepseek-coder-6.7b-base-awq": BaseAiTextGeneration;
6915
+ "@hf/thebloke/deepseek-coder-6.7b-instruct-awq": BaseAiTextGeneration;
6916
+ "@cf/deepseek-ai/deepseek-math-7b-instruct": BaseAiTextGeneration;
6917
+ "@cf/defog/sqlcoder-7b-2": BaseAiTextGeneration;
6918
+ "@cf/openchat/openchat-3.5-0106": BaseAiTextGeneration;
6919
+ "@cf/tiiuae/falcon-7b-instruct": BaseAiTextGeneration;
6920
+ "@cf/thebloke/discolm-german-7b-v1-awq": BaseAiTextGeneration;
6921
+ "@cf/qwen/qwen1.5-0.5b-chat": BaseAiTextGeneration;
6922
+ "@cf/qwen/qwen1.5-7b-chat-awq": BaseAiTextGeneration;
6923
+ "@cf/qwen/qwen1.5-14b-chat-awq": BaseAiTextGeneration;
6924
+ "@cf/tinyllama/tinyllama-1.1b-chat-v1.0": BaseAiTextGeneration;
6925
+ "@cf/microsoft/phi-2": BaseAiTextGeneration;
6926
+ "@cf/qwen/qwen1.5-1.8b-chat": BaseAiTextGeneration;
6927
+ "@cf/mistral/mistral-7b-instruct-v0.2-lora": BaseAiTextGeneration;
6928
+ "@hf/nousresearch/hermes-2-pro-mistral-7b": BaseAiTextGeneration;
6929
+ "@hf/nexusflow/starling-lm-7b-beta": BaseAiTextGeneration;
6930
+ "@hf/google/gemma-7b-it": BaseAiTextGeneration;
6931
+ "@cf/meta-llama/llama-2-7b-chat-hf-lora": BaseAiTextGeneration;
6932
+ "@cf/google/gemma-2b-it-lora": BaseAiTextGeneration;
6933
+ "@cf/google/gemma-7b-it-lora": BaseAiTextGeneration;
6934
+ "@hf/mistral/mistral-7b-instruct-v0.2": BaseAiTextGeneration;
6935
+ "@cf/meta/llama-3-8b-instruct": BaseAiTextGeneration;
6936
+ "@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
6937
+ "@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
6938
+ "@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
6939
+ "@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
6940
+ "@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
6941
+ "@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
6942
+ "@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;
6943
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": BaseAiTextGeneration;
6944
+ "@cf/facebook/bart-large-cnn": BaseAiSummarization;
6945
+ "@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;
6946
+ "@cf/baai/bge-base-en-v1.5": Base_Ai_Cf_Baai_Bge_Base_En_V1_5;
6947
+ "@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper;
6948
+ "@cf/meta/m2m100-1.2b": Base_Ai_Cf_Meta_M2M100_1_2B;
6949
+ "@cf/baai/bge-small-en-v1.5": Base_Ai_Cf_Baai_Bge_Small_En_V1_5;
6950
+ "@cf/baai/bge-large-en-v1.5": Base_Ai_Cf_Baai_Bge_Large_En_V1_5;
6951
+ "@cf/unum/uform-gen2-qwen-500m": Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M;
6952
+ "@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
6953
+ "@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
6954
+ "@cf/baai/bge-m3": Base_Ai_Cf_Baai_Bge_M3;
6955
+ "@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
6956
+ "@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct;
6957
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast": Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast;
6958
+ "@cf/meta/llama-guard-3-8b": Base_Ai_Cf_Meta_Llama_Guard_3_8B;
6959
+ "@cf/baai/bge-reranker-base": Base_Ai_Cf_Baai_Bge_Reranker_Base;
6415
6960
  "@cf/qwen/qwen2.5-coder-32b-instruct": Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct;
6416
6961
  "@cf/qwen/qwq-32b": Base_Ai_Cf_Qwen_Qwq_32B;
6417
6962
  "@cf/mistralai/mistral-small-3.1-24b-instruct": Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct;
6418
6963
  "@cf/google/gemma-3-12b-it": Base_Ai_Cf_Google_Gemma_3_12B_It;
6419
6964
  "@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;
6965
+ "@cf/deepgram/nova-3": Base_Ai_Cf_Deepgram_Nova_3;
6966
+ "@cf/pipecat-ai/smart-turn-v2": Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2;
6967
+ "@cf/openai/gpt-oss-120b": Base_Ai_Cf_Openai_Gpt_Oss_120B;
6968
+ "@cf/openai/gpt-oss-20b": Base_Ai_Cf_Openai_Gpt_Oss_20B;
6969
+ "@cf/leonardo/phoenix-1.0": Base_Ai_Cf_Leonardo_Phoenix_1_0;
6970
+ "@cf/leonardo/lucid-origin": Base_Ai_Cf_Leonardo_Lucid_Origin;
6971
+ "@cf/deepgram/aura-1": Base_Ai_Cf_Deepgram_Aura_1;
6420
6972
  }
6421
6973
  export type AiOptions = {
6422
6974
  /**
@@ -6424,6 +6976,10 @@ export type AiOptions = {
6424
6976
  * https://developers.cloudflare.com/workers-ai/features/batch-api
6425
6977
  */
6426
6978
  queueRequest?: boolean;
6979
+ /**
6980
+ * Establish websocket connections, only works for supported models
6981
+ */
6982
+ websocket?: boolean;
6427
6983
  gateway?: GatewayOptions;
6428
6984
  returnRawResponse?: boolean;
6429
6985
  prefix?: string;
@@ -6469,7 +7025,7 @@ export declare abstract class Ai<
6469
7025
  > {
6470
7026
  aiGatewayLogId: string | null;
6471
7027
  gateway(gatewayId: string): AiGateway;
6472
- autorag(autoragId?: string): AutoRAG;
7028
+ autorag(autoragId: string): AutoRAG;
6473
7029
  run<
6474
7030
  Name extends keyof AiModelList,
6475
7031
  Options extends AiOptions,
@@ -6479,9 +7035,13 @@ export declare abstract class Ai<
6479
7035
  inputs: InputOptions,
6480
7036
  options?: Options,
6481
7037
  ): Promise<
6482
- Options extends {
6483
- returnRawResponse: true;
6484
- }
7038
+ Options extends
7039
+ | {
7040
+ returnRawResponse: true;
7041
+ }
7042
+ | {
7043
+ websocket: true;
7044
+ }
6485
7045
  ? Response
6486
7046
  : InputOptions extends {
6487
7047
  stream: true;