@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.
package/latest/index.ts CHANGED
@@ -296,13 +296,6 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
296
296
  FixedLengthStream: typeof FixedLengthStream;
297
297
  IdentityTransformStream: typeof IdentityTransformStream;
298
298
  HTMLRewriter: typeof HTMLRewriter;
299
- Performance: typeof Performance;
300
- PerformanceEntry: typeof PerformanceEntry;
301
- PerformanceMark: typeof PerformanceMark;
302
- PerformanceMeasure: typeof PerformanceMeasure;
303
- PerformanceResourceTiming: typeof PerformanceResourceTiming;
304
- PerformanceObserver: typeof PerformanceObserver;
305
- PerformanceObserverEntryList: typeof PerformanceObserverEntryList;
306
299
  }
307
300
  export declare function addEventListener<
308
301
  Type extends keyof WorkerGlobalScopeEventMap,
@@ -482,6 +475,18 @@ export declare abstract class Navigator {
482
475
  readonly language: string;
483
476
  readonly languages: string[];
484
477
  }
478
+ /**
479
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
480
+ * as well as timing of subrequests and other operations.
481
+ *
482
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
483
+ */
484
+ export interface Performance {
485
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
486
+ readonly timeOrigin: number;
487
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
488
+ now(): number;
489
+ }
485
490
  export interface AlarmInvocationInfo {
486
491
  readonly isRetry: boolean;
487
492
  readonly retryCount: number;
@@ -3201,171 +3206,6 @@ export interface WorkerLoaderWorkerCode {
3201
3206
  tails?: Fetcher[];
3202
3207
  streamingTails?: Fetcher[];
3203
3208
  }
3204
- /**
3205
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3206
- * as well as timing of subrequests and other operations.
3207
- *
3208
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3209
- */
3210
- export declare abstract class Performance extends EventTarget {
3211
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3212
- get timeOrigin(): number;
3213
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3214
- now(): number;
3215
- get eventCounts(): EventCounts;
3216
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMarks) */
3217
- clearMarks(name?: string): void;
3218
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures) */
3219
- clearMeasures(name?: string): void;
3220
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearResourceTimings) */
3221
- clearResourceTimings(): void;
3222
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntries) */
3223
- getEntries(): PerformanceEntry[];
3224
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName) */
3225
- getEntriesByName(name: string, type?: string): PerformanceEntry[];
3226
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType) */
3227
- getEntriesByType(type: string): PerformanceEntry[];
3228
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/mark) */
3229
- mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
3230
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/measure) */
3231
- measure(
3232
- measureName: string,
3233
- measureOptionsOrStartMark: PerformanceMeasureOptions | string,
3234
- maybeEndMark?: string,
3235
- ): PerformanceMeasure;
3236
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize) */
3237
- setResourceTimingBufferSize(size: number): void;
3238
- }
3239
- /**
3240
- * 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.
3241
- *
3242
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark)
3243
- */
3244
- export declare class PerformanceMark extends PerformanceEntry {
3245
- constructor(name: string, maybeOptions?: PerformanceMarkOptions);
3246
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail) */
3247
- get detail(): any | undefined;
3248
- toJSON(): any;
3249
- }
3250
- /**
3251
- * 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.
3252
- *
3253
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure)
3254
- */
3255
- export declare abstract class PerformanceMeasure extends PerformanceEntry {
3256
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure/detail) */
3257
- get detail(): any | undefined;
3258
- toJSON(): any;
3259
- }
3260
- export interface PerformanceMarkOptions {
3261
- detail?: any;
3262
- startTime?: number;
3263
- }
3264
- export interface PerformanceMeasureOptions {
3265
- detail?: any;
3266
- start?: number;
3267
- duration?: number;
3268
- end?: number;
3269
- }
3270
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList) */
3271
- export declare abstract class PerformanceObserverEntryList {
3272
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntries) */
3273
- getEntries(): PerformanceEntry[];
3274
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByType) */
3275
- getEntriesByType(type: string): PerformanceEntry[];
3276
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByName) */
3277
- getEntriesByName(name: string, type?: string): PerformanceEntry[];
3278
- }
3279
- /**
3280
- * 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).
3281
- *
3282
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry)
3283
- */
3284
- export declare abstract class PerformanceEntry {
3285
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/name) */
3286
- get name(): string;
3287
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/entryType) */
3288
- get entryType(): string;
3289
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/startTime) */
3290
- get startTime(): number;
3291
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/duration) */
3292
- get duration(): number;
3293
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/toJSON) */
3294
- toJSON(): any;
3295
- }
3296
- /**
3297
- * 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.
3298
- *
3299
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming)
3300
- */
3301
- export declare abstract class PerformanceResourceTiming extends PerformanceEntry {
3302
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectEnd) */
3303
- get connectEnd(): number;
3304
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectStart) */
3305
- get connectStart(): number;
3306
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/decodedBodySize) */
3307
- get decodedBodySize(): number;
3308
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupEnd) */
3309
- get domainLookupEnd(): number;
3310
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupStart) */
3311
- get domainLookupStart(): number;
3312
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/encodedBodySize) */
3313
- get encodedBodySize(): number;
3314
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/fetchStart) */
3315
- get fetchStart(): number;
3316
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/initiatorType) */
3317
- get initiatorType(): string;
3318
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/nextHopProtocol) */
3319
- get nextHopProtocol(): string;
3320
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectEnd) */
3321
- get redirectEnd(): number;
3322
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectStart) */
3323
- get redirectStart(): number;
3324
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/requestStart) */
3325
- get requestStart(): number;
3326
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseEnd) */
3327
- get responseEnd(): number;
3328
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStart) */
3329
- get responseStart(): number;
3330
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStatus) */
3331
- get responseStatus(): number;
3332
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/secureConnectionStart) */
3333
- get secureConnectionStart(): number | undefined;
3334
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/transferSize) */
3335
- get transferSize(): number;
3336
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/workerStart) */
3337
- get workerStart(): number;
3338
- }
3339
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver) */
3340
- export declare class PerformanceObserver {
3341
- constructor(callback: any);
3342
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/disconnect) */
3343
- disconnect(): void;
3344
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/observe) */
3345
- observe(options?: PerformanceObserverObserveOptions): void;
3346
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/takeRecords) */
3347
- takeRecords(): PerformanceEntry[];
3348
- readonly supportedEntryTypes: string[];
3349
- }
3350
- export interface PerformanceObserverObserveOptions {
3351
- buffered?: boolean;
3352
- durationThreshold?: number;
3353
- entryTypes?: string[];
3354
- type?: string;
3355
- }
3356
- export interface EventCounts {
3357
- get size(): number;
3358
- get(eventType: string): number | undefined;
3359
- has(eventType: string): boolean;
3360
- entries(): IterableIterator<string[]>;
3361
- keys(): IterableIterator<string>;
3362
- values(): IterableIterator<number>;
3363
- forEach(
3364
- param1: (param0: number, param1: string, param2: EventCounts) => void,
3365
- param2?: any,
3366
- ): void;
3367
- [Symbol.iterator](): IterableIterator<string[]>;
3368
- }
3369
3209
  export type AiImageClassificationInput = {
3370
3210
  image: number[];
3371
3211
  };
@@ -3420,6 +3260,18 @@ export declare abstract class BaseAiImageTextToText {
3420
3260
  inputs: AiImageTextToTextInput;
3421
3261
  postProcessedOutputs: AiImageTextToTextOutput;
3422
3262
  }
3263
+ export type AiMultimodalEmbeddingsInput = {
3264
+ image: string;
3265
+ text: string[];
3266
+ };
3267
+ export type AiIMultimodalEmbeddingsOutput = {
3268
+ data: number[][];
3269
+ shape: number[];
3270
+ };
3271
+ export declare abstract class BaseAiMultimodalEmbeddings {
3272
+ inputs: AiImageTextToTextInput;
3273
+ postProcessedOutputs: AiImageTextToTextOutput;
3274
+ }
3423
3275
  export type AiObjectDetectionInput = {
3424
3276
  image: number[];
3425
3277
  };
@@ -3558,12 +3410,28 @@ export type AiTextGenerationInput = {
3558
3410
  | (object & NonNullable<unknown>);
3559
3411
  functions?: AiTextGenerationFunctionsInput[];
3560
3412
  };
3413
+ export type AiTextGenerationToolLegacyOutput = {
3414
+ name: string;
3415
+ arguments: unknown;
3416
+ };
3417
+ export type AiTextGenerationToolOutput = {
3418
+ id: string;
3419
+ type: "function";
3420
+ function: {
3421
+ name: string;
3422
+ arguments: string;
3423
+ };
3424
+ };
3425
+ export type UsageTags = {
3426
+ prompt_tokens: number;
3427
+ completion_tokens: number;
3428
+ total_tokens: number;
3429
+ };
3561
3430
  export type AiTextGenerationOutput = {
3562
3431
  response?: string;
3563
- tool_calls?: {
3564
- name: string;
3565
- arguments: unknown;
3566
- }[];
3432
+ tool_calls?: AiTextGenerationToolLegacyOutput[] &
3433
+ AiTextGenerationToolOutput[];
3434
+ usage?: UsageTags;
3567
3435
  };
3568
3436
  export declare abstract class BaseAiTextGeneration {
3569
3437
  inputs: AiTextGenerationInput;
@@ -4652,6 +4520,7 @@ export type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output =
4652
4520
  name?: string;
4653
4521
  }[];
4654
4522
  }
4523
+ | string
4655
4524
  | AsyncResponse;
4656
4525
  export declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast {
4657
4526
  inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input;
@@ -4728,7 +4597,6 @@ export interface Ai_Cf_Baai_Bge_Reranker_Base_Input {
4728
4597
  /**
4729
4598
  * A query you wish to perform against the provided contexts.
4730
4599
  */
4731
- query: string;
4732
4600
  /**
4733
4601
  * Number of returned results starting with the best score.
4734
4602
  */
@@ -5823,7 +5691,8 @@ export declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It {
5823
5691
  }
5824
5692
  export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input =
5825
5693
  | Ai_Cf_Meta_Llama_4_Prompt
5826
- | Ai_Cf_Meta_Llama_4_Messages;
5694
+ | Ai_Cf_Meta_Llama_4_Messages
5695
+ | Ai_Cf_Meta_Llama_4_Async_Batch;
5827
5696
  export interface Ai_Cf_Meta_Llama_4_Prompt {
5828
5697
  /**
5829
5698
  * The input text prompt for the model to generate a response.
@@ -6057,130 +5926,816 @@ export interface Ai_Cf_Meta_Llama_4_Messages {
6057
5926
  */
6058
5927
  presence_penalty?: number;
6059
5928
  }
6060
- export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = {
5929
+ export interface Ai_Cf_Meta_Llama_4_Async_Batch {
5930
+ requests: (
5931
+ | Ai_Cf_Meta_Llama_4_Prompt_Inner
5932
+ | Ai_Cf_Meta_Llama_4_Messages_Inner
5933
+ )[];
5934
+ }
5935
+ export interface Ai_Cf_Meta_Llama_4_Prompt_Inner {
6061
5936
  /**
6062
- * The generated text response from the model
5937
+ * The input text prompt for the model to generate a response.
6063
5938
  */
6064
- response: string;
5939
+ prompt: string;
6065
5940
  /**
6066
- * Usage statistics for the inference request
5941
+ * JSON schema that should be fulfilled for the response.
6067
5942
  */
6068
- usage?: {
6069
- /**
6070
- * Total number of tokens in input
6071
- */
6072
- prompt_tokens?: number;
6073
- /**
6074
- * Total number of tokens in output
6075
- */
6076
- completion_tokens?: number;
6077
- /**
6078
- * Total number of input and output tokens
6079
- */
6080
- total_tokens?: number;
6081
- };
5943
+ guided_json?: object;
5944
+ response_format?: JSONMode;
6082
5945
  /**
6083
- * An array of tool calls requests made during the response generation
5946
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6084
5947
  */
6085
- tool_calls?: {
6086
- /**
6087
- * The tool call id.
6088
- */
6089
- id?: string;
5948
+ raw?: boolean;
5949
+ /**
5950
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
5951
+ */
5952
+ stream?: boolean;
5953
+ /**
5954
+ * The maximum number of tokens to generate in the response.
5955
+ */
5956
+ max_tokens?: number;
5957
+ /**
5958
+ * Controls the randomness of the output; higher values produce more random results.
5959
+ */
5960
+ temperature?: number;
5961
+ /**
5962
+ * 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.
5963
+ */
5964
+ top_p?: number;
5965
+ /**
5966
+ * 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.
5967
+ */
5968
+ top_k?: number;
5969
+ /**
5970
+ * Random seed for reproducibility of the generation.
5971
+ */
5972
+ seed?: number;
5973
+ /**
5974
+ * Penalty for repeated tokens; higher values discourage repetition.
5975
+ */
5976
+ repetition_penalty?: number;
5977
+ /**
5978
+ * Decreases the likelihood of the model repeating the same lines verbatim.
5979
+ */
5980
+ frequency_penalty?: number;
5981
+ /**
5982
+ * Increases the likelihood of the model introducing new topics.
5983
+ */
5984
+ presence_penalty?: number;
5985
+ }
5986
+ export interface Ai_Cf_Meta_Llama_4_Messages_Inner {
5987
+ /**
5988
+ * An array of message objects representing the conversation history.
5989
+ */
5990
+ messages: {
6090
5991
  /**
6091
- * Specifies the type of tool (e.g., 'function').
5992
+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
6092
5993
  */
6093
- type?: string;
5994
+ role?: string;
6094
5995
  /**
6095
- * Details of the function tool.
5996
+ * The tool call id. If you don't know what to put here you can fall back to 000000001
6096
5997
  */
6097
- function?: {
6098
- /**
6099
- * The name of the tool to be called
6100
- */
6101
- name?: string;
6102
- /**
6103
- * The arguments passed to be passed to the tool call request
6104
- */
6105
- arguments?: object;
6106
- };
5998
+ tool_call_id?: string;
5999
+ content?:
6000
+ | string
6001
+ | {
6002
+ /**
6003
+ * Type of the content provided
6004
+ */
6005
+ type?: string;
6006
+ text?: string;
6007
+ image_url?: {
6008
+ /**
6009
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
6010
+ */
6011
+ url?: string;
6012
+ };
6013
+ }[]
6014
+ | {
6015
+ /**
6016
+ * Type of the content provided
6017
+ */
6018
+ type?: string;
6019
+ text?: string;
6020
+ image_url?: {
6021
+ /**
6022
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
6023
+ */
6024
+ url?: string;
6025
+ };
6026
+ };
6107
6027
  }[];
6108
- };
6109
- export declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {
6110
- inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;
6111
- postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;
6112
- }
6113
- export interface AiModels {
6114
- "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
6115
- "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
6116
- "@cf/runwayml/stable-diffusion-v1-5-inpainting": BaseAiTextToImage;
6117
- "@cf/runwayml/stable-diffusion-v1-5-img2img": BaseAiTextToImage;
6118
- "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
6119
- "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
6120
- "@cf/myshell-ai/melotts": BaseAiTextToSpeech;
6121
- "@cf/microsoft/resnet-50": BaseAiImageClassification;
6122
- "@cf/facebook/detr-resnet-50": BaseAiObjectDetection;
6123
- "@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
6124
- "@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
6125
- "@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
6126
- "@hf/thebloke/llama-2-13b-chat-awq": BaseAiTextGeneration;
6127
- "@hf/thebloke/mistral-7b-instruct-v0.1-awq": BaseAiTextGeneration;
6128
- "@hf/thebloke/zephyr-7b-beta-awq": BaseAiTextGeneration;
6129
- "@hf/thebloke/openhermes-2.5-mistral-7b-awq": BaseAiTextGeneration;
6130
- "@hf/thebloke/neural-chat-7b-v3-1-awq": BaseAiTextGeneration;
6131
- "@hf/thebloke/llamaguard-7b-awq": BaseAiTextGeneration;
6132
- "@hf/thebloke/deepseek-coder-6.7b-base-awq": BaseAiTextGeneration;
6133
- "@hf/thebloke/deepseek-coder-6.7b-instruct-awq": BaseAiTextGeneration;
6134
- "@cf/deepseek-ai/deepseek-math-7b-instruct": BaseAiTextGeneration;
6135
- "@cf/defog/sqlcoder-7b-2": BaseAiTextGeneration;
6136
- "@cf/openchat/openchat-3.5-0106": BaseAiTextGeneration;
6137
- "@cf/tiiuae/falcon-7b-instruct": BaseAiTextGeneration;
6138
- "@cf/thebloke/discolm-german-7b-v1-awq": BaseAiTextGeneration;
6139
- "@cf/qwen/qwen1.5-0.5b-chat": BaseAiTextGeneration;
6140
- "@cf/qwen/qwen1.5-7b-chat-awq": BaseAiTextGeneration;
6141
- "@cf/qwen/qwen1.5-14b-chat-awq": BaseAiTextGeneration;
6142
- "@cf/tinyllama/tinyllama-1.1b-chat-v1.0": BaseAiTextGeneration;
6143
- "@cf/microsoft/phi-2": BaseAiTextGeneration;
6144
- "@cf/qwen/qwen1.5-1.8b-chat": BaseAiTextGeneration;
6145
- "@cf/mistral/mistral-7b-instruct-v0.2-lora": BaseAiTextGeneration;
6146
- "@hf/nousresearch/hermes-2-pro-mistral-7b": BaseAiTextGeneration;
6147
- "@hf/nexusflow/starling-lm-7b-beta": BaseAiTextGeneration;
6148
- "@hf/google/gemma-7b-it": BaseAiTextGeneration;
6149
- "@cf/meta-llama/llama-2-7b-chat-hf-lora": BaseAiTextGeneration;
6150
- "@cf/google/gemma-2b-it-lora": BaseAiTextGeneration;
6151
- "@cf/google/gemma-7b-it-lora": BaseAiTextGeneration;
6152
- "@hf/mistral/mistral-7b-instruct-v0.2": BaseAiTextGeneration;
6153
- "@cf/meta/llama-3-8b-instruct": BaseAiTextGeneration;
6154
- "@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
6155
- "@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
6156
- "@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
6157
- "@cf/meta/llama-3.1-8b-instruct": BaseAiTextGeneration;
6158
- "@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
6159
- "@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
6160
- "@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
6161
- "@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;
6162
- "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": BaseAiTextGeneration;
6163
- "@cf/facebook/bart-large-cnn": BaseAiSummarization;
6164
- "@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;
6165
- "@cf/baai/bge-base-en-v1.5": Base_Ai_Cf_Baai_Bge_Base_En_V1_5;
6166
- "@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper;
6167
- "@cf/meta/m2m100-1.2b": Base_Ai_Cf_Meta_M2M100_1_2B;
6168
- "@cf/baai/bge-small-en-v1.5": Base_Ai_Cf_Baai_Bge_Small_En_V1_5;
6169
- "@cf/baai/bge-large-en-v1.5": Base_Ai_Cf_Baai_Bge_Large_En_V1_5;
6170
- "@cf/unum/uform-gen2-qwen-500m": Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M;
6171
- "@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
6172
- "@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
6173
- "@cf/baai/bge-m3": Base_Ai_Cf_Baai_Bge_M3;
6174
- "@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
6175
- "@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct;
6176
- "@cf/meta/llama-3.3-70b-instruct-fp8-fast": Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast;
6177
- "@cf/meta/llama-guard-3-8b": Base_Ai_Cf_Meta_Llama_Guard_3_8B;
6178
- "@cf/baai/bge-reranker-base": Base_Ai_Cf_Baai_Bge_Reranker_Base;
6179
- "@cf/qwen/qwen2.5-coder-32b-instruct": Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct;
6028
+ functions?: {
6029
+ name: string;
6030
+ code: string;
6031
+ }[];
6032
+ /**
6033
+ * A list of tools available for the assistant to use.
6034
+ */
6035
+ tools?: (
6036
+ | {
6037
+ /**
6038
+ * The name of the tool. More descriptive the better.
6039
+ */
6040
+ name: string;
6041
+ /**
6042
+ * A brief description of what the tool does.
6043
+ */
6044
+ description: string;
6045
+ /**
6046
+ * Schema defining the parameters accepted by the tool.
6047
+ */
6048
+ parameters: {
6049
+ /**
6050
+ * The type of the parameters object (usually 'object').
6051
+ */
6052
+ type: string;
6053
+ /**
6054
+ * List of required parameter names.
6055
+ */
6056
+ required?: string[];
6057
+ /**
6058
+ * Definitions of each parameter.
6059
+ */
6060
+ properties: {
6061
+ [k: string]: {
6062
+ /**
6063
+ * The data type of the parameter.
6064
+ */
6065
+ type: string;
6066
+ /**
6067
+ * A description of the expected parameter.
6068
+ */
6069
+ description: string;
6070
+ };
6071
+ };
6072
+ };
6073
+ }
6074
+ | {
6075
+ /**
6076
+ * Specifies the type of tool (e.g., 'function').
6077
+ */
6078
+ type: string;
6079
+ /**
6080
+ * Details of the function tool.
6081
+ */
6082
+ function: {
6083
+ /**
6084
+ * The name of the function.
6085
+ */
6086
+ name: string;
6087
+ /**
6088
+ * A brief description of what the function does.
6089
+ */
6090
+ description: string;
6091
+ /**
6092
+ * Schema defining the parameters accepted by the function.
6093
+ */
6094
+ parameters: {
6095
+ /**
6096
+ * The type of the parameters object (usually 'object').
6097
+ */
6098
+ type: string;
6099
+ /**
6100
+ * List of required parameter names.
6101
+ */
6102
+ required?: string[];
6103
+ /**
6104
+ * Definitions of each parameter.
6105
+ */
6106
+ properties: {
6107
+ [k: string]: {
6108
+ /**
6109
+ * The data type of the parameter.
6110
+ */
6111
+ type: string;
6112
+ /**
6113
+ * A description of the expected parameter.
6114
+ */
6115
+ description: string;
6116
+ };
6117
+ };
6118
+ };
6119
+ };
6120
+ }
6121
+ )[];
6122
+ response_format?: JSONMode;
6123
+ /**
6124
+ * JSON schema that should be fufilled for the response.
6125
+ */
6126
+ guided_json?: object;
6127
+ /**
6128
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6129
+ */
6130
+ raw?: boolean;
6131
+ /**
6132
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6133
+ */
6134
+ stream?: boolean;
6135
+ /**
6136
+ * The maximum number of tokens to generate in the response.
6137
+ */
6138
+ max_tokens?: number;
6139
+ /**
6140
+ * Controls the randomness of the output; higher values produce more random results.
6141
+ */
6142
+ temperature?: number;
6143
+ /**
6144
+ * 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.
6145
+ */
6146
+ top_p?: number;
6147
+ /**
6148
+ * 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.
6149
+ */
6150
+ top_k?: number;
6151
+ /**
6152
+ * Random seed for reproducibility of the generation.
6153
+ */
6154
+ seed?: number;
6155
+ /**
6156
+ * Penalty for repeated tokens; higher values discourage repetition.
6157
+ */
6158
+ repetition_penalty?: number;
6159
+ /**
6160
+ * Decreases the likelihood of the model repeating the same lines verbatim.
6161
+ */
6162
+ frequency_penalty?: number;
6163
+ /**
6164
+ * Increases the likelihood of the model introducing new topics.
6165
+ */
6166
+ presence_penalty?: number;
6167
+ }
6168
+ export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = {
6169
+ /**
6170
+ * The generated text response from the model
6171
+ */
6172
+ response: string;
6173
+ /**
6174
+ * Usage statistics for the inference request
6175
+ */
6176
+ usage?: {
6177
+ /**
6178
+ * Total number of tokens in input
6179
+ */
6180
+ prompt_tokens?: number;
6181
+ /**
6182
+ * Total number of tokens in output
6183
+ */
6184
+ completion_tokens?: number;
6185
+ /**
6186
+ * Total number of input and output tokens
6187
+ */
6188
+ total_tokens?: number;
6189
+ };
6190
+ /**
6191
+ * An array of tool calls requests made during the response generation
6192
+ */
6193
+ tool_calls?: {
6194
+ /**
6195
+ * The tool call id.
6196
+ */
6197
+ id?: string;
6198
+ /**
6199
+ * Specifies the type of tool (e.g., 'function').
6200
+ */
6201
+ type?: string;
6202
+ /**
6203
+ * Details of the function tool.
6204
+ */
6205
+ function?: {
6206
+ /**
6207
+ * The name of the tool to be called
6208
+ */
6209
+ name?: string;
6210
+ /**
6211
+ * The arguments passed to be passed to the tool call request
6212
+ */
6213
+ arguments?: object;
6214
+ };
6215
+ }[];
6216
+ };
6217
+ export declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {
6218
+ inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;
6219
+ postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;
6220
+ }
6221
+ export interface Ai_Cf_Deepgram_Nova_3_Input {
6222
+ audio: {
6223
+ body: object;
6224
+ contentType: string;
6225
+ };
6226
+ /**
6227
+ * 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.
6228
+ */
6229
+ custom_topic_mode?: "extended" | "strict";
6230
+ /**
6231
+ * Custom topics you want the model to detect within your input audio or text if present Submit up to 100
6232
+ */
6233
+ custom_topic?: string;
6234
+ /**
6235
+ * 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
6236
+ */
6237
+ custom_intent_mode?: "extended" | "strict";
6238
+ /**
6239
+ * Custom intents you want the model to detect within your input audio if present
6240
+ */
6241
+ custom_intent?: string;
6242
+ /**
6243
+ * Identifies and extracts key entities from content in submitted audio
6244
+ */
6245
+ detect_entities?: boolean;
6246
+ /**
6247
+ * Identifies the dominant language spoken in submitted audio
6248
+ */
6249
+ detect_language?: boolean;
6250
+ /**
6251
+ * Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0
6252
+ */
6253
+ diarize?: boolean;
6254
+ /**
6255
+ * Identify and extract key entities from content in submitted audio
6256
+ */
6257
+ dictation?: boolean;
6258
+ /**
6259
+ * Specify the expected encoding of your submitted audio
6260
+ */
6261
+ encoding?:
6262
+ | "linear16"
6263
+ | "flac"
6264
+ | "mulaw"
6265
+ | "amr-nb"
6266
+ | "amr-wb"
6267
+ | "opus"
6268
+ | "speex"
6269
+ | "g729";
6270
+ /**
6271
+ * Arbitrary key-value pairs that are attached to the API response for usage in downstream processing
6272
+ */
6273
+ extra?: string;
6274
+ /**
6275
+ * Filler Words can help transcribe interruptions in your audio, like 'uh' and 'um'
6276
+ */
6277
+ filler_words?: boolean;
6278
+ /**
6279
+ * Key term prompting can boost or suppress specialized terminology and brands.
6280
+ */
6281
+ keyterm?: string;
6282
+ /**
6283
+ * Keywords can boost or suppress specialized terminology and brands.
6284
+ */
6285
+ keywords?: string;
6286
+ /**
6287
+ * 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.
6288
+ */
6289
+ language?: string;
6290
+ /**
6291
+ * Spoken measurements will be converted to their corresponding abbreviations.
6292
+ */
6293
+ measurements?: boolean;
6294
+ /**
6295
+ * 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.
6296
+ */
6297
+ mip_opt_out?: boolean;
6298
+ /**
6299
+ * Mode of operation for the model representing broad area of topic that will be talked about in the supplied audio
6300
+ */
6301
+ mode?: "general" | "medical" | "finance";
6302
+ /**
6303
+ * Transcribe each audio channel independently.
6304
+ */
6305
+ multichannel?: boolean;
6306
+ /**
6307
+ * Numerals converts numbers from written format to numerical format.
6308
+ */
6309
+ numerals?: boolean;
6310
+ /**
6311
+ * Splits audio into paragraphs to improve transcript readability.
6312
+ */
6313
+ paragraphs?: boolean;
6314
+ /**
6315
+ * Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely.
6316
+ */
6317
+ profanity_filter?: boolean;
6318
+ /**
6319
+ * Add punctuation and capitalization to the transcript.
6320
+ */
6321
+ punctuate?: boolean;
6322
+ /**
6323
+ * Redaction removes sensitive information from your transcripts.
6324
+ */
6325
+ redact?: string;
6326
+ /**
6327
+ * Search for terms or phrases in submitted audio and replaces them.
6328
+ */
6329
+ replace?: string;
6330
+ /**
6331
+ * Search for terms or phrases in submitted audio.
6332
+ */
6333
+ search?: string;
6334
+ /**
6335
+ * Recognizes the sentiment throughout a transcript or text.
6336
+ */
6337
+ sentiment?: boolean;
6338
+ /**
6339
+ * Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability.
6340
+ */
6341
+ smart_format?: boolean;
6342
+ /**
6343
+ * Detect topics throughout a transcript or text.
6344
+ */
6345
+ topics?: boolean;
6346
+ /**
6347
+ * Segments speech into meaningful semantic units.
6348
+ */
6349
+ utterances?: boolean;
6350
+ /**
6351
+ * Seconds to wait before detecting a pause between words in submitted audio.
6352
+ */
6353
+ utt_split?: number;
6354
+ /**
6355
+ * The number of channels in the submitted audio
6356
+ */
6357
+ channels?: number;
6358
+ /**
6359
+ * 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.
6360
+ */
6361
+ interim_results?: boolean;
6362
+ /**
6363
+ * 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
6364
+ */
6365
+ endpointing?: string;
6366
+ /**
6367
+ * Indicates that speech has started. You'll begin receiving Speech Started messages upon speech starting. Note: Supported only for webosockets.
6368
+ */
6369
+ vad_events?: boolean;
6370
+ /**
6371
+ * 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.
6372
+ */
6373
+ utterance_end_ms?: boolean;
6374
+ }
6375
+ export interface Ai_Cf_Deepgram_Nova_3_Output {
6376
+ results?: {
6377
+ channels?: {
6378
+ alternatives?: {
6379
+ confidence?: number;
6380
+ transcript?: string;
6381
+ words?: {
6382
+ confidence?: number;
6383
+ end?: number;
6384
+ start?: number;
6385
+ word?: string;
6386
+ }[];
6387
+ }[];
6388
+ }[];
6389
+ summary?: {
6390
+ result?: string;
6391
+ short?: string;
6392
+ };
6393
+ sentiments?: {
6394
+ segments?: {
6395
+ text?: string;
6396
+ start_word?: number;
6397
+ end_word?: number;
6398
+ sentiment?: string;
6399
+ sentiment_score?: number;
6400
+ }[];
6401
+ average?: {
6402
+ sentiment?: string;
6403
+ sentiment_score?: number;
6404
+ };
6405
+ };
6406
+ };
6407
+ }
6408
+ export declare abstract class Base_Ai_Cf_Deepgram_Nova_3 {
6409
+ inputs: Ai_Cf_Deepgram_Nova_3_Input;
6410
+ postProcessedOutputs: Ai_Cf_Deepgram_Nova_3_Output;
6411
+ }
6412
+ export type Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input =
6413
+ | {
6414
+ /**
6415
+ * readable stream with audio data and content-type specified for that data
6416
+ */
6417
+ audio: {
6418
+ body: object;
6419
+ contentType: string;
6420
+ };
6421
+ /**
6422
+ * type of data PCM data that's sent to the inference server as raw array
6423
+ */
6424
+ dtype?: "uint8" | "float32" | "float64";
6425
+ }
6426
+ | {
6427
+ /**
6428
+ * base64 encoded audio data
6429
+ */
6430
+ audio: string;
6431
+ /**
6432
+ * type of data PCM data that's sent to the inference server as raw array
6433
+ */
6434
+ dtype?: "uint8" | "float32" | "float64";
6435
+ };
6436
+ export interface Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output {
6437
+ /**
6438
+ * if true, end-of-turn was detected
6439
+ */
6440
+ is_complete?: boolean;
6441
+ /**
6442
+ * probability of the end-of-turn detection
6443
+ */
6444
+ probability?: number;
6445
+ }
6446
+ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
6447
+ inputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input;
6448
+ postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
6449
+ }
6450
+ export type Ai_Cf_Openai_Gpt_Oss_120B_Input =
6451
+ | GPT_OSS_120B_Responses
6452
+ | GPT_OSS_120B_Responses_Async;
6453
+ export interface GPT_OSS_120B_Responses {
6454
+ /**
6455
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6456
+ */
6457
+ input: string | unknown[];
6458
+ reasoning?: {
6459
+ /**
6460
+ * 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.
6461
+ */
6462
+ effort?: "low" | "medium" | "high";
6463
+ /**
6464
+ * 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.
6465
+ */
6466
+ summary?: "auto" | "concise" | "detailed";
6467
+ };
6468
+ }
6469
+ export interface GPT_OSS_120B_Responses_Async {
6470
+ requests: {
6471
+ /**
6472
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6473
+ */
6474
+ input: string | unknown[];
6475
+ reasoning?: {
6476
+ /**
6477
+ * 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.
6478
+ */
6479
+ effort?: "low" | "medium" | "high";
6480
+ /**
6481
+ * 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.
6482
+ */
6483
+ summary?: "auto" | "concise" | "detailed";
6484
+ };
6485
+ }[];
6486
+ }
6487
+ export type Ai_Cf_Openai_Gpt_Oss_120B_Output =
6488
+ | {}
6489
+ | (string & NonNullable<unknown>);
6490
+ export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
6491
+ inputs: Ai_Cf_Openai_Gpt_Oss_120B_Input;
6492
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_120B_Output;
6493
+ }
6494
+ export type Ai_Cf_Openai_Gpt_Oss_20B_Input =
6495
+ | GPT_OSS_20B_Responses
6496
+ | GPT_OSS_20B_Responses_Async;
6497
+ export interface GPT_OSS_20B_Responses {
6498
+ /**
6499
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6500
+ */
6501
+ input: string | unknown[];
6502
+ reasoning?: {
6503
+ /**
6504
+ * 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.
6505
+ */
6506
+ effort?: "low" | "medium" | "high";
6507
+ /**
6508
+ * 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.
6509
+ */
6510
+ summary?: "auto" | "concise" | "detailed";
6511
+ };
6512
+ }
6513
+ export interface GPT_OSS_20B_Responses_Async {
6514
+ requests: {
6515
+ /**
6516
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6517
+ */
6518
+ input: string | unknown[];
6519
+ reasoning?: {
6520
+ /**
6521
+ * 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.
6522
+ */
6523
+ effort?: "low" | "medium" | "high";
6524
+ /**
6525
+ * 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.
6526
+ */
6527
+ summary?: "auto" | "concise" | "detailed";
6528
+ };
6529
+ }[];
6530
+ }
6531
+ export type Ai_Cf_Openai_Gpt_Oss_20B_Output =
6532
+ | {}
6533
+ | (string & NonNullable<unknown>);
6534
+ export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
6535
+ inputs: Ai_Cf_Openai_Gpt_Oss_20B_Input;
6536
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_20B_Output;
6537
+ }
6538
+ export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
6539
+ /**
6540
+ * A text description of the image you want to generate.
6541
+ */
6542
+ prompt: string;
6543
+ /**
6544
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6545
+ */
6546
+ guidance?: number;
6547
+ /**
6548
+ * Random seed for reproducibility of the image generation
6549
+ */
6550
+ seed?: number;
6551
+ /**
6552
+ * The height of the generated image in pixels
6553
+ */
6554
+ height?: number;
6555
+ /**
6556
+ * The width of the generated image in pixels
6557
+ */
6558
+ width?: number;
6559
+ /**
6560
+ * The number of diffusion steps; higher values can improve quality but take longer
6561
+ */
6562
+ num_steps?: number;
6563
+ /**
6564
+ * Specify what to exclude from the generated images
6565
+ */
6566
+ negative_prompt?: string;
6567
+ }
6568
+ /**
6569
+ * The generated image in JPEG format
6570
+ */
6571
+ export type Ai_Cf_Leonardo_Phoenix_1_0_Output = string;
6572
+ export declare abstract class Base_Ai_Cf_Leonardo_Phoenix_1_0 {
6573
+ inputs: Ai_Cf_Leonardo_Phoenix_1_0_Input;
6574
+ postProcessedOutputs: Ai_Cf_Leonardo_Phoenix_1_0_Output;
6575
+ }
6576
+ export interface Ai_Cf_Leonardo_Lucid_Origin_Input {
6577
+ /**
6578
+ * A text description of the image you want to generate.
6579
+ */
6580
+ prompt: string;
6581
+ /**
6582
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6583
+ */
6584
+ guidance?: number;
6585
+ /**
6586
+ * Random seed for reproducibility of the image generation
6587
+ */
6588
+ seed?: number;
6589
+ /**
6590
+ * The height of the generated image in pixels
6591
+ */
6592
+ height?: number;
6593
+ /**
6594
+ * The width of the generated image in pixels
6595
+ */
6596
+ width?: number;
6597
+ /**
6598
+ * The number of diffusion steps; higher values can improve quality but take longer
6599
+ */
6600
+ num_steps?: number;
6601
+ /**
6602
+ * The number of diffusion steps; higher values can improve quality but take longer
6603
+ */
6604
+ steps?: number;
6605
+ }
6606
+ export interface Ai_Cf_Leonardo_Lucid_Origin_Output {
6607
+ /**
6608
+ * The generated image in Base64 format.
6609
+ */
6610
+ image?: string;
6611
+ }
6612
+ export declare abstract class Base_Ai_Cf_Leonardo_Lucid_Origin {
6613
+ inputs: Ai_Cf_Leonardo_Lucid_Origin_Input;
6614
+ postProcessedOutputs: Ai_Cf_Leonardo_Lucid_Origin_Output;
6615
+ }
6616
+ export interface Ai_Cf_Deepgram_Aura_1_Input {
6617
+ /**
6618
+ * Speaker used to produce the audio.
6619
+ */
6620
+ speaker?:
6621
+ | "angus"
6622
+ | "asteria"
6623
+ | "arcas"
6624
+ | "orion"
6625
+ | "orpheus"
6626
+ | "athena"
6627
+ | "luna"
6628
+ | "zeus"
6629
+ | "perseus"
6630
+ | "helios"
6631
+ | "hera"
6632
+ | "stella";
6633
+ /**
6634
+ * Encoding of the output audio.
6635
+ */
6636
+ encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac";
6637
+ /**
6638
+ * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..
6639
+ */
6640
+ container?: "none" | "wav" | "ogg";
6641
+ /**
6642
+ * The text content to be converted to speech
6643
+ */
6644
+ text: string;
6645
+ /**
6646
+ * 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
6647
+ */
6648
+ sample_rate?: number;
6649
+ /**
6650
+ * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.
6651
+ */
6652
+ bit_rate?: number;
6653
+ }
6654
+ /**
6655
+ * The generated audio in MP3 format
6656
+ */
6657
+ export type Ai_Cf_Deepgram_Aura_1_Output = string;
6658
+ export declare abstract class Base_Ai_Cf_Deepgram_Aura_1 {
6659
+ inputs: Ai_Cf_Deepgram_Aura_1_Input;
6660
+ postProcessedOutputs: Ai_Cf_Deepgram_Aura_1_Output;
6661
+ }
6662
+ export interface AiModels {
6663
+ "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
6664
+ "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
6665
+ "@cf/runwayml/stable-diffusion-v1-5-inpainting": BaseAiTextToImage;
6666
+ "@cf/runwayml/stable-diffusion-v1-5-img2img": BaseAiTextToImage;
6667
+ "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
6668
+ "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
6669
+ "@cf/myshell-ai/melotts": BaseAiTextToSpeech;
6670
+ "@cf/google/embeddinggemma-300m": BaseAiTextEmbeddings;
6671
+ "@cf/microsoft/resnet-50": BaseAiImageClassification;
6672
+ "@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
6673
+ "@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
6674
+ "@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
6675
+ "@hf/thebloke/llama-2-13b-chat-awq": BaseAiTextGeneration;
6676
+ "@hf/thebloke/mistral-7b-instruct-v0.1-awq": BaseAiTextGeneration;
6677
+ "@hf/thebloke/zephyr-7b-beta-awq": BaseAiTextGeneration;
6678
+ "@hf/thebloke/openhermes-2.5-mistral-7b-awq": BaseAiTextGeneration;
6679
+ "@hf/thebloke/neural-chat-7b-v3-1-awq": BaseAiTextGeneration;
6680
+ "@hf/thebloke/llamaguard-7b-awq": BaseAiTextGeneration;
6681
+ "@hf/thebloke/deepseek-coder-6.7b-base-awq": BaseAiTextGeneration;
6682
+ "@hf/thebloke/deepseek-coder-6.7b-instruct-awq": BaseAiTextGeneration;
6683
+ "@cf/deepseek-ai/deepseek-math-7b-instruct": BaseAiTextGeneration;
6684
+ "@cf/defog/sqlcoder-7b-2": BaseAiTextGeneration;
6685
+ "@cf/openchat/openchat-3.5-0106": BaseAiTextGeneration;
6686
+ "@cf/tiiuae/falcon-7b-instruct": BaseAiTextGeneration;
6687
+ "@cf/thebloke/discolm-german-7b-v1-awq": BaseAiTextGeneration;
6688
+ "@cf/qwen/qwen1.5-0.5b-chat": BaseAiTextGeneration;
6689
+ "@cf/qwen/qwen1.5-7b-chat-awq": BaseAiTextGeneration;
6690
+ "@cf/qwen/qwen1.5-14b-chat-awq": BaseAiTextGeneration;
6691
+ "@cf/tinyllama/tinyllama-1.1b-chat-v1.0": BaseAiTextGeneration;
6692
+ "@cf/microsoft/phi-2": BaseAiTextGeneration;
6693
+ "@cf/qwen/qwen1.5-1.8b-chat": BaseAiTextGeneration;
6694
+ "@cf/mistral/mistral-7b-instruct-v0.2-lora": BaseAiTextGeneration;
6695
+ "@hf/nousresearch/hermes-2-pro-mistral-7b": BaseAiTextGeneration;
6696
+ "@hf/nexusflow/starling-lm-7b-beta": BaseAiTextGeneration;
6697
+ "@hf/google/gemma-7b-it": BaseAiTextGeneration;
6698
+ "@cf/meta-llama/llama-2-7b-chat-hf-lora": BaseAiTextGeneration;
6699
+ "@cf/google/gemma-2b-it-lora": BaseAiTextGeneration;
6700
+ "@cf/google/gemma-7b-it-lora": BaseAiTextGeneration;
6701
+ "@hf/mistral/mistral-7b-instruct-v0.2": BaseAiTextGeneration;
6702
+ "@cf/meta/llama-3-8b-instruct": BaseAiTextGeneration;
6703
+ "@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
6704
+ "@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
6705
+ "@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
6706
+ "@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
6707
+ "@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
6708
+ "@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
6709
+ "@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;
6710
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": BaseAiTextGeneration;
6711
+ "@cf/facebook/bart-large-cnn": BaseAiSummarization;
6712
+ "@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;
6713
+ "@cf/baai/bge-base-en-v1.5": Base_Ai_Cf_Baai_Bge_Base_En_V1_5;
6714
+ "@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper;
6715
+ "@cf/meta/m2m100-1.2b": Base_Ai_Cf_Meta_M2M100_1_2B;
6716
+ "@cf/baai/bge-small-en-v1.5": Base_Ai_Cf_Baai_Bge_Small_En_V1_5;
6717
+ "@cf/baai/bge-large-en-v1.5": Base_Ai_Cf_Baai_Bge_Large_En_V1_5;
6718
+ "@cf/unum/uform-gen2-qwen-500m": Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M;
6719
+ "@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
6720
+ "@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
6721
+ "@cf/baai/bge-m3": Base_Ai_Cf_Baai_Bge_M3;
6722
+ "@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
6723
+ "@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct;
6724
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast": Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast;
6725
+ "@cf/meta/llama-guard-3-8b": Base_Ai_Cf_Meta_Llama_Guard_3_8B;
6726
+ "@cf/baai/bge-reranker-base": Base_Ai_Cf_Baai_Bge_Reranker_Base;
6727
+ "@cf/qwen/qwen2.5-coder-32b-instruct": Base_Ai_Cf_Qwen_Qwen2_5_Coder_32B_Instruct;
6180
6728
  "@cf/qwen/qwq-32b": Base_Ai_Cf_Qwen_Qwq_32B;
6181
6729
  "@cf/mistralai/mistral-small-3.1-24b-instruct": Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct;
6182
6730
  "@cf/google/gemma-3-12b-it": Base_Ai_Cf_Google_Gemma_3_12B_It;
6183
6731
  "@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;
6732
+ "@cf/deepgram/nova-3": Base_Ai_Cf_Deepgram_Nova_3;
6733
+ "@cf/pipecat-ai/smart-turn-v2": Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2;
6734
+ "@cf/openai/gpt-oss-120b": Base_Ai_Cf_Openai_Gpt_Oss_120B;
6735
+ "@cf/openai/gpt-oss-20b": Base_Ai_Cf_Openai_Gpt_Oss_20B;
6736
+ "@cf/leonardo/phoenix-1.0": Base_Ai_Cf_Leonardo_Phoenix_1_0;
6737
+ "@cf/leonardo/lucid-origin": Base_Ai_Cf_Leonardo_Lucid_Origin;
6738
+ "@cf/deepgram/aura-1": Base_Ai_Cf_Deepgram_Aura_1;
6184
6739
  }
6185
6740
  export type AiOptions = {
6186
6741
  /**
@@ -6188,6 +6743,10 @@ export type AiOptions = {
6188
6743
  * https://developers.cloudflare.com/workers-ai/features/batch-api
6189
6744
  */
6190
6745
  queueRequest?: boolean;
6746
+ /**
6747
+ * Establish websocket connections, only works for supported models
6748
+ */
6749
+ websocket?: boolean;
6191
6750
  gateway?: GatewayOptions;
6192
6751
  returnRawResponse?: boolean;
6193
6752
  prefix?: string;
@@ -6233,7 +6792,7 @@ export declare abstract class Ai<
6233
6792
  > {
6234
6793
  aiGatewayLogId: string | null;
6235
6794
  gateway(gatewayId: string): AiGateway;
6236
- autorag(autoragId?: string): AutoRAG;
6795
+ autorag(autoragId: string): AutoRAG;
6237
6796
  run<
6238
6797
  Name extends keyof AiModelList,
6239
6798
  Options extends AiOptions,
@@ -6243,9 +6802,13 @@ export declare abstract class Ai<
6243
6802
  inputs: InputOptions,
6244
6803
  options?: Options,
6245
6804
  ): Promise<
6246
- Options extends {
6247
- returnRawResponse: true;
6248
- }
6805
+ Options extends
6806
+ | {
6807
+ returnRawResponse: true;
6808
+ }
6809
+ | {
6810
+ websocket: true;
6811
+ }
6249
6812
  ? Response
6250
6813
  : InputOptions extends {
6251
6814
  stream: true;