@cloudflare/workers-types 4.20250917.0 → 4.20250919.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.d.ts CHANGED
@@ -470,18 +470,6 @@ declare abstract class Navigator {
470
470
  readonly language: string;
471
471
  readonly languages: string[];
472
472
  }
473
- /**
474
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
475
- * as well as timing of subrequests and other operations.
476
- *
477
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
478
- */
479
- interface Performance {
480
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
481
- readonly timeOrigin: number;
482
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
483
- now(): number;
484
- }
485
473
  interface AlarmInvocationInfo {
486
474
  readonly isRetry: boolean;
487
475
  readonly retryCount: number;
@@ -3195,6 +3183,18 @@ interface WorkerLoaderWorkerCode {
3195
3183
  tails?: Fetcher[];
3196
3184
  streamingTails?: Fetcher[];
3197
3185
  }
3186
+ /**
3187
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3188
+ * as well as timing of subrequests and other operations.
3189
+ *
3190
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3191
+ */
3192
+ declare abstract class Performance {
3193
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3194
+ get timeOrigin(): number;
3195
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3196
+ now(): number;
3197
+ }
3198
3198
  type AiImageClassificationInput = {
3199
3199
  image: number[];
3200
3200
  };
@@ -3249,6 +3249,18 @@ declare abstract class BaseAiImageTextToText {
3249
3249
  inputs: AiImageTextToTextInput;
3250
3250
  postProcessedOutputs: AiImageTextToTextOutput;
3251
3251
  }
3252
+ type AiMultimodalEmbeddingsInput = {
3253
+ image: string;
3254
+ text: string[];
3255
+ };
3256
+ type AiIMultimodalEmbeddingsOutput = {
3257
+ data: number[][];
3258
+ shape: number[];
3259
+ };
3260
+ declare abstract class BaseAiMultimodalEmbeddings {
3261
+ inputs: AiImageTextToTextInput;
3262
+ postProcessedOutputs: AiImageTextToTextOutput;
3263
+ }
3252
3264
  type AiObjectDetectionInput = {
3253
3265
  image: number[];
3254
3266
  };
@@ -3387,12 +3399,28 @@ type AiTextGenerationInput = {
3387
3399
  | (object & NonNullable<unknown>);
3388
3400
  functions?: AiTextGenerationFunctionsInput[];
3389
3401
  };
3402
+ type AiTextGenerationToolLegacyOutput = {
3403
+ name: string;
3404
+ arguments: unknown;
3405
+ };
3406
+ type AiTextGenerationToolOutput = {
3407
+ id: string;
3408
+ type: "function";
3409
+ function: {
3410
+ name: string;
3411
+ arguments: string;
3412
+ };
3413
+ };
3414
+ type UsageTags = {
3415
+ prompt_tokens: number;
3416
+ completion_tokens: number;
3417
+ total_tokens: number;
3418
+ };
3390
3419
  type AiTextGenerationOutput = {
3391
3420
  response?: string;
3392
- tool_calls?: {
3393
- name: string;
3394
- arguments: unknown;
3395
- }[];
3421
+ tool_calls?: AiTextGenerationToolLegacyOutput[] &
3422
+ AiTextGenerationToolOutput[];
3423
+ usage?: UsageTags;
3396
3424
  };
3397
3425
  declare abstract class BaseAiTextGeneration {
3398
3426
  inputs: AiTextGenerationInput;
@@ -4481,6 +4509,7 @@ type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output =
4481
4509
  name?: string;
4482
4510
  }[];
4483
4511
  }
4512
+ | string
4484
4513
  | AsyncResponse;
4485
4514
  declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast {
4486
4515
  inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input;
@@ -4557,7 +4586,6 @@ interface Ai_Cf_Baai_Bge_Reranker_Base_Input {
4557
4586
  /**
4558
4587
  * A query you wish to perform against the provided contexts.
4559
4588
  */
4560
- query: string;
4561
4589
  /**
4562
4590
  * Number of returned results starting with the best score.
4563
4591
  */
@@ -5650,7 +5678,8 @@ declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It {
5650
5678
  }
5651
5679
  type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input =
5652
5680
  | Ai_Cf_Meta_Llama_4_Prompt
5653
- | Ai_Cf_Meta_Llama_4_Messages;
5681
+ | Ai_Cf_Meta_Llama_4_Messages
5682
+ | Ai_Cf_Meta_Llama_4_Async_Batch;
5654
5683
  interface Ai_Cf_Meta_Llama_4_Prompt {
5655
5684
  /**
5656
5685
  * The input text prompt for the model to generate a response.
@@ -5884,6 +5913,245 @@ interface Ai_Cf_Meta_Llama_4_Messages {
5884
5913
  */
5885
5914
  presence_penalty?: number;
5886
5915
  }
5916
+ interface Ai_Cf_Meta_Llama_4_Async_Batch {
5917
+ requests: (
5918
+ | Ai_Cf_Meta_Llama_4_Prompt_Inner
5919
+ | Ai_Cf_Meta_Llama_4_Messages_Inner
5920
+ )[];
5921
+ }
5922
+ interface Ai_Cf_Meta_Llama_4_Prompt_Inner {
5923
+ /**
5924
+ * The input text prompt for the model to generate a response.
5925
+ */
5926
+ prompt: string;
5927
+ /**
5928
+ * JSON schema that should be fulfilled for the response.
5929
+ */
5930
+ guided_json?: object;
5931
+ response_format?: JSONMode;
5932
+ /**
5933
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
5934
+ */
5935
+ raw?: boolean;
5936
+ /**
5937
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
5938
+ */
5939
+ stream?: boolean;
5940
+ /**
5941
+ * The maximum number of tokens to generate in the response.
5942
+ */
5943
+ max_tokens?: number;
5944
+ /**
5945
+ * Controls the randomness of the output; higher values produce more random results.
5946
+ */
5947
+ temperature?: number;
5948
+ /**
5949
+ * 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.
5950
+ */
5951
+ top_p?: number;
5952
+ /**
5953
+ * 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.
5954
+ */
5955
+ top_k?: number;
5956
+ /**
5957
+ * Random seed for reproducibility of the generation.
5958
+ */
5959
+ seed?: number;
5960
+ /**
5961
+ * Penalty for repeated tokens; higher values discourage repetition.
5962
+ */
5963
+ repetition_penalty?: number;
5964
+ /**
5965
+ * Decreases the likelihood of the model repeating the same lines verbatim.
5966
+ */
5967
+ frequency_penalty?: number;
5968
+ /**
5969
+ * Increases the likelihood of the model introducing new topics.
5970
+ */
5971
+ presence_penalty?: number;
5972
+ }
5973
+ interface Ai_Cf_Meta_Llama_4_Messages_Inner {
5974
+ /**
5975
+ * An array of message objects representing the conversation history.
5976
+ */
5977
+ messages: {
5978
+ /**
5979
+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
5980
+ */
5981
+ role?: string;
5982
+ /**
5983
+ * The tool call id. If you don't know what to put here you can fall back to 000000001
5984
+ */
5985
+ tool_call_id?: string;
5986
+ content?:
5987
+ | string
5988
+ | {
5989
+ /**
5990
+ * Type of the content provided
5991
+ */
5992
+ type?: string;
5993
+ text?: string;
5994
+ image_url?: {
5995
+ /**
5996
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5997
+ */
5998
+ url?: string;
5999
+ };
6000
+ }[]
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
+ functions?: {
6016
+ name: string;
6017
+ code: string;
6018
+ }[];
6019
+ /**
6020
+ * A list of tools available for the assistant to use.
6021
+ */
6022
+ tools?: (
6023
+ | {
6024
+ /**
6025
+ * The name of the tool. More descriptive the better.
6026
+ */
6027
+ name: string;
6028
+ /**
6029
+ * A brief description of what the tool does.
6030
+ */
6031
+ description: string;
6032
+ /**
6033
+ * Schema defining the parameters accepted by the tool.
6034
+ */
6035
+ parameters: {
6036
+ /**
6037
+ * The type of the parameters object (usually 'object').
6038
+ */
6039
+ type: string;
6040
+ /**
6041
+ * List of required parameter names.
6042
+ */
6043
+ required?: string[];
6044
+ /**
6045
+ * Definitions of each parameter.
6046
+ */
6047
+ properties: {
6048
+ [k: string]: {
6049
+ /**
6050
+ * The data type of the parameter.
6051
+ */
6052
+ type: string;
6053
+ /**
6054
+ * A description of the expected parameter.
6055
+ */
6056
+ description: string;
6057
+ };
6058
+ };
6059
+ };
6060
+ }
6061
+ | {
6062
+ /**
6063
+ * Specifies the type of tool (e.g., 'function').
6064
+ */
6065
+ type: string;
6066
+ /**
6067
+ * Details of the function tool.
6068
+ */
6069
+ function: {
6070
+ /**
6071
+ * The name of the function.
6072
+ */
6073
+ name: string;
6074
+ /**
6075
+ * A brief description of what the function does.
6076
+ */
6077
+ description: string;
6078
+ /**
6079
+ * Schema defining the parameters accepted by the function.
6080
+ */
6081
+ parameters: {
6082
+ /**
6083
+ * The type of the parameters object (usually 'object').
6084
+ */
6085
+ type: string;
6086
+ /**
6087
+ * List of required parameter names.
6088
+ */
6089
+ required?: string[];
6090
+ /**
6091
+ * Definitions of each parameter.
6092
+ */
6093
+ properties: {
6094
+ [k: string]: {
6095
+ /**
6096
+ * The data type of the parameter.
6097
+ */
6098
+ type: string;
6099
+ /**
6100
+ * A description of the expected parameter.
6101
+ */
6102
+ description: string;
6103
+ };
6104
+ };
6105
+ };
6106
+ };
6107
+ }
6108
+ )[];
6109
+ response_format?: JSONMode;
6110
+ /**
6111
+ * JSON schema that should be fufilled for the response.
6112
+ */
6113
+ guided_json?: object;
6114
+ /**
6115
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6116
+ */
6117
+ raw?: boolean;
6118
+ /**
6119
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6120
+ */
6121
+ stream?: boolean;
6122
+ /**
6123
+ * The maximum number of tokens to generate in the response.
6124
+ */
6125
+ max_tokens?: number;
6126
+ /**
6127
+ * Controls the randomness of the output; higher values produce more random results.
6128
+ */
6129
+ temperature?: number;
6130
+ /**
6131
+ * 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.
6132
+ */
6133
+ top_p?: number;
6134
+ /**
6135
+ * 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.
6136
+ */
6137
+ top_k?: number;
6138
+ /**
6139
+ * Random seed for reproducibility of the generation.
6140
+ */
6141
+ seed?: number;
6142
+ /**
6143
+ * Penalty for repeated tokens; higher values discourage repetition.
6144
+ */
6145
+ repetition_penalty?: number;
6146
+ /**
6147
+ * Decreases the likelihood of the model repeating the same lines verbatim.
6148
+ */
6149
+ frequency_penalty?: number;
6150
+ /**
6151
+ * Increases the likelihood of the model introducing new topics.
6152
+ */
6153
+ presence_penalty?: number;
6154
+ }
5887
6155
  type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = {
5888
6156
  /**
5889
6157
  * The generated text response from the model
@@ -5937,6 +6205,443 @@ declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {
5937
6205
  inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;
5938
6206
  postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;
5939
6207
  }
6208
+ interface Ai_Cf_Deepgram_Nova_3_Input {
6209
+ audio: {
6210
+ body: object;
6211
+ contentType: string;
6212
+ };
6213
+ /**
6214
+ * 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.
6215
+ */
6216
+ custom_topic_mode?: "extended" | "strict";
6217
+ /**
6218
+ * Custom topics you want the model to detect within your input audio or text if present Submit up to 100
6219
+ */
6220
+ custom_topic?: string;
6221
+ /**
6222
+ * 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
6223
+ */
6224
+ custom_intent_mode?: "extended" | "strict";
6225
+ /**
6226
+ * Custom intents you want the model to detect within your input audio if present
6227
+ */
6228
+ custom_intent?: string;
6229
+ /**
6230
+ * Identifies and extracts key entities from content in submitted audio
6231
+ */
6232
+ detect_entities?: boolean;
6233
+ /**
6234
+ * Identifies the dominant language spoken in submitted audio
6235
+ */
6236
+ detect_language?: boolean;
6237
+ /**
6238
+ * Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0
6239
+ */
6240
+ diarize?: boolean;
6241
+ /**
6242
+ * Identify and extract key entities from content in submitted audio
6243
+ */
6244
+ dictation?: boolean;
6245
+ /**
6246
+ * Specify the expected encoding of your submitted audio
6247
+ */
6248
+ encoding?:
6249
+ | "linear16"
6250
+ | "flac"
6251
+ | "mulaw"
6252
+ | "amr-nb"
6253
+ | "amr-wb"
6254
+ | "opus"
6255
+ | "speex"
6256
+ | "g729";
6257
+ /**
6258
+ * Arbitrary key-value pairs that are attached to the API response for usage in downstream processing
6259
+ */
6260
+ extra?: string;
6261
+ /**
6262
+ * Filler Words can help transcribe interruptions in your audio, like 'uh' and 'um'
6263
+ */
6264
+ filler_words?: boolean;
6265
+ /**
6266
+ * Key term prompting can boost or suppress specialized terminology and brands.
6267
+ */
6268
+ keyterm?: string;
6269
+ /**
6270
+ * Keywords can boost or suppress specialized terminology and brands.
6271
+ */
6272
+ keywords?: string;
6273
+ /**
6274
+ * 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.
6275
+ */
6276
+ language?: string;
6277
+ /**
6278
+ * Spoken measurements will be converted to their corresponding abbreviations.
6279
+ */
6280
+ measurements?: boolean;
6281
+ /**
6282
+ * 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.
6283
+ */
6284
+ mip_opt_out?: boolean;
6285
+ /**
6286
+ * Mode of operation for the model representing broad area of topic that will be talked about in the supplied audio
6287
+ */
6288
+ mode?: "general" | "medical" | "finance";
6289
+ /**
6290
+ * Transcribe each audio channel independently.
6291
+ */
6292
+ multichannel?: boolean;
6293
+ /**
6294
+ * Numerals converts numbers from written format to numerical format.
6295
+ */
6296
+ numerals?: boolean;
6297
+ /**
6298
+ * Splits audio into paragraphs to improve transcript readability.
6299
+ */
6300
+ paragraphs?: boolean;
6301
+ /**
6302
+ * Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely.
6303
+ */
6304
+ profanity_filter?: boolean;
6305
+ /**
6306
+ * Add punctuation and capitalization to the transcript.
6307
+ */
6308
+ punctuate?: boolean;
6309
+ /**
6310
+ * Redaction removes sensitive information from your transcripts.
6311
+ */
6312
+ redact?: string;
6313
+ /**
6314
+ * Search for terms or phrases in submitted audio and replaces them.
6315
+ */
6316
+ replace?: string;
6317
+ /**
6318
+ * Search for terms or phrases in submitted audio.
6319
+ */
6320
+ search?: string;
6321
+ /**
6322
+ * Recognizes the sentiment throughout a transcript or text.
6323
+ */
6324
+ sentiment?: boolean;
6325
+ /**
6326
+ * Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability.
6327
+ */
6328
+ smart_format?: boolean;
6329
+ /**
6330
+ * Detect topics throughout a transcript or text.
6331
+ */
6332
+ topics?: boolean;
6333
+ /**
6334
+ * Segments speech into meaningful semantic units.
6335
+ */
6336
+ utterances?: boolean;
6337
+ /**
6338
+ * Seconds to wait before detecting a pause between words in submitted audio.
6339
+ */
6340
+ utt_split?: number;
6341
+ /**
6342
+ * The number of channels in the submitted audio
6343
+ */
6344
+ channels?: number;
6345
+ /**
6346
+ * 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.
6347
+ */
6348
+ interim_results?: boolean;
6349
+ /**
6350
+ * 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
6351
+ */
6352
+ endpointing?: string;
6353
+ /**
6354
+ * Indicates that speech has started. You'll begin receiving Speech Started messages upon speech starting. Note: Supported only for webosockets.
6355
+ */
6356
+ vad_events?: boolean;
6357
+ /**
6358
+ * 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.
6359
+ */
6360
+ utterance_end_ms?: boolean;
6361
+ }
6362
+ interface Ai_Cf_Deepgram_Nova_3_Output {
6363
+ results?: {
6364
+ channels?: {
6365
+ alternatives?: {
6366
+ confidence?: number;
6367
+ transcript?: string;
6368
+ words?: {
6369
+ confidence?: number;
6370
+ end?: number;
6371
+ start?: number;
6372
+ word?: string;
6373
+ }[];
6374
+ }[];
6375
+ }[];
6376
+ summary?: {
6377
+ result?: string;
6378
+ short?: string;
6379
+ };
6380
+ sentiments?: {
6381
+ segments?: {
6382
+ text?: string;
6383
+ start_word?: number;
6384
+ end_word?: number;
6385
+ sentiment?: string;
6386
+ sentiment_score?: number;
6387
+ }[];
6388
+ average?: {
6389
+ sentiment?: string;
6390
+ sentiment_score?: number;
6391
+ };
6392
+ };
6393
+ };
6394
+ }
6395
+ declare abstract class Base_Ai_Cf_Deepgram_Nova_3 {
6396
+ inputs: Ai_Cf_Deepgram_Nova_3_Input;
6397
+ postProcessedOutputs: Ai_Cf_Deepgram_Nova_3_Output;
6398
+ }
6399
+ type Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input =
6400
+ | {
6401
+ /**
6402
+ * readable stream with audio data and content-type specified for that data
6403
+ */
6404
+ audio: {
6405
+ body: object;
6406
+ contentType: string;
6407
+ };
6408
+ /**
6409
+ * type of data PCM data that's sent to the inference server as raw array
6410
+ */
6411
+ dtype?: "uint8" | "float32" | "float64";
6412
+ }
6413
+ | {
6414
+ /**
6415
+ * base64 encoded audio data
6416
+ */
6417
+ audio: string;
6418
+ /**
6419
+ * type of data PCM data that's sent to the inference server as raw array
6420
+ */
6421
+ dtype?: "uint8" | "float32" | "float64";
6422
+ };
6423
+ interface Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output {
6424
+ /**
6425
+ * if true, end-of-turn was detected
6426
+ */
6427
+ is_complete?: boolean;
6428
+ /**
6429
+ * probability of the end-of-turn detection
6430
+ */
6431
+ probability?: number;
6432
+ }
6433
+ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
6434
+ inputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input;
6435
+ postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
6436
+ }
6437
+ type Ai_Cf_Openai_Gpt_Oss_120B_Input =
6438
+ | GPT_OSS_120B_Responses
6439
+ | GPT_OSS_120B_Responses_Async;
6440
+ interface GPT_OSS_120B_Responses {
6441
+ /**
6442
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6443
+ */
6444
+ input: string | unknown[];
6445
+ reasoning?: {
6446
+ /**
6447
+ * 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.
6448
+ */
6449
+ effort?: "low" | "medium" | "high";
6450
+ /**
6451
+ * 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.
6452
+ */
6453
+ summary?: "auto" | "concise" | "detailed";
6454
+ };
6455
+ }
6456
+ interface GPT_OSS_120B_Responses_Async {
6457
+ requests: {
6458
+ /**
6459
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6460
+ */
6461
+ input: string | unknown[];
6462
+ reasoning?: {
6463
+ /**
6464
+ * 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.
6465
+ */
6466
+ effort?: "low" | "medium" | "high";
6467
+ /**
6468
+ * 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.
6469
+ */
6470
+ summary?: "auto" | "concise" | "detailed";
6471
+ };
6472
+ }[];
6473
+ }
6474
+ type Ai_Cf_Openai_Gpt_Oss_120B_Output = {} | (string & NonNullable<unknown>);
6475
+ declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
6476
+ inputs: Ai_Cf_Openai_Gpt_Oss_120B_Input;
6477
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_120B_Output;
6478
+ }
6479
+ type Ai_Cf_Openai_Gpt_Oss_20B_Input =
6480
+ | GPT_OSS_20B_Responses
6481
+ | GPT_OSS_20B_Responses_Async;
6482
+ interface GPT_OSS_20B_Responses {
6483
+ /**
6484
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6485
+ */
6486
+ input: string | unknown[];
6487
+ reasoning?: {
6488
+ /**
6489
+ * 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.
6490
+ */
6491
+ effort?: "low" | "medium" | "high";
6492
+ /**
6493
+ * 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.
6494
+ */
6495
+ summary?: "auto" | "concise" | "detailed";
6496
+ };
6497
+ }
6498
+ interface GPT_OSS_20B_Responses_Async {
6499
+ requests: {
6500
+ /**
6501
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6502
+ */
6503
+ input: string | unknown[];
6504
+ reasoning?: {
6505
+ /**
6506
+ * 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.
6507
+ */
6508
+ effort?: "low" | "medium" | "high";
6509
+ /**
6510
+ * 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.
6511
+ */
6512
+ summary?: "auto" | "concise" | "detailed";
6513
+ };
6514
+ }[];
6515
+ }
6516
+ type Ai_Cf_Openai_Gpt_Oss_20B_Output = {} | (string & NonNullable<unknown>);
6517
+ declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
6518
+ inputs: Ai_Cf_Openai_Gpt_Oss_20B_Input;
6519
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_20B_Output;
6520
+ }
6521
+ interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
6522
+ /**
6523
+ * A text description of the image you want to generate.
6524
+ */
6525
+ prompt: string;
6526
+ /**
6527
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6528
+ */
6529
+ guidance?: number;
6530
+ /**
6531
+ * Random seed for reproducibility of the image generation
6532
+ */
6533
+ seed?: number;
6534
+ /**
6535
+ * The height of the generated image in pixels
6536
+ */
6537
+ height?: number;
6538
+ /**
6539
+ * The width of the generated image in pixels
6540
+ */
6541
+ width?: number;
6542
+ /**
6543
+ * The number of diffusion steps; higher values can improve quality but take longer
6544
+ */
6545
+ num_steps?: number;
6546
+ /**
6547
+ * Specify what to exclude from the generated images
6548
+ */
6549
+ negative_prompt?: string;
6550
+ }
6551
+ /**
6552
+ * The generated image in JPEG format
6553
+ */
6554
+ type Ai_Cf_Leonardo_Phoenix_1_0_Output = string;
6555
+ declare abstract class Base_Ai_Cf_Leonardo_Phoenix_1_0 {
6556
+ inputs: Ai_Cf_Leonardo_Phoenix_1_0_Input;
6557
+ postProcessedOutputs: Ai_Cf_Leonardo_Phoenix_1_0_Output;
6558
+ }
6559
+ interface Ai_Cf_Leonardo_Lucid_Origin_Input {
6560
+ /**
6561
+ * A text description of the image you want to generate.
6562
+ */
6563
+ prompt: string;
6564
+ /**
6565
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6566
+ */
6567
+ guidance?: number;
6568
+ /**
6569
+ * Random seed for reproducibility of the image generation
6570
+ */
6571
+ seed?: number;
6572
+ /**
6573
+ * The height of the generated image in pixels
6574
+ */
6575
+ height?: number;
6576
+ /**
6577
+ * The width of the generated image in pixels
6578
+ */
6579
+ width?: number;
6580
+ /**
6581
+ * The number of diffusion steps; higher values can improve quality but take longer
6582
+ */
6583
+ num_steps?: number;
6584
+ /**
6585
+ * The number of diffusion steps; higher values can improve quality but take longer
6586
+ */
6587
+ steps?: number;
6588
+ }
6589
+ interface Ai_Cf_Leonardo_Lucid_Origin_Output {
6590
+ /**
6591
+ * The generated image in Base64 format.
6592
+ */
6593
+ image?: string;
6594
+ }
6595
+ declare abstract class Base_Ai_Cf_Leonardo_Lucid_Origin {
6596
+ inputs: Ai_Cf_Leonardo_Lucid_Origin_Input;
6597
+ postProcessedOutputs: Ai_Cf_Leonardo_Lucid_Origin_Output;
6598
+ }
6599
+ interface Ai_Cf_Deepgram_Aura_1_Input {
6600
+ /**
6601
+ * Speaker used to produce the audio.
6602
+ */
6603
+ speaker?:
6604
+ | "angus"
6605
+ | "asteria"
6606
+ | "arcas"
6607
+ | "orion"
6608
+ | "orpheus"
6609
+ | "athena"
6610
+ | "luna"
6611
+ | "zeus"
6612
+ | "perseus"
6613
+ | "helios"
6614
+ | "hera"
6615
+ | "stella";
6616
+ /**
6617
+ * Encoding of the output audio.
6618
+ */
6619
+ encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac";
6620
+ /**
6621
+ * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..
6622
+ */
6623
+ container?: "none" | "wav" | "ogg";
6624
+ /**
6625
+ * The text content to be converted to speech
6626
+ */
6627
+ text: string;
6628
+ /**
6629
+ * 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
6630
+ */
6631
+ sample_rate?: number;
6632
+ /**
6633
+ * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.
6634
+ */
6635
+ bit_rate?: number;
6636
+ }
6637
+ /**
6638
+ * The generated audio in MP3 format
6639
+ */
6640
+ type Ai_Cf_Deepgram_Aura_1_Output = string;
6641
+ declare abstract class Base_Ai_Cf_Deepgram_Aura_1 {
6642
+ inputs: Ai_Cf_Deepgram_Aura_1_Input;
6643
+ postProcessedOutputs: Ai_Cf_Deepgram_Aura_1_Output;
6644
+ }
5940
6645
  interface AiModels {
5941
6646
  "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
5942
6647
  "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
@@ -5945,8 +6650,8 @@ interface AiModels {
5945
6650
  "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
5946
6651
  "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
5947
6652
  "@cf/myshell-ai/melotts": BaseAiTextToSpeech;
6653
+ "@cf/google/embeddinggemma-300m": BaseAiTextEmbeddings;
5948
6654
  "@cf/microsoft/resnet-50": BaseAiImageClassification;
5949
- "@cf/facebook/detr-resnet-50": BaseAiObjectDetection;
5950
6655
  "@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
5951
6656
  "@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
5952
6657
  "@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
@@ -5981,7 +6686,6 @@ interface AiModels {
5981
6686
  "@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
5982
6687
  "@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
5983
6688
  "@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
5984
- "@cf/meta/llama-3.1-8b-instruct": BaseAiTextGeneration;
5985
6689
  "@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
5986
6690
  "@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
5987
6691
  "@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
@@ -6008,6 +6712,13 @@ interface AiModels {
6008
6712
  "@cf/mistralai/mistral-small-3.1-24b-instruct": Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct;
6009
6713
  "@cf/google/gemma-3-12b-it": Base_Ai_Cf_Google_Gemma_3_12B_It;
6010
6714
  "@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;
6715
+ "@cf/deepgram/nova-3": Base_Ai_Cf_Deepgram_Nova_3;
6716
+ "@cf/pipecat-ai/smart-turn-v2": Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2;
6717
+ "@cf/openai/gpt-oss-120b": Base_Ai_Cf_Openai_Gpt_Oss_120B;
6718
+ "@cf/openai/gpt-oss-20b": Base_Ai_Cf_Openai_Gpt_Oss_20B;
6719
+ "@cf/leonardo/phoenix-1.0": Base_Ai_Cf_Leonardo_Phoenix_1_0;
6720
+ "@cf/leonardo/lucid-origin": Base_Ai_Cf_Leonardo_Lucid_Origin;
6721
+ "@cf/deepgram/aura-1": Base_Ai_Cf_Deepgram_Aura_1;
6011
6722
  }
6012
6723
  type AiOptions = {
6013
6724
  /**
@@ -6015,6 +6726,10 @@ type AiOptions = {
6015
6726
  * https://developers.cloudflare.com/workers-ai/features/batch-api
6016
6727
  */
6017
6728
  queueRequest?: boolean;
6729
+ /**
6730
+ * Establish websocket connections, only works for supported models
6731
+ */
6732
+ websocket?: boolean;
6018
6733
  gateway?: GatewayOptions;
6019
6734
  returnRawResponse?: boolean;
6020
6735
  prefix?: string;
@@ -6058,7 +6773,7 @@ type AiModelListType = Record<string, any>;
6058
6773
  declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
6059
6774
  aiGatewayLogId: string | null;
6060
6775
  gateway(gatewayId: string): AiGateway;
6061
- autorag(autoragId?: string): AutoRAG;
6776
+ autorag(autoragId: string): AutoRAG;
6062
6777
  run<
6063
6778
  Name extends keyof AiModelList,
6064
6779
  Options extends AiOptions,
@@ -6068,9 +6783,13 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
6068
6783
  inputs: InputOptions,
6069
6784
  options?: Options,
6070
6785
  ): Promise<
6071
- Options extends {
6072
- returnRawResponse: true;
6073
- }
6786
+ Options extends
6787
+ | {
6788
+ returnRawResponse: true;
6789
+ }
6790
+ | {
6791
+ websocket: true;
6792
+ }
6074
6793
  ? Response
6075
6794
  : InputOptions extends {
6076
6795
  stream: true;
@@ -8314,7 +9033,6 @@ declare namespace TailStream {
8314
9033
  }
8315
9034
  interface JsRpcEventInfo {
8316
9035
  readonly type: "jsrpc";
8317
- readonly methodName: string;
8318
9036
  }
8319
9037
  interface ScheduledEventInfo {
8320
9038
  readonly type: "scheduled";