@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.
@@ -289,7 +289,6 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
289
289
  FixedLengthStream: typeof FixedLengthStream;
290
290
  IdentityTransformStream: typeof IdentityTransformStream;
291
291
  HTMLRewriter: typeof HTMLRewriter;
292
- Performance: typeof Performance;
293
292
  }
294
293
  declare function addEventListener<Type extends keyof WorkerGlobalScopeEventMap>(
295
294
  type: Type,
@@ -462,6 +461,18 @@ declare abstract class Navigator {
462
461
  readonly userAgent: string;
463
462
  readonly hardwareConcurrency: number;
464
463
  }
464
+ /**
465
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
466
+ * as well as timing of subrequests and other operations.
467
+ *
468
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
469
+ */
470
+ interface Performance {
471
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
472
+ readonly timeOrigin: number;
473
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
474
+ now(): number;
475
+ }
465
476
  interface AlarmInvocationInfo {
466
477
  readonly isRetry: boolean;
467
478
  readonly retryCount: number;
@@ -3143,18 +3154,6 @@ interface WorkerLoaderWorkerCode {
3143
3154
  tails?: Fetcher[];
3144
3155
  streamingTails?: Fetcher[];
3145
3156
  }
3146
- /**
3147
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3148
- * as well as timing of subrequests and other operations.
3149
- *
3150
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3151
- */
3152
- declare abstract class Performance {
3153
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3154
- get timeOrigin(): number;
3155
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3156
- now(): number;
3157
- }
3158
3157
  type AiImageClassificationInput = {
3159
3158
  image: number[];
3160
3159
  };
@@ -3209,6 +3208,18 @@ declare abstract class BaseAiImageTextToText {
3209
3208
  inputs: AiImageTextToTextInput;
3210
3209
  postProcessedOutputs: AiImageTextToTextOutput;
3211
3210
  }
3211
+ type AiMultimodalEmbeddingsInput = {
3212
+ image: string;
3213
+ text: string[];
3214
+ };
3215
+ type AiIMultimodalEmbeddingsOutput = {
3216
+ data: number[][];
3217
+ shape: number[];
3218
+ };
3219
+ declare abstract class BaseAiMultimodalEmbeddings {
3220
+ inputs: AiImageTextToTextInput;
3221
+ postProcessedOutputs: AiImageTextToTextOutput;
3222
+ }
3212
3223
  type AiObjectDetectionInput = {
3213
3224
  image: number[];
3214
3225
  };
@@ -3347,12 +3358,28 @@ type AiTextGenerationInput = {
3347
3358
  | (object & NonNullable<unknown>);
3348
3359
  functions?: AiTextGenerationFunctionsInput[];
3349
3360
  };
3361
+ type AiTextGenerationToolLegacyOutput = {
3362
+ name: string;
3363
+ arguments: unknown;
3364
+ };
3365
+ type AiTextGenerationToolOutput = {
3366
+ id: string;
3367
+ type: "function";
3368
+ function: {
3369
+ name: string;
3370
+ arguments: string;
3371
+ };
3372
+ };
3373
+ type UsageTags = {
3374
+ prompt_tokens: number;
3375
+ completion_tokens: number;
3376
+ total_tokens: number;
3377
+ };
3350
3378
  type AiTextGenerationOutput = {
3351
3379
  response?: string;
3352
- tool_calls?: {
3353
- name: string;
3354
- arguments: unknown;
3355
- }[];
3380
+ tool_calls?: AiTextGenerationToolLegacyOutput[] &
3381
+ AiTextGenerationToolOutput[];
3382
+ usage?: UsageTags;
3356
3383
  };
3357
3384
  declare abstract class BaseAiTextGeneration {
3358
3385
  inputs: AiTextGenerationInput;
@@ -4441,6 +4468,7 @@ type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output =
4441
4468
  name?: string;
4442
4469
  }[];
4443
4470
  }
4471
+ | string
4444
4472
  | AsyncResponse;
4445
4473
  declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast {
4446
4474
  inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input;
@@ -4517,7 +4545,6 @@ interface Ai_Cf_Baai_Bge_Reranker_Base_Input {
4517
4545
  /**
4518
4546
  * A query you wish to perform against the provided contexts.
4519
4547
  */
4520
- query: string;
4521
4548
  /**
4522
4549
  * Number of returned results starting with the best score.
4523
4550
  */
@@ -5610,7 +5637,8 @@ declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It {
5610
5637
  }
5611
5638
  type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input =
5612
5639
  | Ai_Cf_Meta_Llama_4_Prompt
5613
- | Ai_Cf_Meta_Llama_4_Messages;
5640
+ | Ai_Cf_Meta_Llama_4_Messages
5641
+ | Ai_Cf_Meta_Llama_4_Async_Batch;
5614
5642
  interface Ai_Cf_Meta_Llama_4_Prompt {
5615
5643
  /**
5616
5644
  * The input text prompt for the model to generate a response.
@@ -5844,6 +5872,245 @@ interface Ai_Cf_Meta_Llama_4_Messages {
5844
5872
  */
5845
5873
  presence_penalty?: number;
5846
5874
  }
5875
+ interface Ai_Cf_Meta_Llama_4_Async_Batch {
5876
+ requests: (
5877
+ | Ai_Cf_Meta_Llama_4_Prompt_Inner
5878
+ | Ai_Cf_Meta_Llama_4_Messages_Inner
5879
+ )[];
5880
+ }
5881
+ interface Ai_Cf_Meta_Llama_4_Prompt_Inner {
5882
+ /**
5883
+ * The input text prompt for the model to generate a response.
5884
+ */
5885
+ prompt: string;
5886
+ /**
5887
+ * JSON schema that should be fulfilled for the response.
5888
+ */
5889
+ guided_json?: object;
5890
+ response_format?: JSONMode;
5891
+ /**
5892
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
5893
+ */
5894
+ raw?: boolean;
5895
+ /**
5896
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
5897
+ */
5898
+ stream?: boolean;
5899
+ /**
5900
+ * The maximum number of tokens to generate in the response.
5901
+ */
5902
+ max_tokens?: number;
5903
+ /**
5904
+ * Controls the randomness of the output; higher values produce more random results.
5905
+ */
5906
+ temperature?: number;
5907
+ /**
5908
+ * 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.
5909
+ */
5910
+ top_p?: number;
5911
+ /**
5912
+ * 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.
5913
+ */
5914
+ top_k?: number;
5915
+ /**
5916
+ * Random seed for reproducibility of the generation.
5917
+ */
5918
+ seed?: number;
5919
+ /**
5920
+ * Penalty for repeated tokens; higher values discourage repetition.
5921
+ */
5922
+ repetition_penalty?: number;
5923
+ /**
5924
+ * Decreases the likelihood of the model repeating the same lines verbatim.
5925
+ */
5926
+ frequency_penalty?: number;
5927
+ /**
5928
+ * Increases the likelihood of the model introducing new topics.
5929
+ */
5930
+ presence_penalty?: number;
5931
+ }
5932
+ interface Ai_Cf_Meta_Llama_4_Messages_Inner {
5933
+ /**
5934
+ * An array of message objects representing the conversation history.
5935
+ */
5936
+ messages: {
5937
+ /**
5938
+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
5939
+ */
5940
+ role?: string;
5941
+ /**
5942
+ * The tool call id. If you don't know what to put here you can fall back to 000000001
5943
+ */
5944
+ tool_call_id?: string;
5945
+ content?:
5946
+ | string
5947
+ | {
5948
+ /**
5949
+ * Type of the content provided
5950
+ */
5951
+ type?: string;
5952
+ text?: string;
5953
+ image_url?: {
5954
+ /**
5955
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5956
+ */
5957
+ url?: string;
5958
+ };
5959
+ }[]
5960
+ | {
5961
+ /**
5962
+ * Type of the content provided
5963
+ */
5964
+ type?: string;
5965
+ text?: string;
5966
+ image_url?: {
5967
+ /**
5968
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5969
+ */
5970
+ url?: string;
5971
+ };
5972
+ };
5973
+ }[];
5974
+ functions?: {
5975
+ name: string;
5976
+ code: string;
5977
+ }[];
5978
+ /**
5979
+ * A list of tools available for the assistant to use.
5980
+ */
5981
+ tools?: (
5982
+ | {
5983
+ /**
5984
+ * The name of the tool. More descriptive the better.
5985
+ */
5986
+ name: string;
5987
+ /**
5988
+ * A brief description of what the tool does.
5989
+ */
5990
+ description: string;
5991
+ /**
5992
+ * Schema defining the parameters accepted by the tool.
5993
+ */
5994
+ parameters: {
5995
+ /**
5996
+ * The type of the parameters object (usually 'object').
5997
+ */
5998
+ type: string;
5999
+ /**
6000
+ * List of required parameter names.
6001
+ */
6002
+ required?: string[];
6003
+ /**
6004
+ * Definitions of each parameter.
6005
+ */
6006
+ properties: {
6007
+ [k: string]: {
6008
+ /**
6009
+ * The data type of the parameter.
6010
+ */
6011
+ type: string;
6012
+ /**
6013
+ * A description of the expected parameter.
6014
+ */
6015
+ description: string;
6016
+ };
6017
+ };
6018
+ };
6019
+ }
6020
+ | {
6021
+ /**
6022
+ * Specifies the type of tool (e.g., 'function').
6023
+ */
6024
+ type: string;
6025
+ /**
6026
+ * Details of the function tool.
6027
+ */
6028
+ function: {
6029
+ /**
6030
+ * The name of the function.
6031
+ */
6032
+ name: string;
6033
+ /**
6034
+ * A brief description of what the function does.
6035
+ */
6036
+ description: string;
6037
+ /**
6038
+ * Schema defining the parameters accepted by the function.
6039
+ */
6040
+ parameters: {
6041
+ /**
6042
+ * The type of the parameters object (usually 'object').
6043
+ */
6044
+ type: string;
6045
+ /**
6046
+ * List of required parameter names.
6047
+ */
6048
+ required?: string[];
6049
+ /**
6050
+ * Definitions of each parameter.
6051
+ */
6052
+ properties: {
6053
+ [k: string]: {
6054
+ /**
6055
+ * The data type of the parameter.
6056
+ */
6057
+ type: string;
6058
+ /**
6059
+ * A description of the expected parameter.
6060
+ */
6061
+ description: string;
6062
+ };
6063
+ };
6064
+ };
6065
+ };
6066
+ }
6067
+ )[];
6068
+ response_format?: JSONMode;
6069
+ /**
6070
+ * JSON schema that should be fufilled for the response.
6071
+ */
6072
+ guided_json?: object;
6073
+ /**
6074
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6075
+ */
6076
+ raw?: boolean;
6077
+ /**
6078
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6079
+ */
6080
+ stream?: boolean;
6081
+ /**
6082
+ * The maximum number of tokens to generate in the response.
6083
+ */
6084
+ max_tokens?: number;
6085
+ /**
6086
+ * Controls the randomness of the output; higher values produce more random results.
6087
+ */
6088
+ temperature?: number;
6089
+ /**
6090
+ * 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.
6091
+ */
6092
+ top_p?: number;
6093
+ /**
6094
+ * 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.
6095
+ */
6096
+ top_k?: number;
6097
+ /**
6098
+ * Random seed for reproducibility of the generation.
6099
+ */
6100
+ seed?: number;
6101
+ /**
6102
+ * Penalty for repeated tokens; higher values discourage repetition.
6103
+ */
6104
+ repetition_penalty?: number;
6105
+ /**
6106
+ * Decreases the likelihood of the model repeating the same lines verbatim.
6107
+ */
6108
+ frequency_penalty?: number;
6109
+ /**
6110
+ * Increases the likelihood of the model introducing new topics.
6111
+ */
6112
+ presence_penalty?: number;
6113
+ }
5847
6114
  type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = {
5848
6115
  /**
5849
6116
  * The generated text response from the model
@@ -5897,6 +6164,443 @@ declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {
5897
6164
  inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;
5898
6165
  postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;
5899
6166
  }
6167
+ interface Ai_Cf_Deepgram_Nova_3_Input {
6168
+ audio: {
6169
+ body: object;
6170
+ contentType: string;
6171
+ };
6172
+ /**
6173
+ * 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.
6174
+ */
6175
+ custom_topic_mode?: "extended" | "strict";
6176
+ /**
6177
+ * Custom topics you want the model to detect within your input audio or text if present Submit up to 100
6178
+ */
6179
+ custom_topic?: string;
6180
+ /**
6181
+ * 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
6182
+ */
6183
+ custom_intent_mode?: "extended" | "strict";
6184
+ /**
6185
+ * Custom intents you want the model to detect within your input audio if present
6186
+ */
6187
+ custom_intent?: string;
6188
+ /**
6189
+ * Identifies and extracts key entities from content in submitted audio
6190
+ */
6191
+ detect_entities?: boolean;
6192
+ /**
6193
+ * Identifies the dominant language spoken in submitted audio
6194
+ */
6195
+ detect_language?: boolean;
6196
+ /**
6197
+ * Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0
6198
+ */
6199
+ diarize?: boolean;
6200
+ /**
6201
+ * Identify and extract key entities from content in submitted audio
6202
+ */
6203
+ dictation?: boolean;
6204
+ /**
6205
+ * Specify the expected encoding of your submitted audio
6206
+ */
6207
+ encoding?:
6208
+ | "linear16"
6209
+ | "flac"
6210
+ | "mulaw"
6211
+ | "amr-nb"
6212
+ | "amr-wb"
6213
+ | "opus"
6214
+ | "speex"
6215
+ | "g729";
6216
+ /**
6217
+ * Arbitrary key-value pairs that are attached to the API response for usage in downstream processing
6218
+ */
6219
+ extra?: string;
6220
+ /**
6221
+ * Filler Words can help transcribe interruptions in your audio, like 'uh' and 'um'
6222
+ */
6223
+ filler_words?: boolean;
6224
+ /**
6225
+ * Key term prompting can boost or suppress specialized terminology and brands.
6226
+ */
6227
+ keyterm?: string;
6228
+ /**
6229
+ * Keywords can boost or suppress specialized terminology and brands.
6230
+ */
6231
+ keywords?: string;
6232
+ /**
6233
+ * 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.
6234
+ */
6235
+ language?: string;
6236
+ /**
6237
+ * Spoken measurements will be converted to their corresponding abbreviations.
6238
+ */
6239
+ measurements?: boolean;
6240
+ /**
6241
+ * 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.
6242
+ */
6243
+ mip_opt_out?: boolean;
6244
+ /**
6245
+ * Mode of operation for the model representing broad area of topic that will be talked about in the supplied audio
6246
+ */
6247
+ mode?: "general" | "medical" | "finance";
6248
+ /**
6249
+ * Transcribe each audio channel independently.
6250
+ */
6251
+ multichannel?: boolean;
6252
+ /**
6253
+ * Numerals converts numbers from written format to numerical format.
6254
+ */
6255
+ numerals?: boolean;
6256
+ /**
6257
+ * Splits audio into paragraphs to improve transcript readability.
6258
+ */
6259
+ paragraphs?: boolean;
6260
+ /**
6261
+ * Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely.
6262
+ */
6263
+ profanity_filter?: boolean;
6264
+ /**
6265
+ * Add punctuation and capitalization to the transcript.
6266
+ */
6267
+ punctuate?: boolean;
6268
+ /**
6269
+ * Redaction removes sensitive information from your transcripts.
6270
+ */
6271
+ redact?: string;
6272
+ /**
6273
+ * Search for terms or phrases in submitted audio and replaces them.
6274
+ */
6275
+ replace?: string;
6276
+ /**
6277
+ * Search for terms or phrases in submitted audio.
6278
+ */
6279
+ search?: string;
6280
+ /**
6281
+ * Recognizes the sentiment throughout a transcript or text.
6282
+ */
6283
+ sentiment?: boolean;
6284
+ /**
6285
+ * Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability.
6286
+ */
6287
+ smart_format?: boolean;
6288
+ /**
6289
+ * Detect topics throughout a transcript or text.
6290
+ */
6291
+ topics?: boolean;
6292
+ /**
6293
+ * Segments speech into meaningful semantic units.
6294
+ */
6295
+ utterances?: boolean;
6296
+ /**
6297
+ * Seconds to wait before detecting a pause between words in submitted audio.
6298
+ */
6299
+ utt_split?: number;
6300
+ /**
6301
+ * The number of channels in the submitted audio
6302
+ */
6303
+ channels?: number;
6304
+ /**
6305
+ * 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.
6306
+ */
6307
+ interim_results?: boolean;
6308
+ /**
6309
+ * 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
6310
+ */
6311
+ endpointing?: string;
6312
+ /**
6313
+ * Indicates that speech has started. You'll begin receiving Speech Started messages upon speech starting. Note: Supported only for webosockets.
6314
+ */
6315
+ vad_events?: boolean;
6316
+ /**
6317
+ * 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.
6318
+ */
6319
+ utterance_end_ms?: boolean;
6320
+ }
6321
+ interface Ai_Cf_Deepgram_Nova_3_Output {
6322
+ results?: {
6323
+ channels?: {
6324
+ alternatives?: {
6325
+ confidence?: number;
6326
+ transcript?: string;
6327
+ words?: {
6328
+ confidence?: number;
6329
+ end?: number;
6330
+ start?: number;
6331
+ word?: string;
6332
+ }[];
6333
+ }[];
6334
+ }[];
6335
+ summary?: {
6336
+ result?: string;
6337
+ short?: string;
6338
+ };
6339
+ sentiments?: {
6340
+ segments?: {
6341
+ text?: string;
6342
+ start_word?: number;
6343
+ end_word?: number;
6344
+ sentiment?: string;
6345
+ sentiment_score?: number;
6346
+ }[];
6347
+ average?: {
6348
+ sentiment?: string;
6349
+ sentiment_score?: number;
6350
+ };
6351
+ };
6352
+ };
6353
+ }
6354
+ declare abstract class Base_Ai_Cf_Deepgram_Nova_3 {
6355
+ inputs: Ai_Cf_Deepgram_Nova_3_Input;
6356
+ postProcessedOutputs: Ai_Cf_Deepgram_Nova_3_Output;
6357
+ }
6358
+ type Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input =
6359
+ | {
6360
+ /**
6361
+ * readable stream with audio data and content-type specified for that data
6362
+ */
6363
+ audio: {
6364
+ body: object;
6365
+ contentType: string;
6366
+ };
6367
+ /**
6368
+ * type of data PCM data that's sent to the inference server as raw array
6369
+ */
6370
+ dtype?: "uint8" | "float32" | "float64";
6371
+ }
6372
+ | {
6373
+ /**
6374
+ * base64 encoded audio data
6375
+ */
6376
+ audio: string;
6377
+ /**
6378
+ * type of data PCM data that's sent to the inference server as raw array
6379
+ */
6380
+ dtype?: "uint8" | "float32" | "float64";
6381
+ };
6382
+ interface Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output {
6383
+ /**
6384
+ * if true, end-of-turn was detected
6385
+ */
6386
+ is_complete?: boolean;
6387
+ /**
6388
+ * probability of the end-of-turn detection
6389
+ */
6390
+ probability?: number;
6391
+ }
6392
+ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
6393
+ inputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input;
6394
+ postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
6395
+ }
6396
+ type Ai_Cf_Openai_Gpt_Oss_120B_Input =
6397
+ | GPT_OSS_120B_Responses
6398
+ | GPT_OSS_120B_Responses_Async;
6399
+ interface GPT_OSS_120B_Responses {
6400
+ /**
6401
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6402
+ */
6403
+ input: string | unknown[];
6404
+ reasoning?: {
6405
+ /**
6406
+ * 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.
6407
+ */
6408
+ effort?: "low" | "medium" | "high";
6409
+ /**
6410
+ * 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.
6411
+ */
6412
+ summary?: "auto" | "concise" | "detailed";
6413
+ };
6414
+ }
6415
+ interface GPT_OSS_120B_Responses_Async {
6416
+ requests: {
6417
+ /**
6418
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6419
+ */
6420
+ input: string | unknown[];
6421
+ reasoning?: {
6422
+ /**
6423
+ * 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.
6424
+ */
6425
+ effort?: "low" | "medium" | "high";
6426
+ /**
6427
+ * 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.
6428
+ */
6429
+ summary?: "auto" | "concise" | "detailed";
6430
+ };
6431
+ }[];
6432
+ }
6433
+ type Ai_Cf_Openai_Gpt_Oss_120B_Output = {} | (string & NonNullable<unknown>);
6434
+ declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
6435
+ inputs: Ai_Cf_Openai_Gpt_Oss_120B_Input;
6436
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_120B_Output;
6437
+ }
6438
+ type Ai_Cf_Openai_Gpt_Oss_20B_Input =
6439
+ | GPT_OSS_20B_Responses
6440
+ | GPT_OSS_20B_Responses_Async;
6441
+ interface GPT_OSS_20B_Responses {
6442
+ /**
6443
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6444
+ */
6445
+ input: string | unknown[];
6446
+ reasoning?: {
6447
+ /**
6448
+ * 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.
6449
+ */
6450
+ effort?: "low" | "medium" | "high";
6451
+ /**
6452
+ * 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.
6453
+ */
6454
+ summary?: "auto" | "concise" | "detailed";
6455
+ };
6456
+ }
6457
+ interface GPT_OSS_20B_Responses_Async {
6458
+ requests: {
6459
+ /**
6460
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6461
+ */
6462
+ input: string | unknown[];
6463
+ reasoning?: {
6464
+ /**
6465
+ * 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.
6466
+ */
6467
+ effort?: "low" | "medium" | "high";
6468
+ /**
6469
+ * 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.
6470
+ */
6471
+ summary?: "auto" | "concise" | "detailed";
6472
+ };
6473
+ }[];
6474
+ }
6475
+ type Ai_Cf_Openai_Gpt_Oss_20B_Output = {} | (string & NonNullable<unknown>);
6476
+ declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
6477
+ inputs: Ai_Cf_Openai_Gpt_Oss_20B_Input;
6478
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_20B_Output;
6479
+ }
6480
+ interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
6481
+ /**
6482
+ * A text description of the image you want to generate.
6483
+ */
6484
+ prompt: string;
6485
+ /**
6486
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6487
+ */
6488
+ guidance?: number;
6489
+ /**
6490
+ * Random seed for reproducibility of the image generation
6491
+ */
6492
+ seed?: number;
6493
+ /**
6494
+ * The height of the generated image in pixels
6495
+ */
6496
+ height?: number;
6497
+ /**
6498
+ * The width of the generated image in pixels
6499
+ */
6500
+ width?: number;
6501
+ /**
6502
+ * The number of diffusion steps; higher values can improve quality but take longer
6503
+ */
6504
+ num_steps?: number;
6505
+ /**
6506
+ * Specify what to exclude from the generated images
6507
+ */
6508
+ negative_prompt?: string;
6509
+ }
6510
+ /**
6511
+ * The generated image in JPEG format
6512
+ */
6513
+ type Ai_Cf_Leonardo_Phoenix_1_0_Output = string;
6514
+ declare abstract class Base_Ai_Cf_Leonardo_Phoenix_1_0 {
6515
+ inputs: Ai_Cf_Leonardo_Phoenix_1_0_Input;
6516
+ postProcessedOutputs: Ai_Cf_Leonardo_Phoenix_1_0_Output;
6517
+ }
6518
+ interface Ai_Cf_Leonardo_Lucid_Origin_Input {
6519
+ /**
6520
+ * A text description of the image you want to generate.
6521
+ */
6522
+ prompt: string;
6523
+ /**
6524
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6525
+ */
6526
+ guidance?: number;
6527
+ /**
6528
+ * Random seed for reproducibility of the image generation
6529
+ */
6530
+ seed?: number;
6531
+ /**
6532
+ * The height of the generated image in pixels
6533
+ */
6534
+ height?: number;
6535
+ /**
6536
+ * The width of the generated image in pixels
6537
+ */
6538
+ width?: number;
6539
+ /**
6540
+ * The number of diffusion steps; higher values can improve quality but take longer
6541
+ */
6542
+ num_steps?: number;
6543
+ /**
6544
+ * The number of diffusion steps; higher values can improve quality but take longer
6545
+ */
6546
+ steps?: number;
6547
+ }
6548
+ interface Ai_Cf_Leonardo_Lucid_Origin_Output {
6549
+ /**
6550
+ * The generated image in Base64 format.
6551
+ */
6552
+ image?: string;
6553
+ }
6554
+ declare abstract class Base_Ai_Cf_Leonardo_Lucid_Origin {
6555
+ inputs: Ai_Cf_Leonardo_Lucid_Origin_Input;
6556
+ postProcessedOutputs: Ai_Cf_Leonardo_Lucid_Origin_Output;
6557
+ }
6558
+ interface Ai_Cf_Deepgram_Aura_1_Input {
6559
+ /**
6560
+ * Speaker used to produce the audio.
6561
+ */
6562
+ speaker?:
6563
+ | "angus"
6564
+ | "asteria"
6565
+ | "arcas"
6566
+ | "orion"
6567
+ | "orpheus"
6568
+ | "athena"
6569
+ | "luna"
6570
+ | "zeus"
6571
+ | "perseus"
6572
+ | "helios"
6573
+ | "hera"
6574
+ | "stella";
6575
+ /**
6576
+ * Encoding of the output audio.
6577
+ */
6578
+ encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac";
6579
+ /**
6580
+ * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..
6581
+ */
6582
+ container?: "none" | "wav" | "ogg";
6583
+ /**
6584
+ * The text content to be converted to speech
6585
+ */
6586
+ text: string;
6587
+ /**
6588
+ * 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
6589
+ */
6590
+ sample_rate?: number;
6591
+ /**
6592
+ * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.
6593
+ */
6594
+ bit_rate?: number;
6595
+ }
6596
+ /**
6597
+ * The generated audio in MP3 format
6598
+ */
6599
+ type Ai_Cf_Deepgram_Aura_1_Output = string;
6600
+ declare abstract class Base_Ai_Cf_Deepgram_Aura_1 {
6601
+ inputs: Ai_Cf_Deepgram_Aura_1_Input;
6602
+ postProcessedOutputs: Ai_Cf_Deepgram_Aura_1_Output;
6603
+ }
5900
6604
  interface AiModels {
5901
6605
  "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
5902
6606
  "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
@@ -5905,8 +6609,8 @@ interface AiModels {
5905
6609
  "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
5906
6610
  "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
5907
6611
  "@cf/myshell-ai/melotts": BaseAiTextToSpeech;
6612
+ "@cf/google/embeddinggemma-300m": BaseAiTextEmbeddings;
5908
6613
  "@cf/microsoft/resnet-50": BaseAiImageClassification;
5909
- "@cf/facebook/detr-resnet-50": BaseAiObjectDetection;
5910
6614
  "@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
5911
6615
  "@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
5912
6616
  "@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
@@ -5941,7 +6645,6 @@ interface AiModels {
5941
6645
  "@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
5942
6646
  "@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
5943
6647
  "@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
5944
- "@cf/meta/llama-3.1-8b-instruct": BaseAiTextGeneration;
5945
6648
  "@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
5946
6649
  "@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
5947
6650
  "@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
@@ -5968,6 +6671,13 @@ interface AiModels {
5968
6671
  "@cf/mistralai/mistral-small-3.1-24b-instruct": Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct;
5969
6672
  "@cf/google/gemma-3-12b-it": Base_Ai_Cf_Google_Gemma_3_12B_It;
5970
6673
  "@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;
6674
+ "@cf/deepgram/nova-3": Base_Ai_Cf_Deepgram_Nova_3;
6675
+ "@cf/pipecat-ai/smart-turn-v2": Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2;
6676
+ "@cf/openai/gpt-oss-120b": Base_Ai_Cf_Openai_Gpt_Oss_120B;
6677
+ "@cf/openai/gpt-oss-20b": Base_Ai_Cf_Openai_Gpt_Oss_20B;
6678
+ "@cf/leonardo/phoenix-1.0": Base_Ai_Cf_Leonardo_Phoenix_1_0;
6679
+ "@cf/leonardo/lucid-origin": Base_Ai_Cf_Leonardo_Lucid_Origin;
6680
+ "@cf/deepgram/aura-1": Base_Ai_Cf_Deepgram_Aura_1;
5971
6681
  }
5972
6682
  type AiOptions = {
5973
6683
  /**
@@ -5975,6 +6685,10 @@ type AiOptions = {
5975
6685
  * https://developers.cloudflare.com/workers-ai/features/batch-api
5976
6686
  */
5977
6687
  queueRequest?: boolean;
6688
+ /**
6689
+ * Establish websocket connections, only works for supported models
6690
+ */
6691
+ websocket?: boolean;
5978
6692
  gateway?: GatewayOptions;
5979
6693
  returnRawResponse?: boolean;
5980
6694
  prefix?: string;
@@ -6018,7 +6732,7 @@ type AiModelListType = Record<string, any>;
6018
6732
  declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
6019
6733
  aiGatewayLogId: string | null;
6020
6734
  gateway(gatewayId: string): AiGateway;
6021
- autorag(autoragId?: string): AutoRAG;
6735
+ autorag(autoragId: string): AutoRAG;
6022
6736
  run<
6023
6737
  Name extends keyof AiModelList,
6024
6738
  Options extends AiOptions,
@@ -6028,9 +6742,13 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
6028
6742
  inputs: InputOptions,
6029
6743
  options?: Options,
6030
6744
  ): Promise<
6031
- Options extends {
6032
- returnRawResponse: true;
6033
- }
6745
+ Options extends
6746
+ | {
6747
+ returnRawResponse: true;
6748
+ }
6749
+ | {
6750
+ websocket: true;
6751
+ }
6034
6752
  ? Response
6035
6753
  : InputOptions extends {
6036
6754
  stream: true;