@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.ts CHANGED
@@ -475,18 +475,6 @@ export declare abstract class Navigator {
475
475
  readonly language: string;
476
476
  readonly languages: string[];
477
477
  }
478
- /**
479
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
480
- * as well as timing of subrequests and other operations.
481
- *
482
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
483
- */
484
- export interface Performance {
485
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
486
- readonly timeOrigin: number;
487
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
488
- now(): number;
489
- }
490
478
  export interface AlarmInvocationInfo {
491
479
  readonly isRetry: boolean;
492
480
  readonly retryCount: number;
@@ -3206,6 +3194,18 @@ export interface WorkerLoaderWorkerCode {
3206
3194
  tails?: Fetcher[];
3207
3195
  streamingTails?: Fetcher[];
3208
3196
  }
3197
+ /**
3198
+ * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3199
+ * as well as timing of subrequests and other operations.
3200
+ *
3201
+ * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3202
+ */
3203
+ export declare abstract class Performance {
3204
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3205
+ get timeOrigin(): number;
3206
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3207
+ now(): number;
3208
+ }
3209
3209
  export type AiImageClassificationInput = {
3210
3210
  image: number[];
3211
3211
  };
@@ -3260,6 +3260,18 @@ export declare abstract class BaseAiImageTextToText {
3260
3260
  inputs: AiImageTextToTextInput;
3261
3261
  postProcessedOutputs: AiImageTextToTextOutput;
3262
3262
  }
3263
+ export type AiMultimodalEmbeddingsInput = {
3264
+ image: string;
3265
+ text: string[];
3266
+ };
3267
+ export type AiIMultimodalEmbeddingsOutput = {
3268
+ data: number[][];
3269
+ shape: number[];
3270
+ };
3271
+ export declare abstract class BaseAiMultimodalEmbeddings {
3272
+ inputs: AiImageTextToTextInput;
3273
+ postProcessedOutputs: AiImageTextToTextOutput;
3274
+ }
3263
3275
  export type AiObjectDetectionInput = {
3264
3276
  image: number[];
3265
3277
  };
@@ -3398,12 +3410,28 @@ export type AiTextGenerationInput = {
3398
3410
  | (object & NonNullable<unknown>);
3399
3411
  functions?: AiTextGenerationFunctionsInput[];
3400
3412
  };
3413
+ export type AiTextGenerationToolLegacyOutput = {
3414
+ name: string;
3415
+ arguments: unknown;
3416
+ };
3417
+ export type AiTextGenerationToolOutput = {
3418
+ id: string;
3419
+ type: "function";
3420
+ function: {
3421
+ name: string;
3422
+ arguments: string;
3423
+ };
3424
+ };
3425
+ export type UsageTags = {
3426
+ prompt_tokens: number;
3427
+ completion_tokens: number;
3428
+ total_tokens: number;
3429
+ };
3401
3430
  export type AiTextGenerationOutput = {
3402
3431
  response?: string;
3403
- tool_calls?: {
3404
- name: string;
3405
- arguments: unknown;
3406
- }[];
3432
+ tool_calls?: AiTextGenerationToolLegacyOutput[] &
3433
+ AiTextGenerationToolOutput[];
3434
+ usage?: UsageTags;
3407
3435
  };
3408
3436
  export declare abstract class BaseAiTextGeneration {
3409
3437
  inputs: AiTextGenerationInput;
@@ -4492,6 +4520,7 @@ export type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output =
4492
4520
  name?: string;
4493
4521
  }[];
4494
4522
  }
4523
+ | string
4495
4524
  | AsyncResponse;
4496
4525
  export declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast {
4497
4526
  inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input;
@@ -4568,7 +4597,6 @@ export interface Ai_Cf_Baai_Bge_Reranker_Base_Input {
4568
4597
  /**
4569
4598
  * A query you wish to perform against the provided contexts.
4570
4599
  */
4571
- query: string;
4572
4600
  /**
4573
4601
  * Number of returned results starting with the best score.
4574
4602
  */
@@ -5663,7 +5691,8 @@ export declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It {
5663
5691
  }
5664
5692
  export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input =
5665
5693
  | Ai_Cf_Meta_Llama_4_Prompt
5666
- | Ai_Cf_Meta_Llama_4_Messages;
5694
+ | Ai_Cf_Meta_Llama_4_Messages
5695
+ | Ai_Cf_Meta_Llama_4_Async_Batch;
5667
5696
  export interface Ai_Cf_Meta_Llama_4_Prompt {
5668
5697
  /**
5669
5698
  * The input text prompt for the model to generate a response.
@@ -5897,6 +5926,245 @@ export interface Ai_Cf_Meta_Llama_4_Messages {
5897
5926
  */
5898
5927
  presence_penalty?: number;
5899
5928
  }
5929
+ export interface Ai_Cf_Meta_Llama_4_Async_Batch {
5930
+ requests: (
5931
+ | Ai_Cf_Meta_Llama_4_Prompt_Inner
5932
+ | Ai_Cf_Meta_Llama_4_Messages_Inner
5933
+ )[];
5934
+ }
5935
+ export interface Ai_Cf_Meta_Llama_4_Prompt_Inner {
5936
+ /**
5937
+ * The input text prompt for the model to generate a response.
5938
+ */
5939
+ prompt: string;
5940
+ /**
5941
+ * JSON schema that should be fulfilled for the response.
5942
+ */
5943
+ guided_json?: object;
5944
+ response_format?: JSONMode;
5945
+ /**
5946
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
5947
+ */
5948
+ raw?: boolean;
5949
+ /**
5950
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
5951
+ */
5952
+ stream?: boolean;
5953
+ /**
5954
+ * The maximum number of tokens to generate in the response.
5955
+ */
5956
+ max_tokens?: number;
5957
+ /**
5958
+ * Controls the randomness of the output; higher values produce more random results.
5959
+ */
5960
+ temperature?: number;
5961
+ /**
5962
+ * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
5963
+ */
5964
+ top_p?: number;
5965
+ /**
5966
+ * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
5967
+ */
5968
+ top_k?: number;
5969
+ /**
5970
+ * Random seed for reproducibility of the generation.
5971
+ */
5972
+ seed?: number;
5973
+ /**
5974
+ * Penalty for repeated tokens; higher values discourage repetition.
5975
+ */
5976
+ repetition_penalty?: number;
5977
+ /**
5978
+ * Decreases the likelihood of the model repeating the same lines verbatim.
5979
+ */
5980
+ frequency_penalty?: number;
5981
+ /**
5982
+ * Increases the likelihood of the model introducing new topics.
5983
+ */
5984
+ presence_penalty?: number;
5985
+ }
5986
+ export interface Ai_Cf_Meta_Llama_4_Messages_Inner {
5987
+ /**
5988
+ * An array of message objects representing the conversation history.
5989
+ */
5990
+ messages: {
5991
+ /**
5992
+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
5993
+ */
5994
+ role?: string;
5995
+ /**
5996
+ * The tool call id. If you don't know what to put here you can fall back to 000000001
5997
+ */
5998
+ tool_call_id?: string;
5999
+ content?:
6000
+ | string
6001
+ | {
6002
+ /**
6003
+ * Type of the content provided
6004
+ */
6005
+ type?: string;
6006
+ text?: string;
6007
+ image_url?: {
6008
+ /**
6009
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
6010
+ */
6011
+ url?: string;
6012
+ };
6013
+ }[]
6014
+ | {
6015
+ /**
6016
+ * Type of the content provided
6017
+ */
6018
+ type?: string;
6019
+ text?: string;
6020
+ image_url?: {
6021
+ /**
6022
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
6023
+ */
6024
+ url?: string;
6025
+ };
6026
+ };
6027
+ }[];
6028
+ functions?: {
6029
+ name: string;
6030
+ code: string;
6031
+ }[];
6032
+ /**
6033
+ * A list of tools available for the assistant to use.
6034
+ */
6035
+ tools?: (
6036
+ | {
6037
+ /**
6038
+ * The name of the tool. More descriptive the better.
6039
+ */
6040
+ name: string;
6041
+ /**
6042
+ * A brief description of what the tool does.
6043
+ */
6044
+ description: string;
6045
+ /**
6046
+ * Schema defining the parameters accepted by the tool.
6047
+ */
6048
+ parameters: {
6049
+ /**
6050
+ * The type of the parameters object (usually 'object').
6051
+ */
6052
+ type: string;
6053
+ /**
6054
+ * List of required parameter names.
6055
+ */
6056
+ required?: string[];
6057
+ /**
6058
+ * Definitions of each parameter.
6059
+ */
6060
+ properties: {
6061
+ [k: string]: {
6062
+ /**
6063
+ * The data type of the parameter.
6064
+ */
6065
+ type: string;
6066
+ /**
6067
+ * A description of the expected parameter.
6068
+ */
6069
+ description: string;
6070
+ };
6071
+ };
6072
+ };
6073
+ }
6074
+ | {
6075
+ /**
6076
+ * Specifies the type of tool (e.g., 'function').
6077
+ */
6078
+ type: string;
6079
+ /**
6080
+ * Details of the function tool.
6081
+ */
6082
+ function: {
6083
+ /**
6084
+ * The name of the function.
6085
+ */
6086
+ name: string;
6087
+ /**
6088
+ * A brief description of what the function does.
6089
+ */
6090
+ description: string;
6091
+ /**
6092
+ * Schema defining the parameters accepted by the function.
6093
+ */
6094
+ parameters: {
6095
+ /**
6096
+ * The type of the parameters object (usually 'object').
6097
+ */
6098
+ type: string;
6099
+ /**
6100
+ * List of required parameter names.
6101
+ */
6102
+ required?: string[];
6103
+ /**
6104
+ * Definitions of each parameter.
6105
+ */
6106
+ properties: {
6107
+ [k: string]: {
6108
+ /**
6109
+ * The data type of the parameter.
6110
+ */
6111
+ type: string;
6112
+ /**
6113
+ * A description of the expected parameter.
6114
+ */
6115
+ description: string;
6116
+ };
6117
+ };
6118
+ };
6119
+ };
6120
+ }
6121
+ )[];
6122
+ response_format?: JSONMode;
6123
+ /**
6124
+ * JSON schema that should be fufilled for the response.
6125
+ */
6126
+ guided_json?: object;
6127
+ /**
6128
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6129
+ */
6130
+ raw?: boolean;
6131
+ /**
6132
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6133
+ */
6134
+ stream?: boolean;
6135
+ /**
6136
+ * The maximum number of tokens to generate in the response.
6137
+ */
6138
+ max_tokens?: number;
6139
+ /**
6140
+ * Controls the randomness of the output; higher values produce more random results.
6141
+ */
6142
+ temperature?: number;
6143
+ /**
6144
+ * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
6145
+ */
6146
+ top_p?: number;
6147
+ /**
6148
+ * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
6149
+ */
6150
+ top_k?: number;
6151
+ /**
6152
+ * Random seed for reproducibility of the generation.
6153
+ */
6154
+ seed?: number;
6155
+ /**
6156
+ * Penalty for repeated tokens; higher values discourage repetition.
6157
+ */
6158
+ repetition_penalty?: number;
6159
+ /**
6160
+ * Decreases the likelihood of the model repeating the same lines verbatim.
6161
+ */
6162
+ frequency_penalty?: number;
6163
+ /**
6164
+ * Increases the likelihood of the model introducing new topics.
6165
+ */
6166
+ presence_penalty?: number;
6167
+ }
5900
6168
  export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = {
5901
6169
  /**
5902
6170
  * The generated text response from the model
@@ -5950,6 +6218,447 @@ export declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {
5950
6218
  inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;
5951
6219
  postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;
5952
6220
  }
6221
+ export interface Ai_Cf_Deepgram_Nova_3_Input {
6222
+ audio: {
6223
+ body: object;
6224
+ contentType: string;
6225
+ };
6226
+ /**
6227
+ * Sets how the model will interpret strings submitted to the custom_topic param. When strict, the model will only return topics submitted using the custom_topic param. When extended, the model will return its own detected topics in addition to those submitted using the custom_topic param.
6228
+ */
6229
+ custom_topic_mode?: "extended" | "strict";
6230
+ /**
6231
+ * Custom topics you want the model to detect within your input audio or text if present Submit up to 100
6232
+ */
6233
+ custom_topic?: string;
6234
+ /**
6235
+ * Sets how the model will interpret intents submitted to the custom_intent param. When strict, the model will only return intents submitted using the custom_intent param. When extended, the model will return its own detected intents in addition those submitted using the custom_intents param
6236
+ */
6237
+ custom_intent_mode?: "extended" | "strict";
6238
+ /**
6239
+ * Custom intents you want the model to detect within your input audio if present
6240
+ */
6241
+ custom_intent?: string;
6242
+ /**
6243
+ * Identifies and extracts key entities from content in submitted audio
6244
+ */
6245
+ detect_entities?: boolean;
6246
+ /**
6247
+ * Identifies the dominant language spoken in submitted audio
6248
+ */
6249
+ detect_language?: boolean;
6250
+ /**
6251
+ * Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0
6252
+ */
6253
+ diarize?: boolean;
6254
+ /**
6255
+ * Identify and extract key entities from content in submitted audio
6256
+ */
6257
+ dictation?: boolean;
6258
+ /**
6259
+ * Specify the expected encoding of your submitted audio
6260
+ */
6261
+ encoding?:
6262
+ | "linear16"
6263
+ | "flac"
6264
+ | "mulaw"
6265
+ | "amr-nb"
6266
+ | "amr-wb"
6267
+ | "opus"
6268
+ | "speex"
6269
+ | "g729";
6270
+ /**
6271
+ * Arbitrary key-value pairs that are attached to the API response for usage in downstream processing
6272
+ */
6273
+ extra?: string;
6274
+ /**
6275
+ * Filler Words can help transcribe interruptions in your audio, like 'uh' and 'um'
6276
+ */
6277
+ filler_words?: boolean;
6278
+ /**
6279
+ * Key term prompting can boost or suppress specialized terminology and brands.
6280
+ */
6281
+ keyterm?: string;
6282
+ /**
6283
+ * Keywords can boost or suppress specialized terminology and brands.
6284
+ */
6285
+ keywords?: string;
6286
+ /**
6287
+ * The BCP-47 language tag that hints at the primary spoken language. Depending on the Model and API endpoint you choose only certain languages are available.
6288
+ */
6289
+ language?: string;
6290
+ /**
6291
+ * Spoken measurements will be converted to their corresponding abbreviations.
6292
+ */
6293
+ measurements?: boolean;
6294
+ /**
6295
+ * Opts out requests from the Deepgram Model Improvement Program. Refer to our Docs for pricing impacts before setting this to true. https://dpgr.am/deepgram-mip.
6296
+ */
6297
+ mip_opt_out?: boolean;
6298
+ /**
6299
+ * Mode of operation for the model representing broad area of topic that will be talked about in the supplied audio
6300
+ */
6301
+ mode?: "general" | "medical" | "finance";
6302
+ /**
6303
+ * Transcribe each audio channel independently.
6304
+ */
6305
+ multichannel?: boolean;
6306
+ /**
6307
+ * Numerals converts numbers from written format to numerical format.
6308
+ */
6309
+ numerals?: boolean;
6310
+ /**
6311
+ * Splits audio into paragraphs to improve transcript readability.
6312
+ */
6313
+ paragraphs?: boolean;
6314
+ /**
6315
+ * Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely.
6316
+ */
6317
+ profanity_filter?: boolean;
6318
+ /**
6319
+ * Add punctuation and capitalization to the transcript.
6320
+ */
6321
+ punctuate?: boolean;
6322
+ /**
6323
+ * Redaction removes sensitive information from your transcripts.
6324
+ */
6325
+ redact?: string;
6326
+ /**
6327
+ * Search for terms or phrases in submitted audio and replaces them.
6328
+ */
6329
+ replace?: string;
6330
+ /**
6331
+ * Search for terms or phrases in submitted audio.
6332
+ */
6333
+ search?: string;
6334
+ /**
6335
+ * Recognizes the sentiment throughout a transcript or text.
6336
+ */
6337
+ sentiment?: boolean;
6338
+ /**
6339
+ * Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability.
6340
+ */
6341
+ smart_format?: boolean;
6342
+ /**
6343
+ * Detect topics throughout a transcript or text.
6344
+ */
6345
+ topics?: boolean;
6346
+ /**
6347
+ * Segments speech into meaningful semantic units.
6348
+ */
6349
+ utterances?: boolean;
6350
+ /**
6351
+ * Seconds to wait before detecting a pause between words in submitted audio.
6352
+ */
6353
+ utt_split?: number;
6354
+ /**
6355
+ * The number of channels in the submitted audio
6356
+ */
6357
+ channels?: number;
6358
+ /**
6359
+ * Specifies whether the streaming endpoint should provide ongoing transcription updates as more audio is received. When set to true, the endpoint sends continuous updates, meaning transcription results may evolve over time. Note: Supported only for webosockets.
6360
+ */
6361
+ interim_results?: boolean;
6362
+ /**
6363
+ * Indicates how long model will wait to detect whether a speaker has finished speaking or pauses for a significant period of time. When set to a value, the streaming endpoint immediately finalizes the transcription for the processed time range and returns the transcript with a speech_final parameter set to true. Can also be set to false to disable endpointing
6364
+ */
6365
+ endpointing?: string;
6366
+ /**
6367
+ * Indicates that speech has started. You'll begin receiving Speech Started messages upon speech starting. Note: Supported only for webosockets.
6368
+ */
6369
+ vad_events?: boolean;
6370
+ /**
6371
+ * Indicates how long model will wait to send an UtteranceEnd message after a word has been transcribed. Use with interim_results. Note: Supported only for webosockets.
6372
+ */
6373
+ utterance_end_ms?: boolean;
6374
+ }
6375
+ export interface Ai_Cf_Deepgram_Nova_3_Output {
6376
+ results?: {
6377
+ channels?: {
6378
+ alternatives?: {
6379
+ confidence?: number;
6380
+ transcript?: string;
6381
+ words?: {
6382
+ confidence?: number;
6383
+ end?: number;
6384
+ start?: number;
6385
+ word?: string;
6386
+ }[];
6387
+ }[];
6388
+ }[];
6389
+ summary?: {
6390
+ result?: string;
6391
+ short?: string;
6392
+ };
6393
+ sentiments?: {
6394
+ segments?: {
6395
+ text?: string;
6396
+ start_word?: number;
6397
+ end_word?: number;
6398
+ sentiment?: string;
6399
+ sentiment_score?: number;
6400
+ }[];
6401
+ average?: {
6402
+ sentiment?: string;
6403
+ sentiment_score?: number;
6404
+ };
6405
+ };
6406
+ };
6407
+ }
6408
+ export declare abstract class Base_Ai_Cf_Deepgram_Nova_3 {
6409
+ inputs: Ai_Cf_Deepgram_Nova_3_Input;
6410
+ postProcessedOutputs: Ai_Cf_Deepgram_Nova_3_Output;
6411
+ }
6412
+ export type Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input =
6413
+ | {
6414
+ /**
6415
+ * readable stream with audio data and content-type specified for that data
6416
+ */
6417
+ audio: {
6418
+ body: object;
6419
+ contentType: string;
6420
+ };
6421
+ /**
6422
+ * type of data PCM data that's sent to the inference server as raw array
6423
+ */
6424
+ dtype?: "uint8" | "float32" | "float64";
6425
+ }
6426
+ | {
6427
+ /**
6428
+ * base64 encoded audio data
6429
+ */
6430
+ audio: string;
6431
+ /**
6432
+ * type of data PCM data that's sent to the inference server as raw array
6433
+ */
6434
+ dtype?: "uint8" | "float32" | "float64";
6435
+ };
6436
+ export interface Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output {
6437
+ /**
6438
+ * if true, end-of-turn was detected
6439
+ */
6440
+ is_complete?: boolean;
6441
+ /**
6442
+ * probability of the end-of-turn detection
6443
+ */
6444
+ probability?: number;
6445
+ }
6446
+ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
6447
+ inputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input;
6448
+ postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
6449
+ }
6450
+ export type Ai_Cf_Openai_Gpt_Oss_120B_Input =
6451
+ | GPT_OSS_120B_Responses
6452
+ | GPT_OSS_120B_Responses_Async;
6453
+ export interface GPT_OSS_120B_Responses {
6454
+ /**
6455
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6456
+ */
6457
+ input: string | unknown[];
6458
+ reasoning?: {
6459
+ /**
6460
+ * Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
6461
+ */
6462
+ effort?: "low" | "medium" | "high";
6463
+ /**
6464
+ * A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.
6465
+ */
6466
+ summary?: "auto" | "concise" | "detailed";
6467
+ };
6468
+ }
6469
+ export interface GPT_OSS_120B_Responses_Async {
6470
+ requests: {
6471
+ /**
6472
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6473
+ */
6474
+ input: string | unknown[];
6475
+ reasoning?: {
6476
+ /**
6477
+ * Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
6478
+ */
6479
+ effort?: "low" | "medium" | "high";
6480
+ /**
6481
+ * A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.
6482
+ */
6483
+ summary?: "auto" | "concise" | "detailed";
6484
+ };
6485
+ }[];
6486
+ }
6487
+ export type Ai_Cf_Openai_Gpt_Oss_120B_Output =
6488
+ | {}
6489
+ | (string & NonNullable<unknown>);
6490
+ export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
6491
+ inputs: Ai_Cf_Openai_Gpt_Oss_120B_Input;
6492
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_120B_Output;
6493
+ }
6494
+ export type Ai_Cf_Openai_Gpt_Oss_20B_Input =
6495
+ | GPT_OSS_20B_Responses
6496
+ | GPT_OSS_20B_Responses_Async;
6497
+ export interface GPT_OSS_20B_Responses {
6498
+ /**
6499
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6500
+ */
6501
+ input: string | unknown[];
6502
+ reasoning?: {
6503
+ /**
6504
+ * Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
6505
+ */
6506
+ effort?: "low" | "medium" | "high";
6507
+ /**
6508
+ * A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.
6509
+ */
6510
+ summary?: "auto" | "concise" | "detailed";
6511
+ };
6512
+ }
6513
+ export interface GPT_OSS_20B_Responses_Async {
6514
+ requests: {
6515
+ /**
6516
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6517
+ */
6518
+ input: string | unknown[];
6519
+ reasoning?: {
6520
+ /**
6521
+ * Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
6522
+ */
6523
+ effort?: "low" | "medium" | "high";
6524
+ /**
6525
+ * A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of auto, concise, or detailed.
6526
+ */
6527
+ summary?: "auto" | "concise" | "detailed";
6528
+ };
6529
+ }[];
6530
+ }
6531
+ export type Ai_Cf_Openai_Gpt_Oss_20B_Output =
6532
+ | {}
6533
+ | (string & NonNullable<unknown>);
6534
+ export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
6535
+ inputs: Ai_Cf_Openai_Gpt_Oss_20B_Input;
6536
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_20B_Output;
6537
+ }
6538
+ export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
6539
+ /**
6540
+ * A text description of the image you want to generate.
6541
+ */
6542
+ prompt: string;
6543
+ /**
6544
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6545
+ */
6546
+ guidance?: number;
6547
+ /**
6548
+ * Random seed for reproducibility of the image generation
6549
+ */
6550
+ seed?: number;
6551
+ /**
6552
+ * The height of the generated image in pixels
6553
+ */
6554
+ height?: number;
6555
+ /**
6556
+ * The width of the generated image in pixels
6557
+ */
6558
+ width?: number;
6559
+ /**
6560
+ * The number of diffusion steps; higher values can improve quality but take longer
6561
+ */
6562
+ num_steps?: number;
6563
+ /**
6564
+ * Specify what to exclude from the generated images
6565
+ */
6566
+ negative_prompt?: string;
6567
+ }
6568
+ /**
6569
+ * The generated image in JPEG format
6570
+ */
6571
+ export type Ai_Cf_Leonardo_Phoenix_1_0_Output = string;
6572
+ export declare abstract class Base_Ai_Cf_Leonardo_Phoenix_1_0 {
6573
+ inputs: Ai_Cf_Leonardo_Phoenix_1_0_Input;
6574
+ postProcessedOutputs: Ai_Cf_Leonardo_Phoenix_1_0_Output;
6575
+ }
6576
+ export interface Ai_Cf_Leonardo_Lucid_Origin_Input {
6577
+ /**
6578
+ * A text description of the image you want to generate.
6579
+ */
6580
+ prompt: string;
6581
+ /**
6582
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6583
+ */
6584
+ guidance?: number;
6585
+ /**
6586
+ * Random seed for reproducibility of the image generation
6587
+ */
6588
+ seed?: number;
6589
+ /**
6590
+ * The height of the generated image in pixels
6591
+ */
6592
+ height?: number;
6593
+ /**
6594
+ * The width of the generated image in pixels
6595
+ */
6596
+ width?: number;
6597
+ /**
6598
+ * The number of diffusion steps; higher values can improve quality but take longer
6599
+ */
6600
+ num_steps?: number;
6601
+ /**
6602
+ * The number of diffusion steps; higher values can improve quality but take longer
6603
+ */
6604
+ steps?: number;
6605
+ }
6606
+ export interface Ai_Cf_Leonardo_Lucid_Origin_Output {
6607
+ /**
6608
+ * The generated image in Base64 format.
6609
+ */
6610
+ image?: string;
6611
+ }
6612
+ export declare abstract class Base_Ai_Cf_Leonardo_Lucid_Origin {
6613
+ inputs: Ai_Cf_Leonardo_Lucid_Origin_Input;
6614
+ postProcessedOutputs: Ai_Cf_Leonardo_Lucid_Origin_Output;
6615
+ }
6616
+ export interface Ai_Cf_Deepgram_Aura_1_Input {
6617
+ /**
6618
+ * Speaker used to produce the audio.
6619
+ */
6620
+ speaker?:
6621
+ | "angus"
6622
+ | "asteria"
6623
+ | "arcas"
6624
+ | "orion"
6625
+ | "orpheus"
6626
+ | "athena"
6627
+ | "luna"
6628
+ | "zeus"
6629
+ | "perseus"
6630
+ | "helios"
6631
+ | "hera"
6632
+ | "stella";
6633
+ /**
6634
+ * Encoding of the output audio.
6635
+ */
6636
+ encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac";
6637
+ /**
6638
+ * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..
6639
+ */
6640
+ container?: "none" | "wav" | "ogg";
6641
+ /**
6642
+ * The text content to be converted to speech
6643
+ */
6644
+ text: string;
6645
+ /**
6646
+ * Sample Rate specifies the sample rate for the output audio. Based on the encoding, different sample rates are supported. For some encodings, the sample rate is not configurable
6647
+ */
6648
+ sample_rate?: number;
6649
+ /**
6650
+ * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.
6651
+ */
6652
+ bit_rate?: number;
6653
+ }
6654
+ /**
6655
+ * The generated audio in MP3 format
6656
+ */
6657
+ export type Ai_Cf_Deepgram_Aura_1_Output = string;
6658
+ export declare abstract class Base_Ai_Cf_Deepgram_Aura_1 {
6659
+ inputs: Ai_Cf_Deepgram_Aura_1_Input;
6660
+ postProcessedOutputs: Ai_Cf_Deepgram_Aura_1_Output;
6661
+ }
5953
6662
  export interface AiModels {
5954
6663
  "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
5955
6664
  "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
@@ -5958,8 +6667,8 @@ export interface AiModels {
5958
6667
  "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
5959
6668
  "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
5960
6669
  "@cf/myshell-ai/melotts": BaseAiTextToSpeech;
6670
+ "@cf/google/embeddinggemma-300m": BaseAiTextEmbeddings;
5961
6671
  "@cf/microsoft/resnet-50": BaseAiImageClassification;
5962
- "@cf/facebook/detr-resnet-50": BaseAiObjectDetection;
5963
6672
  "@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
5964
6673
  "@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
5965
6674
  "@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
@@ -5994,7 +6703,6 @@ export interface AiModels {
5994
6703
  "@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
5995
6704
  "@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
5996
6705
  "@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
5997
- "@cf/meta/llama-3.1-8b-instruct": BaseAiTextGeneration;
5998
6706
  "@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
5999
6707
  "@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
6000
6708
  "@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
@@ -6021,6 +6729,13 @@ export interface AiModels {
6021
6729
  "@cf/mistralai/mistral-small-3.1-24b-instruct": Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct;
6022
6730
  "@cf/google/gemma-3-12b-it": Base_Ai_Cf_Google_Gemma_3_12B_It;
6023
6731
  "@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;
6732
+ "@cf/deepgram/nova-3": Base_Ai_Cf_Deepgram_Nova_3;
6733
+ "@cf/pipecat-ai/smart-turn-v2": Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2;
6734
+ "@cf/openai/gpt-oss-120b": Base_Ai_Cf_Openai_Gpt_Oss_120B;
6735
+ "@cf/openai/gpt-oss-20b": Base_Ai_Cf_Openai_Gpt_Oss_20B;
6736
+ "@cf/leonardo/phoenix-1.0": Base_Ai_Cf_Leonardo_Phoenix_1_0;
6737
+ "@cf/leonardo/lucid-origin": Base_Ai_Cf_Leonardo_Lucid_Origin;
6738
+ "@cf/deepgram/aura-1": Base_Ai_Cf_Deepgram_Aura_1;
6024
6739
  }
6025
6740
  export type AiOptions = {
6026
6741
  /**
@@ -6028,6 +6743,10 @@ export type AiOptions = {
6028
6743
  * https://developers.cloudflare.com/workers-ai/features/batch-api
6029
6744
  */
6030
6745
  queueRequest?: boolean;
6746
+ /**
6747
+ * Establish websocket connections, only works for supported models
6748
+ */
6749
+ websocket?: boolean;
6031
6750
  gateway?: GatewayOptions;
6032
6751
  returnRawResponse?: boolean;
6033
6752
  prefix?: string;
@@ -6073,7 +6792,7 @@ export declare abstract class Ai<
6073
6792
  > {
6074
6793
  aiGatewayLogId: string | null;
6075
6794
  gateway(gatewayId: string): AiGateway;
6076
- autorag(autoragId?: string): AutoRAG;
6795
+ autorag(autoragId: string): AutoRAG;
6077
6796
  run<
6078
6797
  Name extends keyof AiModelList,
6079
6798
  Options extends AiOptions,
@@ -6083,9 +6802,13 @@ export declare abstract class Ai<
6083
6802
  inputs: InputOptions,
6084
6803
  options?: Options,
6085
6804
  ): Promise<
6086
- Options extends {
6087
- returnRawResponse: true;
6088
- }
6805
+ Options extends
6806
+ | {
6807
+ returnRawResponse: true;
6808
+ }
6809
+ | {
6810
+ websocket: true;
6811
+ }
6089
6812
  ? Response
6090
6813
  : InputOptions extends {
6091
6814
  stream: true;
@@ -8270,7 +8993,6 @@ export declare namespace TailStream {
8270
8993
  }
8271
8994
  interface JsRpcEventInfo {
8272
8995
  readonly type: "jsrpc";
8273
- readonly methodName: string;
8274
8996
  }
8275
8997
  interface ScheduledEventInfo {
8276
8998
  readonly type: "scheduled";