@cloudflare/workers-types 4.20250913.0 → 4.20250918.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -287,7 +287,6 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
287
287
  FixedLengthStream: typeof FixedLengthStream;
288
288
  IdentityTransformStream: typeof IdentityTransformStream;
289
289
  HTMLRewriter: typeof HTMLRewriter;
290
- Performance: typeof Performance;
291
290
  }
292
291
  export declare function addEventListener<
293
292
  Type extends keyof WorkerGlobalScopeEventMap,
@@ -449,6 +448,18 @@ export declare abstract class PromiseRejectionEvent extends Event {
449
448
  /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
450
449
  readonly reason: any;
451
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
+ }
452
463
  export interface AlarmInvocationInfo {
453
464
  readonly isRetry: boolean;
454
465
  readonly retryCount: number;
@@ -3110,18 +3121,6 @@ export interface WorkerLoaderWorkerCode {
3110
3121
  tails?: Fetcher[];
3111
3122
  streamingTails?: Fetcher[];
3112
3123
  }
3113
- /**
3114
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
3115
- * as well as timing of subrequests and other operations.
3116
- *
3117
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
3118
- */
3119
- export declare abstract class Performance {
3120
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
3121
- get timeOrigin(): number;
3122
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
3123
- now(): number;
3124
- }
3125
3124
  export type AiImageClassificationInput = {
3126
3125
  image: number[];
3127
3126
  };
@@ -3176,6 +3175,18 @@ export declare abstract class BaseAiImageTextToText {
3176
3175
  inputs: AiImageTextToTextInput;
3177
3176
  postProcessedOutputs: AiImageTextToTextOutput;
3178
3177
  }
3178
+ export type AiMultimodalEmbeddingsInput = {
3179
+ image: string;
3180
+ text: string[];
3181
+ };
3182
+ export type AiIMultimodalEmbeddingsOutput = {
3183
+ data: number[][];
3184
+ shape: number[];
3185
+ };
3186
+ export declare abstract class BaseAiMultimodalEmbeddings {
3187
+ inputs: AiImageTextToTextInput;
3188
+ postProcessedOutputs: AiImageTextToTextOutput;
3189
+ }
3179
3190
  export type AiObjectDetectionInput = {
3180
3191
  image: number[];
3181
3192
  };
@@ -3314,12 +3325,28 @@ export type AiTextGenerationInput = {
3314
3325
  | (object & NonNullable<unknown>);
3315
3326
  functions?: AiTextGenerationFunctionsInput[];
3316
3327
  };
3328
+ export type AiTextGenerationToolLegacyOutput = {
3329
+ name: string;
3330
+ arguments: unknown;
3331
+ };
3332
+ export type AiTextGenerationToolOutput = {
3333
+ id: string;
3334
+ type: "function";
3335
+ function: {
3336
+ name: string;
3337
+ arguments: string;
3338
+ };
3339
+ };
3340
+ export type UsageTags = {
3341
+ prompt_tokens: number;
3342
+ completion_tokens: number;
3343
+ total_tokens: number;
3344
+ };
3317
3345
  export type AiTextGenerationOutput = {
3318
3346
  response?: string;
3319
- tool_calls?: {
3320
- name: string;
3321
- arguments: unknown;
3322
- }[];
3347
+ tool_calls?: AiTextGenerationToolLegacyOutput[] &
3348
+ AiTextGenerationToolOutput[];
3349
+ usage?: UsageTags;
3323
3350
  };
3324
3351
  export declare abstract class BaseAiTextGeneration {
3325
3352
  inputs: AiTextGenerationInput;
@@ -4408,6 +4435,7 @@ export type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output =
4408
4435
  name?: string;
4409
4436
  }[];
4410
4437
  }
4438
+ | string
4411
4439
  | AsyncResponse;
4412
4440
  export declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast {
4413
4441
  inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input;
@@ -4484,7 +4512,6 @@ export interface Ai_Cf_Baai_Bge_Reranker_Base_Input {
4484
4512
  /**
4485
4513
  * A query you wish to perform against the provided contexts.
4486
4514
  */
4487
- query: string;
4488
4515
  /**
4489
4516
  * Number of returned results starting with the best score.
4490
4517
  */
@@ -5579,7 +5606,8 @@ export declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It {
5579
5606
  }
5580
5607
  export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input =
5581
5608
  | Ai_Cf_Meta_Llama_4_Prompt
5582
- | Ai_Cf_Meta_Llama_4_Messages;
5609
+ | Ai_Cf_Meta_Llama_4_Messages
5610
+ | Ai_Cf_Meta_Llama_4_Async_Batch;
5583
5611
  export interface Ai_Cf_Meta_Llama_4_Prompt {
5584
5612
  /**
5585
5613
  * The input text prompt for the model to generate a response.
@@ -5813,6 +5841,245 @@ export interface Ai_Cf_Meta_Llama_4_Messages {
5813
5841
  */
5814
5842
  presence_penalty?: number;
5815
5843
  }
5844
+ export interface Ai_Cf_Meta_Llama_4_Async_Batch {
5845
+ requests: (
5846
+ | Ai_Cf_Meta_Llama_4_Prompt_Inner
5847
+ | Ai_Cf_Meta_Llama_4_Messages_Inner
5848
+ )[];
5849
+ }
5850
+ export interface Ai_Cf_Meta_Llama_4_Prompt_Inner {
5851
+ /**
5852
+ * The input text prompt for the model to generate a response.
5853
+ */
5854
+ prompt: string;
5855
+ /**
5856
+ * JSON schema that should be fulfilled for the response.
5857
+ */
5858
+ guided_json?: object;
5859
+ response_format?: JSONMode;
5860
+ /**
5861
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
5862
+ */
5863
+ raw?: boolean;
5864
+ /**
5865
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
5866
+ */
5867
+ stream?: boolean;
5868
+ /**
5869
+ * The maximum number of tokens to generate in the response.
5870
+ */
5871
+ max_tokens?: number;
5872
+ /**
5873
+ * Controls the randomness of the output; higher values produce more random results.
5874
+ */
5875
+ temperature?: number;
5876
+ /**
5877
+ * 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.
5878
+ */
5879
+ top_p?: number;
5880
+ /**
5881
+ * 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.
5882
+ */
5883
+ top_k?: number;
5884
+ /**
5885
+ * Random seed for reproducibility of the generation.
5886
+ */
5887
+ seed?: number;
5888
+ /**
5889
+ * Penalty for repeated tokens; higher values discourage repetition.
5890
+ */
5891
+ repetition_penalty?: number;
5892
+ /**
5893
+ * Decreases the likelihood of the model repeating the same lines verbatim.
5894
+ */
5895
+ frequency_penalty?: number;
5896
+ /**
5897
+ * Increases the likelihood of the model introducing new topics.
5898
+ */
5899
+ presence_penalty?: number;
5900
+ }
5901
+ export interface Ai_Cf_Meta_Llama_4_Messages_Inner {
5902
+ /**
5903
+ * An array of message objects representing the conversation history.
5904
+ */
5905
+ messages: {
5906
+ /**
5907
+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
5908
+ */
5909
+ role?: string;
5910
+ /**
5911
+ * The tool call id. If you don't know what to put here you can fall back to 000000001
5912
+ */
5913
+ tool_call_id?: string;
5914
+ content?:
5915
+ | string
5916
+ | {
5917
+ /**
5918
+ * Type of the content provided
5919
+ */
5920
+ type?: string;
5921
+ text?: string;
5922
+ image_url?: {
5923
+ /**
5924
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5925
+ */
5926
+ url?: string;
5927
+ };
5928
+ }[]
5929
+ | {
5930
+ /**
5931
+ * Type of the content provided
5932
+ */
5933
+ type?: string;
5934
+ text?: string;
5935
+ image_url?: {
5936
+ /**
5937
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5938
+ */
5939
+ url?: string;
5940
+ };
5941
+ };
5942
+ }[];
5943
+ functions?: {
5944
+ name: string;
5945
+ code: string;
5946
+ }[];
5947
+ /**
5948
+ * A list of tools available for the assistant to use.
5949
+ */
5950
+ tools?: (
5951
+ | {
5952
+ /**
5953
+ * The name of the tool. More descriptive the better.
5954
+ */
5955
+ name: string;
5956
+ /**
5957
+ * A brief description of what the tool does.
5958
+ */
5959
+ description: string;
5960
+ /**
5961
+ * Schema defining the parameters accepted by the tool.
5962
+ */
5963
+ parameters: {
5964
+ /**
5965
+ * The type of the parameters object (usually 'object').
5966
+ */
5967
+ type: string;
5968
+ /**
5969
+ * List of required parameter names.
5970
+ */
5971
+ required?: string[];
5972
+ /**
5973
+ * Definitions of each parameter.
5974
+ */
5975
+ properties: {
5976
+ [k: string]: {
5977
+ /**
5978
+ * The data type of the parameter.
5979
+ */
5980
+ type: string;
5981
+ /**
5982
+ * A description of the expected parameter.
5983
+ */
5984
+ description: string;
5985
+ };
5986
+ };
5987
+ };
5988
+ }
5989
+ | {
5990
+ /**
5991
+ * Specifies the type of tool (e.g., 'function').
5992
+ */
5993
+ type: string;
5994
+ /**
5995
+ * Details of the function tool.
5996
+ */
5997
+ function: {
5998
+ /**
5999
+ * The name of the function.
6000
+ */
6001
+ name: string;
6002
+ /**
6003
+ * A brief description of what the function does.
6004
+ */
6005
+ description: string;
6006
+ /**
6007
+ * Schema defining the parameters accepted by the function.
6008
+ */
6009
+ parameters: {
6010
+ /**
6011
+ * The type of the parameters object (usually 'object').
6012
+ */
6013
+ type: string;
6014
+ /**
6015
+ * List of required parameter names.
6016
+ */
6017
+ required?: string[];
6018
+ /**
6019
+ * Definitions of each parameter.
6020
+ */
6021
+ properties: {
6022
+ [k: string]: {
6023
+ /**
6024
+ * The data type of the parameter.
6025
+ */
6026
+ type: string;
6027
+ /**
6028
+ * A description of the expected parameter.
6029
+ */
6030
+ description: string;
6031
+ };
6032
+ };
6033
+ };
6034
+ };
6035
+ }
6036
+ )[];
6037
+ response_format?: JSONMode;
6038
+ /**
6039
+ * JSON schema that should be fufilled for the response.
6040
+ */
6041
+ guided_json?: object;
6042
+ /**
6043
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6044
+ */
6045
+ raw?: boolean;
6046
+ /**
6047
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6048
+ */
6049
+ stream?: boolean;
6050
+ /**
6051
+ * The maximum number of tokens to generate in the response.
6052
+ */
6053
+ max_tokens?: number;
6054
+ /**
6055
+ * Controls the randomness of the output; higher values produce more random results.
6056
+ */
6057
+ temperature?: number;
6058
+ /**
6059
+ * 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.
6060
+ */
6061
+ top_p?: number;
6062
+ /**
6063
+ * 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.
6064
+ */
6065
+ top_k?: number;
6066
+ /**
6067
+ * Random seed for reproducibility of the generation.
6068
+ */
6069
+ seed?: number;
6070
+ /**
6071
+ * Penalty for repeated tokens; higher values discourage repetition.
6072
+ */
6073
+ repetition_penalty?: number;
6074
+ /**
6075
+ * Decreases the likelihood of the model repeating the same lines verbatim.
6076
+ */
6077
+ frequency_penalty?: number;
6078
+ /**
6079
+ * Increases the likelihood of the model introducing new topics.
6080
+ */
6081
+ presence_penalty?: number;
6082
+ }
5816
6083
  export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = {
5817
6084
  /**
5818
6085
  * The generated text response from the model
@@ -5866,6 +6133,447 @@ export declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {
5866
6133
  inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;
5867
6134
  postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;
5868
6135
  }
6136
+ export interface Ai_Cf_Deepgram_Nova_3_Input {
6137
+ audio: {
6138
+ body: object;
6139
+ contentType: string;
6140
+ };
6141
+ /**
6142
+ * 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.
6143
+ */
6144
+ custom_topic_mode?: "extended" | "strict";
6145
+ /**
6146
+ * Custom topics you want the model to detect within your input audio or text if present Submit up to 100
6147
+ */
6148
+ custom_topic?: string;
6149
+ /**
6150
+ * 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
6151
+ */
6152
+ custom_intent_mode?: "extended" | "strict";
6153
+ /**
6154
+ * Custom intents you want the model to detect within your input audio if present
6155
+ */
6156
+ custom_intent?: string;
6157
+ /**
6158
+ * Identifies and extracts key entities from content in submitted audio
6159
+ */
6160
+ detect_entities?: boolean;
6161
+ /**
6162
+ * Identifies the dominant language spoken in submitted audio
6163
+ */
6164
+ detect_language?: boolean;
6165
+ /**
6166
+ * Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0
6167
+ */
6168
+ diarize?: boolean;
6169
+ /**
6170
+ * Identify and extract key entities from content in submitted audio
6171
+ */
6172
+ dictation?: boolean;
6173
+ /**
6174
+ * Specify the expected encoding of your submitted audio
6175
+ */
6176
+ encoding?:
6177
+ | "linear16"
6178
+ | "flac"
6179
+ | "mulaw"
6180
+ | "amr-nb"
6181
+ | "amr-wb"
6182
+ | "opus"
6183
+ | "speex"
6184
+ | "g729";
6185
+ /**
6186
+ * Arbitrary key-value pairs that are attached to the API response for usage in downstream processing
6187
+ */
6188
+ extra?: string;
6189
+ /**
6190
+ * Filler Words can help transcribe interruptions in your audio, like 'uh' and 'um'
6191
+ */
6192
+ filler_words?: boolean;
6193
+ /**
6194
+ * Key term prompting can boost or suppress specialized terminology and brands.
6195
+ */
6196
+ keyterm?: string;
6197
+ /**
6198
+ * Keywords can boost or suppress specialized terminology and brands.
6199
+ */
6200
+ keywords?: string;
6201
+ /**
6202
+ * 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.
6203
+ */
6204
+ language?: string;
6205
+ /**
6206
+ * Spoken measurements will be converted to their corresponding abbreviations.
6207
+ */
6208
+ measurements?: boolean;
6209
+ /**
6210
+ * 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.
6211
+ */
6212
+ mip_opt_out?: boolean;
6213
+ /**
6214
+ * Mode of operation for the model representing broad area of topic that will be talked about in the supplied audio
6215
+ */
6216
+ mode?: "general" | "medical" | "finance";
6217
+ /**
6218
+ * Transcribe each audio channel independently.
6219
+ */
6220
+ multichannel?: boolean;
6221
+ /**
6222
+ * Numerals converts numbers from written format to numerical format.
6223
+ */
6224
+ numerals?: boolean;
6225
+ /**
6226
+ * Splits audio into paragraphs to improve transcript readability.
6227
+ */
6228
+ paragraphs?: boolean;
6229
+ /**
6230
+ * Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely.
6231
+ */
6232
+ profanity_filter?: boolean;
6233
+ /**
6234
+ * Add punctuation and capitalization to the transcript.
6235
+ */
6236
+ punctuate?: boolean;
6237
+ /**
6238
+ * Redaction removes sensitive information from your transcripts.
6239
+ */
6240
+ redact?: string;
6241
+ /**
6242
+ * Search for terms or phrases in submitted audio and replaces them.
6243
+ */
6244
+ replace?: string;
6245
+ /**
6246
+ * Search for terms or phrases in submitted audio.
6247
+ */
6248
+ search?: string;
6249
+ /**
6250
+ * Recognizes the sentiment throughout a transcript or text.
6251
+ */
6252
+ sentiment?: boolean;
6253
+ /**
6254
+ * Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability.
6255
+ */
6256
+ smart_format?: boolean;
6257
+ /**
6258
+ * Detect topics throughout a transcript or text.
6259
+ */
6260
+ topics?: boolean;
6261
+ /**
6262
+ * Segments speech into meaningful semantic units.
6263
+ */
6264
+ utterances?: boolean;
6265
+ /**
6266
+ * Seconds to wait before detecting a pause between words in submitted audio.
6267
+ */
6268
+ utt_split?: number;
6269
+ /**
6270
+ * The number of channels in the submitted audio
6271
+ */
6272
+ channels?: number;
6273
+ /**
6274
+ * 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.
6275
+ */
6276
+ interim_results?: boolean;
6277
+ /**
6278
+ * 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
6279
+ */
6280
+ endpointing?: string;
6281
+ /**
6282
+ * Indicates that speech has started. You'll begin receiving Speech Started messages upon speech starting. Note: Supported only for webosockets.
6283
+ */
6284
+ vad_events?: boolean;
6285
+ /**
6286
+ * 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.
6287
+ */
6288
+ utterance_end_ms?: boolean;
6289
+ }
6290
+ export interface Ai_Cf_Deepgram_Nova_3_Output {
6291
+ results?: {
6292
+ channels?: {
6293
+ alternatives?: {
6294
+ confidence?: number;
6295
+ transcript?: string;
6296
+ words?: {
6297
+ confidence?: number;
6298
+ end?: number;
6299
+ start?: number;
6300
+ word?: string;
6301
+ }[];
6302
+ }[];
6303
+ }[];
6304
+ summary?: {
6305
+ result?: string;
6306
+ short?: string;
6307
+ };
6308
+ sentiments?: {
6309
+ segments?: {
6310
+ text?: string;
6311
+ start_word?: number;
6312
+ end_word?: number;
6313
+ sentiment?: string;
6314
+ sentiment_score?: number;
6315
+ }[];
6316
+ average?: {
6317
+ sentiment?: string;
6318
+ sentiment_score?: number;
6319
+ };
6320
+ };
6321
+ };
6322
+ }
6323
+ export declare abstract class Base_Ai_Cf_Deepgram_Nova_3 {
6324
+ inputs: Ai_Cf_Deepgram_Nova_3_Input;
6325
+ postProcessedOutputs: Ai_Cf_Deepgram_Nova_3_Output;
6326
+ }
6327
+ export type Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input =
6328
+ | {
6329
+ /**
6330
+ * readable stream with audio data and content-type specified for that data
6331
+ */
6332
+ audio: {
6333
+ body: object;
6334
+ contentType: string;
6335
+ };
6336
+ /**
6337
+ * type of data PCM data that's sent to the inference server as raw array
6338
+ */
6339
+ dtype?: "uint8" | "float32" | "float64";
6340
+ }
6341
+ | {
6342
+ /**
6343
+ * base64 encoded audio data
6344
+ */
6345
+ audio: string;
6346
+ /**
6347
+ * type of data PCM data that's sent to the inference server as raw array
6348
+ */
6349
+ dtype?: "uint8" | "float32" | "float64";
6350
+ };
6351
+ export interface Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output {
6352
+ /**
6353
+ * if true, end-of-turn was detected
6354
+ */
6355
+ is_complete?: boolean;
6356
+ /**
6357
+ * probability of the end-of-turn detection
6358
+ */
6359
+ probability?: number;
6360
+ }
6361
+ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
6362
+ inputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input;
6363
+ postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
6364
+ }
6365
+ export type Ai_Cf_Openai_Gpt_Oss_120B_Input =
6366
+ | GPT_OSS_120B_Responses
6367
+ | GPT_OSS_120B_Responses_Async;
6368
+ export interface GPT_OSS_120B_Responses {
6369
+ /**
6370
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6371
+ */
6372
+ input: string | unknown[];
6373
+ reasoning?: {
6374
+ /**
6375
+ * 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.
6376
+ */
6377
+ effort?: "low" | "medium" | "high";
6378
+ /**
6379
+ * 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.
6380
+ */
6381
+ summary?: "auto" | "concise" | "detailed";
6382
+ };
6383
+ }
6384
+ export interface GPT_OSS_120B_Responses_Async {
6385
+ requests: {
6386
+ /**
6387
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6388
+ */
6389
+ input: string | unknown[];
6390
+ reasoning?: {
6391
+ /**
6392
+ * 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.
6393
+ */
6394
+ effort?: "low" | "medium" | "high";
6395
+ /**
6396
+ * 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.
6397
+ */
6398
+ summary?: "auto" | "concise" | "detailed";
6399
+ };
6400
+ }[];
6401
+ }
6402
+ export type Ai_Cf_Openai_Gpt_Oss_120B_Output =
6403
+ | {}
6404
+ | (string & NonNullable<unknown>);
6405
+ export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
6406
+ inputs: Ai_Cf_Openai_Gpt_Oss_120B_Input;
6407
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_120B_Output;
6408
+ }
6409
+ export type Ai_Cf_Openai_Gpt_Oss_20B_Input =
6410
+ | GPT_OSS_20B_Responses
6411
+ | GPT_OSS_20B_Responses_Async;
6412
+ export interface GPT_OSS_20B_Responses {
6413
+ /**
6414
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6415
+ */
6416
+ input: string | unknown[];
6417
+ reasoning?: {
6418
+ /**
6419
+ * 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.
6420
+ */
6421
+ effort?: "low" | "medium" | "high";
6422
+ /**
6423
+ * 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.
6424
+ */
6425
+ summary?: "auto" | "concise" | "detailed";
6426
+ };
6427
+ }
6428
+ export interface GPT_OSS_20B_Responses_Async {
6429
+ requests: {
6430
+ /**
6431
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6432
+ */
6433
+ input: string | unknown[];
6434
+ reasoning?: {
6435
+ /**
6436
+ * 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.
6437
+ */
6438
+ effort?: "low" | "medium" | "high";
6439
+ /**
6440
+ * 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.
6441
+ */
6442
+ summary?: "auto" | "concise" | "detailed";
6443
+ };
6444
+ }[];
6445
+ }
6446
+ export type Ai_Cf_Openai_Gpt_Oss_20B_Output =
6447
+ | {}
6448
+ | (string & NonNullable<unknown>);
6449
+ export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
6450
+ inputs: Ai_Cf_Openai_Gpt_Oss_20B_Input;
6451
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_20B_Output;
6452
+ }
6453
+ export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
6454
+ /**
6455
+ * A text description of the image you want to generate.
6456
+ */
6457
+ prompt: string;
6458
+ /**
6459
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6460
+ */
6461
+ guidance?: number;
6462
+ /**
6463
+ * Random seed for reproducibility of the image generation
6464
+ */
6465
+ seed?: number;
6466
+ /**
6467
+ * The height of the generated image in pixels
6468
+ */
6469
+ height?: number;
6470
+ /**
6471
+ * The width of the generated image in pixels
6472
+ */
6473
+ width?: number;
6474
+ /**
6475
+ * The number of diffusion steps; higher values can improve quality but take longer
6476
+ */
6477
+ num_steps?: number;
6478
+ /**
6479
+ * Specify what to exclude from the generated images
6480
+ */
6481
+ negative_prompt?: string;
6482
+ }
6483
+ /**
6484
+ * The generated image in JPEG format
6485
+ */
6486
+ export type Ai_Cf_Leonardo_Phoenix_1_0_Output = string;
6487
+ export declare abstract class Base_Ai_Cf_Leonardo_Phoenix_1_0 {
6488
+ inputs: Ai_Cf_Leonardo_Phoenix_1_0_Input;
6489
+ postProcessedOutputs: Ai_Cf_Leonardo_Phoenix_1_0_Output;
6490
+ }
6491
+ export interface Ai_Cf_Leonardo_Lucid_Origin_Input {
6492
+ /**
6493
+ * A text description of the image you want to generate.
6494
+ */
6495
+ prompt: string;
6496
+ /**
6497
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6498
+ */
6499
+ guidance?: number;
6500
+ /**
6501
+ * Random seed for reproducibility of the image generation
6502
+ */
6503
+ seed?: number;
6504
+ /**
6505
+ * The height of the generated image in pixels
6506
+ */
6507
+ height?: number;
6508
+ /**
6509
+ * The width of the generated image in pixels
6510
+ */
6511
+ width?: number;
6512
+ /**
6513
+ * The number of diffusion steps; higher values can improve quality but take longer
6514
+ */
6515
+ num_steps?: number;
6516
+ /**
6517
+ * The number of diffusion steps; higher values can improve quality but take longer
6518
+ */
6519
+ steps?: number;
6520
+ }
6521
+ export interface Ai_Cf_Leonardo_Lucid_Origin_Output {
6522
+ /**
6523
+ * The generated image in Base64 format.
6524
+ */
6525
+ image?: string;
6526
+ }
6527
+ export declare abstract class Base_Ai_Cf_Leonardo_Lucid_Origin {
6528
+ inputs: Ai_Cf_Leonardo_Lucid_Origin_Input;
6529
+ postProcessedOutputs: Ai_Cf_Leonardo_Lucid_Origin_Output;
6530
+ }
6531
+ export interface Ai_Cf_Deepgram_Aura_1_Input {
6532
+ /**
6533
+ * Speaker used to produce the audio.
6534
+ */
6535
+ speaker?:
6536
+ | "angus"
6537
+ | "asteria"
6538
+ | "arcas"
6539
+ | "orion"
6540
+ | "orpheus"
6541
+ | "athena"
6542
+ | "luna"
6543
+ | "zeus"
6544
+ | "perseus"
6545
+ | "helios"
6546
+ | "hera"
6547
+ | "stella";
6548
+ /**
6549
+ * Encoding of the output audio.
6550
+ */
6551
+ encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac";
6552
+ /**
6553
+ * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..
6554
+ */
6555
+ container?: "none" | "wav" | "ogg";
6556
+ /**
6557
+ * The text content to be converted to speech
6558
+ */
6559
+ text: string;
6560
+ /**
6561
+ * 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
6562
+ */
6563
+ sample_rate?: number;
6564
+ /**
6565
+ * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.
6566
+ */
6567
+ bit_rate?: number;
6568
+ }
6569
+ /**
6570
+ * The generated audio in MP3 format
6571
+ */
6572
+ export type Ai_Cf_Deepgram_Aura_1_Output = string;
6573
+ export declare abstract class Base_Ai_Cf_Deepgram_Aura_1 {
6574
+ inputs: Ai_Cf_Deepgram_Aura_1_Input;
6575
+ postProcessedOutputs: Ai_Cf_Deepgram_Aura_1_Output;
6576
+ }
5869
6577
  export interface AiModels {
5870
6578
  "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
5871
6579
  "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
@@ -5874,8 +6582,8 @@ export interface AiModels {
5874
6582
  "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
5875
6583
  "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
5876
6584
  "@cf/myshell-ai/melotts": BaseAiTextToSpeech;
6585
+ "@cf/google/embeddinggemma-300m": BaseAiTextEmbeddings;
5877
6586
  "@cf/microsoft/resnet-50": BaseAiImageClassification;
5878
- "@cf/facebook/detr-resnet-50": BaseAiObjectDetection;
5879
6587
  "@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
5880
6588
  "@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
5881
6589
  "@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
@@ -5910,7 +6618,6 @@ export interface AiModels {
5910
6618
  "@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
5911
6619
  "@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
5912
6620
  "@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
5913
- "@cf/meta/llama-3.1-8b-instruct": BaseAiTextGeneration;
5914
6621
  "@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
5915
6622
  "@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
5916
6623
  "@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
@@ -5937,6 +6644,13 @@ export interface AiModels {
5937
6644
  "@cf/mistralai/mistral-small-3.1-24b-instruct": Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct;
5938
6645
  "@cf/google/gemma-3-12b-it": Base_Ai_Cf_Google_Gemma_3_12B_It;
5939
6646
  "@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;
6647
+ "@cf/deepgram/nova-3": Base_Ai_Cf_Deepgram_Nova_3;
6648
+ "@cf/pipecat-ai/smart-turn-v2": Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2;
6649
+ "@cf/openai/gpt-oss-120b": Base_Ai_Cf_Openai_Gpt_Oss_120B;
6650
+ "@cf/openai/gpt-oss-20b": Base_Ai_Cf_Openai_Gpt_Oss_20B;
6651
+ "@cf/leonardo/phoenix-1.0": Base_Ai_Cf_Leonardo_Phoenix_1_0;
6652
+ "@cf/leonardo/lucid-origin": Base_Ai_Cf_Leonardo_Lucid_Origin;
6653
+ "@cf/deepgram/aura-1": Base_Ai_Cf_Deepgram_Aura_1;
5940
6654
  }
5941
6655
  export type AiOptions = {
5942
6656
  /**
@@ -5944,6 +6658,10 @@ export type AiOptions = {
5944
6658
  * https://developers.cloudflare.com/workers-ai/features/batch-api
5945
6659
  */
5946
6660
  queueRequest?: boolean;
6661
+ /**
6662
+ * Establish websocket connections, only works for supported models
6663
+ */
6664
+ websocket?: boolean;
5947
6665
  gateway?: GatewayOptions;
5948
6666
  returnRawResponse?: boolean;
5949
6667
  prefix?: string;
@@ -5989,7 +6707,7 @@ export declare abstract class Ai<
5989
6707
  > {
5990
6708
  aiGatewayLogId: string | null;
5991
6709
  gateway(gatewayId: string): AiGateway;
5992
- autorag(autoragId?: string): AutoRAG;
6710
+ autorag(autoragId: string): AutoRAG;
5993
6711
  run<
5994
6712
  Name extends keyof AiModelList,
5995
6713
  Options extends AiOptions,
@@ -5999,9 +6717,13 @@ export declare abstract class Ai<
5999
6717
  inputs: InputOptions,
6000
6718
  options?: Options,
6001
6719
  ): Promise<
6002
- Options extends {
6003
- returnRawResponse: true;
6004
- }
6720
+ Options extends
6721
+ | {
6722
+ returnRawResponse: true;
6723
+ }
6724
+ | {
6725
+ websocket: true;
6726
+ }
6005
6727
  ? Response
6006
6728
  : InputOptions extends {
6007
6729
  stream: true;