@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.
@@ -471,18 +471,6 @@ export declare abstract class Navigator {
471
471
  readonly userAgent: string;
472
472
  readonly hardwareConcurrency: number;
473
473
  }
474
- /**
475
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
476
- * as well as timing of subrequests and other operations.
477
- *
478
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
479
- */
480
- export interface Performance {
481
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
482
- readonly timeOrigin: number;
483
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
484
- now(): number;
485
- }
486
474
  export interface AlarmInvocationInfo {
487
475
  readonly isRetry: boolean;
488
476
  readonly retryCount: number;
@@ -3177,6 +3165,18 @@ export interface WorkerLoaderWorkerCode {
3177
3165
  tails?: Fetcher[];
3178
3166
  streamingTails?: Fetcher[];
3179
3167
  }
3168
+ /**
3169
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3170
+ * as well as timing of subrequests and other operations.
3171
+ *
3172
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3173
+ */
3174
+ export declare abstract class Performance {
3175
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3176
+ get timeOrigin(): number;
3177
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3178
+ now(): number;
3179
+ }
3180
3180
  export type AiImageClassificationInput = {
3181
3181
  image: number[];
3182
3182
  };
@@ -3231,6 +3231,18 @@ export declare abstract class BaseAiImageTextToText {
3231
3231
  inputs: AiImageTextToTextInput;
3232
3232
  postProcessedOutputs: AiImageTextToTextOutput;
3233
3233
  }
3234
+ export type AiMultimodalEmbeddingsInput = {
3235
+ image: string;
3236
+ text: string[];
3237
+ };
3238
+ export type AiIMultimodalEmbeddingsOutput = {
3239
+ data: number[][];
3240
+ shape: number[];
3241
+ };
3242
+ export declare abstract class BaseAiMultimodalEmbeddings {
3243
+ inputs: AiImageTextToTextInput;
3244
+ postProcessedOutputs: AiImageTextToTextOutput;
3245
+ }
3234
3246
  export type AiObjectDetectionInput = {
3235
3247
  image: number[];
3236
3248
  };
@@ -3369,12 +3381,28 @@ export type AiTextGenerationInput = {
3369
3381
  | (object & NonNullable<unknown>);
3370
3382
  functions?: AiTextGenerationFunctionsInput[];
3371
3383
  };
3384
+ export type AiTextGenerationToolLegacyOutput = {
3385
+ name: string;
3386
+ arguments: unknown;
3387
+ };
3388
+ export type AiTextGenerationToolOutput = {
3389
+ id: string;
3390
+ type: "function";
3391
+ function: {
3392
+ name: string;
3393
+ arguments: string;
3394
+ };
3395
+ };
3396
+ export type UsageTags = {
3397
+ prompt_tokens: number;
3398
+ completion_tokens: number;
3399
+ total_tokens: number;
3400
+ };
3372
3401
  export type AiTextGenerationOutput = {
3373
3402
  response?: string;
3374
- tool_calls?: {
3375
- name: string;
3376
- arguments: unknown;
3377
- }[];
3403
+ tool_calls?: AiTextGenerationToolLegacyOutput[] &
3404
+ AiTextGenerationToolOutput[];
3405
+ usage?: UsageTags;
3378
3406
  };
3379
3407
  export declare abstract class BaseAiTextGeneration {
3380
3408
  inputs: AiTextGenerationInput;
@@ -4463,6 +4491,7 @@ export type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output =
4463
4491
  name?: string;
4464
4492
  }[];
4465
4493
  }
4494
+ | string
4466
4495
  | AsyncResponse;
4467
4496
  export declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast {
4468
4497
  inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input;
@@ -4539,7 +4568,6 @@ export interface Ai_Cf_Baai_Bge_Reranker_Base_Input {
4539
4568
  /**
4540
4569
  * A query you wish to perform against the provided contexts.
4541
4570
  */
4542
- query: string;
4543
4571
  /**
4544
4572
  * Number of returned results starting with the best score.
4545
4573
  */
@@ -5634,7 +5662,8 @@ export declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It {
5634
5662
  }
5635
5663
  export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input =
5636
5664
  | Ai_Cf_Meta_Llama_4_Prompt
5637
- | Ai_Cf_Meta_Llama_4_Messages;
5665
+ | Ai_Cf_Meta_Llama_4_Messages
5666
+ | Ai_Cf_Meta_Llama_4_Async_Batch;
5638
5667
  export interface Ai_Cf_Meta_Llama_4_Prompt {
5639
5668
  /**
5640
5669
  * The input text prompt for the model to generate a response.
@@ -5868,6 +5897,245 @@ export interface Ai_Cf_Meta_Llama_4_Messages {
5868
5897
  */
5869
5898
  presence_penalty?: number;
5870
5899
  }
5900
+ export interface Ai_Cf_Meta_Llama_4_Async_Batch {
5901
+ requests: (
5902
+ | Ai_Cf_Meta_Llama_4_Prompt_Inner
5903
+ | Ai_Cf_Meta_Llama_4_Messages_Inner
5904
+ )[];
5905
+ }
5906
+ export interface Ai_Cf_Meta_Llama_4_Prompt_Inner {
5907
+ /**
5908
+ * The input text prompt for the model to generate a response.
5909
+ */
5910
+ prompt: string;
5911
+ /**
5912
+ * JSON schema that should be fulfilled for the response.
5913
+ */
5914
+ guided_json?: object;
5915
+ response_format?: JSONMode;
5916
+ /**
5917
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
5918
+ */
5919
+ raw?: boolean;
5920
+ /**
5921
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
5922
+ */
5923
+ stream?: boolean;
5924
+ /**
5925
+ * The maximum number of tokens to generate in the response.
5926
+ */
5927
+ max_tokens?: number;
5928
+ /**
5929
+ * Controls the randomness of the output; higher values produce more random results.
5930
+ */
5931
+ temperature?: number;
5932
+ /**
5933
+ * 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.
5934
+ */
5935
+ top_p?: number;
5936
+ /**
5937
+ * 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.
5938
+ */
5939
+ top_k?: number;
5940
+ /**
5941
+ * Random seed for reproducibility of the generation.
5942
+ */
5943
+ seed?: number;
5944
+ /**
5945
+ * Penalty for repeated tokens; higher values discourage repetition.
5946
+ */
5947
+ repetition_penalty?: number;
5948
+ /**
5949
+ * Decreases the likelihood of the model repeating the same lines verbatim.
5950
+ */
5951
+ frequency_penalty?: number;
5952
+ /**
5953
+ * Increases the likelihood of the model introducing new topics.
5954
+ */
5955
+ presence_penalty?: number;
5956
+ }
5957
+ export interface Ai_Cf_Meta_Llama_4_Messages_Inner {
5958
+ /**
5959
+ * An array of message objects representing the conversation history.
5960
+ */
5961
+ messages: {
5962
+ /**
5963
+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
5964
+ */
5965
+ role?: string;
5966
+ /**
5967
+ * The tool call id. If you don't know what to put here you can fall back to 000000001
5968
+ */
5969
+ tool_call_id?: string;
5970
+ content?:
5971
+ | string
5972
+ | {
5973
+ /**
5974
+ * Type of the content provided
5975
+ */
5976
+ type?: string;
5977
+ text?: string;
5978
+ image_url?: {
5979
+ /**
5980
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5981
+ */
5982
+ url?: string;
5983
+ };
5984
+ }[]
5985
+ | {
5986
+ /**
5987
+ * Type of the content provided
5988
+ */
5989
+ type?: string;
5990
+ text?: string;
5991
+ image_url?: {
5992
+ /**
5993
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5994
+ */
5995
+ url?: string;
5996
+ };
5997
+ };
5998
+ }[];
5999
+ functions?: {
6000
+ name: string;
6001
+ code: string;
6002
+ }[];
6003
+ /**
6004
+ * A list of tools available for the assistant to use.
6005
+ */
6006
+ tools?: (
6007
+ | {
6008
+ /**
6009
+ * The name of the tool. More descriptive the better.
6010
+ */
6011
+ name: string;
6012
+ /**
6013
+ * A brief description of what the tool does.
6014
+ */
6015
+ description: string;
6016
+ /**
6017
+ * Schema defining the parameters accepted by the tool.
6018
+ */
6019
+ parameters: {
6020
+ /**
6021
+ * The type of the parameters object (usually 'object').
6022
+ */
6023
+ type: string;
6024
+ /**
6025
+ * List of required parameter names.
6026
+ */
6027
+ required?: string[];
6028
+ /**
6029
+ * Definitions of each parameter.
6030
+ */
6031
+ properties: {
6032
+ [k: string]: {
6033
+ /**
6034
+ * The data type of the parameter.
6035
+ */
6036
+ type: string;
6037
+ /**
6038
+ * A description of the expected parameter.
6039
+ */
6040
+ description: string;
6041
+ };
6042
+ };
6043
+ };
6044
+ }
6045
+ | {
6046
+ /**
6047
+ * Specifies the type of tool (e.g., 'function').
6048
+ */
6049
+ type: string;
6050
+ /**
6051
+ * Details of the function tool.
6052
+ */
6053
+ function: {
6054
+ /**
6055
+ * The name of the function.
6056
+ */
6057
+ name: string;
6058
+ /**
6059
+ * A brief description of what the function does.
6060
+ */
6061
+ description: string;
6062
+ /**
6063
+ * Schema defining the parameters accepted by the function.
6064
+ */
6065
+ parameters: {
6066
+ /**
6067
+ * The type of the parameters object (usually 'object').
6068
+ */
6069
+ type: string;
6070
+ /**
6071
+ * List of required parameter names.
6072
+ */
6073
+ required?: string[];
6074
+ /**
6075
+ * Definitions of each parameter.
6076
+ */
6077
+ properties: {
6078
+ [k: string]: {
6079
+ /**
6080
+ * The data type of the parameter.
6081
+ */
6082
+ type: string;
6083
+ /**
6084
+ * A description of the expected parameter.
6085
+ */
6086
+ description: string;
6087
+ };
6088
+ };
6089
+ };
6090
+ };
6091
+ }
6092
+ )[];
6093
+ response_format?: JSONMode;
6094
+ /**
6095
+ * JSON schema that should be fufilled for the response.
6096
+ */
6097
+ guided_json?: object;
6098
+ /**
6099
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6100
+ */
6101
+ raw?: boolean;
6102
+ /**
6103
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6104
+ */
6105
+ stream?: boolean;
6106
+ /**
6107
+ * The maximum number of tokens to generate in the response.
6108
+ */
6109
+ max_tokens?: number;
6110
+ /**
6111
+ * Controls the randomness of the output; higher values produce more random results.
6112
+ */
6113
+ temperature?: number;
6114
+ /**
6115
+ * 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.
6116
+ */
6117
+ top_p?: number;
6118
+ /**
6119
+ * 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.
6120
+ */
6121
+ top_k?: number;
6122
+ /**
6123
+ * Random seed for reproducibility of the generation.
6124
+ */
6125
+ seed?: number;
6126
+ /**
6127
+ * Penalty for repeated tokens; higher values discourage repetition.
6128
+ */
6129
+ repetition_penalty?: number;
6130
+ /**
6131
+ * Decreases the likelihood of the model repeating the same lines verbatim.
6132
+ */
6133
+ frequency_penalty?: number;
6134
+ /**
6135
+ * Increases the likelihood of the model introducing new topics.
6136
+ */
6137
+ presence_penalty?: number;
6138
+ }
5871
6139
  export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = {
5872
6140
  /**
5873
6141
  * The generated text response from the model
@@ -5921,6 +6189,447 @@ export declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {
5921
6189
  inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;
5922
6190
  postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;
5923
6191
  }
6192
+ export interface Ai_Cf_Deepgram_Nova_3_Input {
6193
+ audio: {
6194
+ body: object;
6195
+ contentType: string;
6196
+ };
6197
+ /**
6198
+ * 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.
6199
+ */
6200
+ custom_topic_mode?: "extended" | "strict";
6201
+ /**
6202
+ * Custom topics you want the model to detect within your input audio or text if present Submit up to 100
6203
+ */
6204
+ custom_topic?: string;
6205
+ /**
6206
+ * 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
6207
+ */
6208
+ custom_intent_mode?: "extended" | "strict";
6209
+ /**
6210
+ * Custom intents you want the model to detect within your input audio if present
6211
+ */
6212
+ custom_intent?: string;
6213
+ /**
6214
+ * Identifies and extracts key entities from content in submitted audio
6215
+ */
6216
+ detect_entities?: boolean;
6217
+ /**
6218
+ * Identifies the dominant language spoken in submitted audio
6219
+ */
6220
+ detect_language?: boolean;
6221
+ /**
6222
+ * Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0
6223
+ */
6224
+ diarize?: boolean;
6225
+ /**
6226
+ * Identify and extract key entities from content in submitted audio
6227
+ */
6228
+ dictation?: boolean;
6229
+ /**
6230
+ * Specify the expected encoding of your submitted audio
6231
+ */
6232
+ encoding?:
6233
+ | "linear16"
6234
+ | "flac"
6235
+ | "mulaw"
6236
+ | "amr-nb"
6237
+ | "amr-wb"
6238
+ | "opus"
6239
+ | "speex"
6240
+ | "g729";
6241
+ /**
6242
+ * Arbitrary key-value pairs that are attached to the API response for usage in downstream processing
6243
+ */
6244
+ extra?: string;
6245
+ /**
6246
+ * Filler Words can help transcribe interruptions in your audio, like 'uh' and 'um'
6247
+ */
6248
+ filler_words?: boolean;
6249
+ /**
6250
+ * Key term prompting can boost or suppress specialized terminology and brands.
6251
+ */
6252
+ keyterm?: string;
6253
+ /**
6254
+ * Keywords can boost or suppress specialized terminology and brands.
6255
+ */
6256
+ keywords?: string;
6257
+ /**
6258
+ * 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.
6259
+ */
6260
+ language?: string;
6261
+ /**
6262
+ * Spoken measurements will be converted to their corresponding abbreviations.
6263
+ */
6264
+ measurements?: boolean;
6265
+ /**
6266
+ * 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.
6267
+ */
6268
+ mip_opt_out?: boolean;
6269
+ /**
6270
+ * Mode of operation for the model representing broad area of topic that will be talked about in the supplied audio
6271
+ */
6272
+ mode?: "general" | "medical" | "finance";
6273
+ /**
6274
+ * Transcribe each audio channel independently.
6275
+ */
6276
+ multichannel?: boolean;
6277
+ /**
6278
+ * Numerals converts numbers from written format to numerical format.
6279
+ */
6280
+ numerals?: boolean;
6281
+ /**
6282
+ * Splits audio into paragraphs to improve transcript readability.
6283
+ */
6284
+ paragraphs?: boolean;
6285
+ /**
6286
+ * Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely.
6287
+ */
6288
+ profanity_filter?: boolean;
6289
+ /**
6290
+ * Add punctuation and capitalization to the transcript.
6291
+ */
6292
+ punctuate?: boolean;
6293
+ /**
6294
+ * Redaction removes sensitive information from your transcripts.
6295
+ */
6296
+ redact?: string;
6297
+ /**
6298
+ * Search for terms or phrases in submitted audio and replaces them.
6299
+ */
6300
+ replace?: string;
6301
+ /**
6302
+ * Search for terms or phrases in submitted audio.
6303
+ */
6304
+ search?: string;
6305
+ /**
6306
+ * Recognizes the sentiment throughout a transcript or text.
6307
+ */
6308
+ sentiment?: boolean;
6309
+ /**
6310
+ * Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability.
6311
+ */
6312
+ smart_format?: boolean;
6313
+ /**
6314
+ * Detect topics throughout a transcript or text.
6315
+ */
6316
+ topics?: boolean;
6317
+ /**
6318
+ * Segments speech into meaningful semantic units.
6319
+ */
6320
+ utterances?: boolean;
6321
+ /**
6322
+ * Seconds to wait before detecting a pause between words in submitted audio.
6323
+ */
6324
+ utt_split?: number;
6325
+ /**
6326
+ * The number of channels in the submitted audio
6327
+ */
6328
+ channels?: number;
6329
+ /**
6330
+ * 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.
6331
+ */
6332
+ interim_results?: boolean;
6333
+ /**
6334
+ * 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
6335
+ */
6336
+ endpointing?: string;
6337
+ /**
6338
+ * Indicates that speech has started. You'll begin receiving Speech Started messages upon speech starting. Note: Supported only for webosockets.
6339
+ */
6340
+ vad_events?: boolean;
6341
+ /**
6342
+ * 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.
6343
+ */
6344
+ utterance_end_ms?: boolean;
6345
+ }
6346
+ export interface Ai_Cf_Deepgram_Nova_3_Output {
6347
+ results?: {
6348
+ channels?: {
6349
+ alternatives?: {
6350
+ confidence?: number;
6351
+ transcript?: string;
6352
+ words?: {
6353
+ confidence?: number;
6354
+ end?: number;
6355
+ start?: number;
6356
+ word?: string;
6357
+ }[];
6358
+ }[];
6359
+ }[];
6360
+ summary?: {
6361
+ result?: string;
6362
+ short?: string;
6363
+ };
6364
+ sentiments?: {
6365
+ segments?: {
6366
+ text?: string;
6367
+ start_word?: number;
6368
+ end_word?: number;
6369
+ sentiment?: string;
6370
+ sentiment_score?: number;
6371
+ }[];
6372
+ average?: {
6373
+ sentiment?: string;
6374
+ sentiment_score?: number;
6375
+ };
6376
+ };
6377
+ };
6378
+ }
6379
+ export declare abstract class Base_Ai_Cf_Deepgram_Nova_3 {
6380
+ inputs: Ai_Cf_Deepgram_Nova_3_Input;
6381
+ postProcessedOutputs: Ai_Cf_Deepgram_Nova_3_Output;
6382
+ }
6383
+ export type Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input =
6384
+ | {
6385
+ /**
6386
+ * readable stream with audio data and content-type specified for that data
6387
+ */
6388
+ audio: {
6389
+ body: object;
6390
+ contentType: string;
6391
+ };
6392
+ /**
6393
+ * type of data PCM data that's sent to the inference server as raw array
6394
+ */
6395
+ dtype?: "uint8" | "float32" | "float64";
6396
+ }
6397
+ | {
6398
+ /**
6399
+ * base64 encoded audio data
6400
+ */
6401
+ audio: string;
6402
+ /**
6403
+ * type of data PCM data that's sent to the inference server as raw array
6404
+ */
6405
+ dtype?: "uint8" | "float32" | "float64";
6406
+ };
6407
+ export interface Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output {
6408
+ /**
6409
+ * if true, end-of-turn was detected
6410
+ */
6411
+ is_complete?: boolean;
6412
+ /**
6413
+ * probability of the end-of-turn detection
6414
+ */
6415
+ probability?: number;
6416
+ }
6417
+ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
6418
+ inputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input;
6419
+ postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
6420
+ }
6421
+ export type Ai_Cf_Openai_Gpt_Oss_120B_Input =
6422
+ | GPT_OSS_120B_Responses
6423
+ | GPT_OSS_120B_Responses_Async;
6424
+ export interface GPT_OSS_120B_Responses {
6425
+ /**
6426
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6427
+ */
6428
+ input: string | unknown[];
6429
+ reasoning?: {
6430
+ /**
6431
+ * 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.
6432
+ */
6433
+ effort?: "low" | "medium" | "high";
6434
+ /**
6435
+ * 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.
6436
+ */
6437
+ summary?: "auto" | "concise" | "detailed";
6438
+ };
6439
+ }
6440
+ export interface GPT_OSS_120B_Responses_Async {
6441
+ requests: {
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
+ }
6458
+ export type Ai_Cf_Openai_Gpt_Oss_120B_Output =
6459
+ | {}
6460
+ | (string & NonNullable<unknown>);
6461
+ export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
6462
+ inputs: Ai_Cf_Openai_Gpt_Oss_120B_Input;
6463
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_120B_Output;
6464
+ }
6465
+ export type Ai_Cf_Openai_Gpt_Oss_20B_Input =
6466
+ | GPT_OSS_20B_Responses
6467
+ | GPT_OSS_20B_Responses_Async;
6468
+ export interface GPT_OSS_20B_Responses {
6469
+ /**
6470
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6471
+ */
6472
+ input: string | unknown[];
6473
+ reasoning?: {
6474
+ /**
6475
+ * 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.
6476
+ */
6477
+ effort?: "low" | "medium" | "high";
6478
+ /**
6479
+ * 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.
6480
+ */
6481
+ summary?: "auto" | "concise" | "detailed";
6482
+ };
6483
+ }
6484
+ export interface GPT_OSS_20B_Responses_Async {
6485
+ requests: {
6486
+ /**
6487
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6488
+ */
6489
+ input: string | unknown[];
6490
+ reasoning?: {
6491
+ /**
6492
+ * 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.
6493
+ */
6494
+ effort?: "low" | "medium" | "high";
6495
+ /**
6496
+ * 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.
6497
+ */
6498
+ summary?: "auto" | "concise" | "detailed";
6499
+ };
6500
+ }[];
6501
+ }
6502
+ export type Ai_Cf_Openai_Gpt_Oss_20B_Output =
6503
+ | {}
6504
+ | (string & NonNullable<unknown>);
6505
+ export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
6506
+ inputs: Ai_Cf_Openai_Gpt_Oss_20B_Input;
6507
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_20B_Output;
6508
+ }
6509
+ export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
6510
+ /**
6511
+ * A text description of the image you want to generate.
6512
+ */
6513
+ prompt: string;
6514
+ /**
6515
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6516
+ */
6517
+ guidance?: number;
6518
+ /**
6519
+ * Random seed for reproducibility of the image generation
6520
+ */
6521
+ seed?: number;
6522
+ /**
6523
+ * The height of the generated image in pixels
6524
+ */
6525
+ height?: number;
6526
+ /**
6527
+ * The width of the generated image in pixels
6528
+ */
6529
+ width?: number;
6530
+ /**
6531
+ * The number of diffusion steps; higher values can improve quality but take longer
6532
+ */
6533
+ num_steps?: number;
6534
+ /**
6535
+ * Specify what to exclude from the generated images
6536
+ */
6537
+ negative_prompt?: string;
6538
+ }
6539
+ /**
6540
+ * The generated image in JPEG format
6541
+ */
6542
+ export type Ai_Cf_Leonardo_Phoenix_1_0_Output = string;
6543
+ export declare abstract class Base_Ai_Cf_Leonardo_Phoenix_1_0 {
6544
+ inputs: Ai_Cf_Leonardo_Phoenix_1_0_Input;
6545
+ postProcessedOutputs: Ai_Cf_Leonardo_Phoenix_1_0_Output;
6546
+ }
6547
+ export interface Ai_Cf_Leonardo_Lucid_Origin_Input {
6548
+ /**
6549
+ * A text description of the image you want to generate.
6550
+ */
6551
+ prompt: string;
6552
+ /**
6553
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6554
+ */
6555
+ guidance?: number;
6556
+ /**
6557
+ * Random seed for reproducibility of the image generation
6558
+ */
6559
+ seed?: number;
6560
+ /**
6561
+ * The height of the generated image in pixels
6562
+ */
6563
+ height?: number;
6564
+ /**
6565
+ * The width of the generated image in pixels
6566
+ */
6567
+ width?: number;
6568
+ /**
6569
+ * The number of diffusion steps; higher values can improve quality but take longer
6570
+ */
6571
+ num_steps?: number;
6572
+ /**
6573
+ * The number of diffusion steps; higher values can improve quality but take longer
6574
+ */
6575
+ steps?: number;
6576
+ }
6577
+ export interface Ai_Cf_Leonardo_Lucid_Origin_Output {
6578
+ /**
6579
+ * The generated image in Base64 format.
6580
+ */
6581
+ image?: string;
6582
+ }
6583
+ export declare abstract class Base_Ai_Cf_Leonardo_Lucid_Origin {
6584
+ inputs: Ai_Cf_Leonardo_Lucid_Origin_Input;
6585
+ postProcessedOutputs: Ai_Cf_Leonardo_Lucid_Origin_Output;
6586
+ }
6587
+ export interface Ai_Cf_Deepgram_Aura_1_Input {
6588
+ /**
6589
+ * Speaker used to produce the audio.
6590
+ */
6591
+ speaker?:
6592
+ | "angus"
6593
+ | "asteria"
6594
+ | "arcas"
6595
+ | "orion"
6596
+ | "orpheus"
6597
+ | "athena"
6598
+ | "luna"
6599
+ | "zeus"
6600
+ | "perseus"
6601
+ | "helios"
6602
+ | "hera"
6603
+ | "stella";
6604
+ /**
6605
+ * Encoding of the output audio.
6606
+ */
6607
+ encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac";
6608
+ /**
6609
+ * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..
6610
+ */
6611
+ container?: "none" | "wav" | "ogg";
6612
+ /**
6613
+ * The text content to be converted to speech
6614
+ */
6615
+ text: string;
6616
+ /**
6617
+ * 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
6618
+ */
6619
+ sample_rate?: number;
6620
+ /**
6621
+ * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.
6622
+ */
6623
+ bit_rate?: number;
6624
+ }
6625
+ /**
6626
+ * The generated audio in MP3 format
6627
+ */
6628
+ export type Ai_Cf_Deepgram_Aura_1_Output = string;
6629
+ export declare abstract class Base_Ai_Cf_Deepgram_Aura_1 {
6630
+ inputs: Ai_Cf_Deepgram_Aura_1_Input;
6631
+ postProcessedOutputs: Ai_Cf_Deepgram_Aura_1_Output;
6632
+ }
5924
6633
  export interface AiModels {
5925
6634
  "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
5926
6635
  "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
@@ -5929,8 +6638,8 @@ export interface AiModels {
5929
6638
  "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
5930
6639
  "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
5931
6640
  "@cf/myshell-ai/melotts": BaseAiTextToSpeech;
6641
+ "@cf/google/embeddinggemma-300m": BaseAiTextEmbeddings;
5932
6642
  "@cf/microsoft/resnet-50": BaseAiImageClassification;
5933
- "@cf/facebook/detr-resnet-50": BaseAiObjectDetection;
5934
6643
  "@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
5935
6644
  "@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
5936
6645
  "@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
@@ -5965,7 +6674,6 @@ export interface AiModels {
5965
6674
  "@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
5966
6675
  "@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
5967
6676
  "@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
5968
- "@cf/meta/llama-3.1-8b-instruct": BaseAiTextGeneration;
5969
6677
  "@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
5970
6678
  "@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
5971
6679
  "@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
@@ -5992,6 +6700,13 @@ export interface AiModels {
5992
6700
  "@cf/mistralai/mistral-small-3.1-24b-instruct": Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct;
5993
6701
  "@cf/google/gemma-3-12b-it": Base_Ai_Cf_Google_Gemma_3_12B_It;
5994
6702
  "@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;
6703
+ "@cf/deepgram/nova-3": Base_Ai_Cf_Deepgram_Nova_3;
6704
+ "@cf/pipecat-ai/smart-turn-v2": Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2;
6705
+ "@cf/openai/gpt-oss-120b": Base_Ai_Cf_Openai_Gpt_Oss_120B;
6706
+ "@cf/openai/gpt-oss-20b": Base_Ai_Cf_Openai_Gpt_Oss_20B;
6707
+ "@cf/leonardo/phoenix-1.0": Base_Ai_Cf_Leonardo_Phoenix_1_0;
6708
+ "@cf/leonardo/lucid-origin": Base_Ai_Cf_Leonardo_Lucid_Origin;
6709
+ "@cf/deepgram/aura-1": Base_Ai_Cf_Deepgram_Aura_1;
5995
6710
  }
5996
6711
  export type AiOptions = {
5997
6712
  /**
@@ -5999,6 +6714,10 @@ export type AiOptions = {
5999
6714
  * https://developers.cloudflare.com/workers-ai/features/batch-api
6000
6715
  */
6001
6716
  queueRequest?: boolean;
6717
+ /**
6718
+ * Establish websocket connections, only works for supported models
6719
+ */
6720
+ websocket?: boolean;
6002
6721
  gateway?: GatewayOptions;
6003
6722
  returnRawResponse?: boolean;
6004
6723
  prefix?: string;
@@ -6044,7 +6763,7 @@ export declare abstract class Ai<
6044
6763
  > {
6045
6764
  aiGatewayLogId: string | null;
6046
6765
  gateway(gatewayId: string): AiGateway;
6047
- autorag(autoragId?: string): AutoRAG;
6766
+ autorag(autoragId: string): AutoRAG;
6048
6767
  run<
6049
6768
  Name extends keyof AiModelList,
6050
6769
  Options extends AiOptions,
@@ -6054,9 +6773,13 @@ export declare abstract class Ai<
6054
6773
  inputs: InputOptions,
6055
6774
  options?: Options,
6056
6775
  ): Promise<
6057
- Options extends {
6058
- returnRawResponse: true;
6059
- }
6776
+ Options extends
6777
+ | {
6778
+ returnRawResponse: true;
6779
+ }
6780
+ | {
6781
+ websocket: true;
6782
+ }
6060
6783
  ? Response
6061
6784
  : InputOptions extends {
6062
6785
  stream: true;
@@ -8241,7 +8964,6 @@ export declare namespace TailStream {
8241
8964
  }
8242
8965
  interface JsRpcEventInfo {
8243
8966
  readonly type: "jsrpc";
8244
- readonly methodName: string;
8245
8967
  }
8246
8968
  interface ScheduledEventInfo {
8247
8969
  readonly type: "scheduled";