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