@cloudflare/workers-types 4.20250917.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.
package/index.d.ts CHANGED
@@ -3164,6 +3164,18 @@ declare abstract class BaseAiImageTextToText {
3164
3164
  inputs: AiImageTextToTextInput;
3165
3165
  postProcessedOutputs: AiImageTextToTextOutput;
3166
3166
  }
3167
+ type AiMultimodalEmbeddingsInput = {
3168
+ image: string;
3169
+ text: string[];
3170
+ };
3171
+ type AiIMultimodalEmbeddingsOutput = {
3172
+ data: number[][];
3173
+ shape: number[];
3174
+ };
3175
+ declare abstract class BaseAiMultimodalEmbeddings {
3176
+ inputs: AiImageTextToTextInput;
3177
+ postProcessedOutputs: AiImageTextToTextOutput;
3178
+ }
3167
3179
  type AiObjectDetectionInput = {
3168
3180
  image: number[];
3169
3181
  };
@@ -3302,12 +3314,28 @@ type AiTextGenerationInput = {
3302
3314
  | (object & NonNullable<unknown>);
3303
3315
  functions?: AiTextGenerationFunctionsInput[];
3304
3316
  };
3317
+ type AiTextGenerationToolLegacyOutput = {
3318
+ name: string;
3319
+ arguments: unknown;
3320
+ };
3321
+ type AiTextGenerationToolOutput = {
3322
+ id: string;
3323
+ type: "function";
3324
+ function: {
3325
+ name: string;
3326
+ arguments: string;
3327
+ };
3328
+ };
3329
+ type UsageTags = {
3330
+ prompt_tokens: number;
3331
+ completion_tokens: number;
3332
+ total_tokens: number;
3333
+ };
3305
3334
  type AiTextGenerationOutput = {
3306
3335
  response?: string;
3307
- tool_calls?: {
3308
- name: string;
3309
- arguments: unknown;
3310
- }[];
3336
+ tool_calls?: AiTextGenerationToolLegacyOutput[] &
3337
+ AiTextGenerationToolOutput[];
3338
+ usage?: UsageTags;
3311
3339
  };
3312
3340
  declare abstract class BaseAiTextGeneration {
3313
3341
  inputs: AiTextGenerationInput;
@@ -4396,6 +4424,7 @@ type Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Output =
4396
4424
  name?: string;
4397
4425
  }[];
4398
4426
  }
4427
+ | string
4399
4428
  | AsyncResponse;
4400
4429
  declare abstract class Base_Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast {
4401
4430
  inputs: Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Input;
@@ -4472,7 +4501,6 @@ interface Ai_Cf_Baai_Bge_Reranker_Base_Input {
4472
4501
  /**
4473
4502
  * A query you wish to perform against the provided contexts.
4474
4503
  */
4475
- query: string;
4476
4504
  /**
4477
4505
  * Number of returned results starting with the best score.
4478
4506
  */
@@ -5565,7 +5593,8 @@ declare abstract class Base_Ai_Cf_Google_Gemma_3_12B_It {
5565
5593
  }
5566
5594
  type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input =
5567
5595
  | Ai_Cf_Meta_Llama_4_Prompt
5568
- | Ai_Cf_Meta_Llama_4_Messages;
5596
+ | Ai_Cf_Meta_Llama_4_Messages
5597
+ | Ai_Cf_Meta_Llama_4_Async_Batch;
5569
5598
  interface Ai_Cf_Meta_Llama_4_Prompt {
5570
5599
  /**
5571
5600
  * The input text prompt for the model to generate a response.
@@ -5799,6 +5828,245 @@ interface Ai_Cf_Meta_Llama_4_Messages {
5799
5828
  */
5800
5829
  presence_penalty?: number;
5801
5830
  }
5831
+ interface Ai_Cf_Meta_Llama_4_Async_Batch {
5832
+ requests: (
5833
+ | Ai_Cf_Meta_Llama_4_Prompt_Inner
5834
+ | Ai_Cf_Meta_Llama_4_Messages_Inner
5835
+ )[];
5836
+ }
5837
+ interface Ai_Cf_Meta_Llama_4_Prompt_Inner {
5838
+ /**
5839
+ * The input text prompt for the model to generate a response.
5840
+ */
5841
+ prompt: string;
5842
+ /**
5843
+ * JSON schema that should be fulfilled for the response.
5844
+ */
5845
+ guided_json?: object;
5846
+ response_format?: JSONMode;
5847
+ /**
5848
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
5849
+ */
5850
+ raw?: boolean;
5851
+ /**
5852
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
5853
+ */
5854
+ stream?: boolean;
5855
+ /**
5856
+ * The maximum number of tokens to generate in the response.
5857
+ */
5858
+ max_tokens?: number;
5859
+ /**
5860
+ * Controls the randomness of the output; higher values produce more random results.
5861
+ */
5862
+ temperature?: number;
5863
+ /**
5864
+ * 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.
5865
+ */
5866
+ top_p?: number;
5867
+ /**
5868
+ * 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.
5869
+ */
5870
+ top_k?: number;
5871
+ /**
5872
+ * Random seed for reproducibility of the generation.
5873
+ */
5874
+ seed?: number;
5875
+ /**
5876
+ * Penalty for repeated tokens; higher values discourage repetition.
5877
+ */
5878
+ repetition_penalty?: number;
5879
+ /**
5880
+ * Decreases the likelihood of the model repeating the same lines verbatim.
5881
+ */
5882
+ frequency_penalty?: number;
5883
+ /**
5884
+ * Increases the likelihood of the model introducing new topics.
5885
+ */
5886
+ presence_penalty?: number;
5887
+ }
5888
+ interface Ai_Cf_Meta_Llama_4_Messages_Inner {
5889
+ /**
5890
+ * An array of message objects representing the conversation history.
5891
+ */
5892
+ messages: {
5893
+ /**
5894
+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
5895
+ */
5896
+ role?: string;
5897
+ /**
5898
+ * The tool call id. If you don't know what to put here you can fall back to 000000001
5899
+ */
5900
+ tool_call_id?: string;
5901
+ content?:
5902
+ | string
5903
+ | {
5904
+ /**
5905
+ * Type of the content provided
5906
+ */
5907
+ type?: string;
5908
+ text?: string;
5909
+ image_url?: {
5910
+ /**
5911
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
5912
+ */
5913
+ url?: string;
5914
+ };
5915
+ }[]
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
+ functions?: {
5931
+ name: string;
5932
+ code: string;
5933
+ }[];
5934
+ /**
5935
+ * A list of tools available for the assistant to use.
5936
+ */
5937
+ tools?: (
5938
+ | {
5939
+ /**
5940
+ * The name of the tool. More descriptive the better.
5941
+ */
5942
+ name: string;
5943
+ /**
5944
+ * A brief description of what the tool does.
5945
+ */
5946
+ description: string;
5947
+ /**
5948
+ * Schema defining the parameters accepted by the tool.
5949
+ */
5950
+ parameters: {
5951
+ /**
5952
+ * The type of the parameters object (usually 'object').
5953
+ */
5954
+ type: string;
5955
+ /**
5956
+ * List of required parameter names.
5957
+ */
5958
+ required?: string[];
5959
+ /**
5960
+ * Definitions of each parameter.
5961
+ */
5962
+ properties: {
5963
+ [k: string]: {
5964
+ /**
5965
+ * The data type of the parameter.
5966
+ */
5967
+ type: string;
5968
+ /**
5969
+ * A description of the expected parameter.
5970
+ */
5971
+ description: string;
5972
+ };
5973
+ };
5974
+ };
5975
+ }
5976
+ | {
5977
+ /**
5978
+ * Specifies the type of tool (e.g., 'function').
5979
+ */
5980
+ type: string;
5981
+ /**
5982
+ * Details of the function tool.
5983
+ */
5984
+ function: {
5985
+ /**
5986
+ * The name of the function.
5987
+ */
5988
+ name: string;
5989
+ /**
5990
+ * A brief description of what the function does.
5991
+ */
5992
+ description: string;
5993
+ /**
5994
+ * Schema defining the parameters accepted by the function.
5995
+ */
5996
+ parameters: {
5997
+ /**
5998
+ * The type of the parameters object (usually 'object').
5999
+ */
6000
+ type: string;
6001
+ /**
6002
+ * List of required parameter names.
6003
+ */
6004
+ required?: string[];
6005
+ /**
6006
+ * Definitions of each parameter.
6007
+ */
6008
+ properties: {
6009
+ [k: string]: {
6010
+ /**
6011
+ * The data type of the parameter.
6012
+ */
6013
+ type: string;
6014
+ /**
6015
+ * A description of the expected parameter.
6016
+ */
6017
+ description: string;
6018
+ };
6019
+ };
6020
+ };
6021
+ };
6022
+ }
6023
+ )[];
6024
+ response_format?: JSONMode;
6025
+ /**
6026
+ * JSON schema that should be fufilled for the response.
6027
+ */
6028
+ guided_json?: object;
6029
+ /**
6030
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
6031
+ */
6032
+ raw?: boolean;
6033
+ /**
6034
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
6035
+ */
6036
+ stream?: boolean;
6037
+ /**
6038
+ * The maximum number of tokens to generate in the response.
6039
+ */
6040
+ max_tokens?: number;
6041
+ /**
6042
+ * Controls the randomness of the output; higher values produce more random results.
6043
+ */
6044
+ temperature?: number;
6045
+ /**
6046
+ * 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.
6047
+ */
6048
+ top_p?: number;
6049
+ /**
6050
+ * 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.
6051
+ */
6052
+ top_k?: number;
6053
+ /**
6054
+ * Random seed for reproducibility of the generation.
6055
+ */
6056
+ seed?: number;
6057
+ /**
6058
+ * Penalty for repeated tokens; higher values discourage repetition.
6059
+ */
6060
+ repetition_penalty?: number;
6061
+ /**
6062
+ * Decreases the likelihood of the model repeating the same lines verbatim.
6063
+ */
6064
+ frequency_penalty?: number;
6065
+ /**
6066
+ * Increases the likelihood of the model introducing new topics.
6067
+ */
6068
+ presence_penalty?: number;
6069
+ }
5802
6070
  type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output = {
5803
6071
  /**
5804
6072
  * The generated text response from the model
@@ -5852,6 +6120,443 @@ declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {
5852
6120
  inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;
5853
6121
  postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;
5854
6122
  }
6123
+ interface Ai_Cf_Deepgram_Nova_3_Input {
6124
+ audio: {
6125
+ body: object;
6126
+ contentType: string;
6127
+ };
6128
+ /**
6129
+ * 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.
6130
+ */
6131
+ custom_topic_mode?: "extended" | "strict";
6132
+ /**
6133
+ * Custom topics you want the model to detect within your input audio or text if present Submit up to 100
6134
+ */
6135
+ custom_topic?: string;
6136
+ /**
6137
+ * 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
6138
+ */
6139
+ custom_intent_mode?: "extended" | "strict";
6140
+ /**
6141
+ * Custom intents you want the model to detect within your input audio if present
6142
+ */
6143
+ custom_intent?: string;
6144
+ /**
6145
+ * Identifies and extracts key entities from content in submitted audio
6146
+ */
6147
+ detect_entities?: boolean;
6148
+ /**
6149
+ * Identifies the dominant language spoken in submitted audio
6150
+ */
6151
+ detect_language?: boolean;
6152
+ /**
6153
+ * Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0
6154
+ */
6155
+ diarize?: boolean;
6156
+ /**
6157
+ * Identify and extract key entities from content in submitted audio
6158
+ */
6159
+ dictation?: boolean;
6160
+ /**
6161
+ * Specify the expected encoding of your submitted audio
6162
+ */
6163
+ encoding?:
6164
+ | "linear16"
6165
+ | "flac"
6166
+ | "mulaw"
6167
+ | "amr-nb"
6168
+ | "amr-wb"
6169
+ | "opus"
6170
+ | "speex"
6171
+ | "g729";
6172
+ /**
6173
+ * Arbitrary key-value pairs that are attached to the API response for usage in downstream processing
6174
+ */
6175
+ extra?: string;
6176
+ /**
6177
+ * Filler Words can help transcribe interruptions in your audio, like 'uh' and 'um'
6178
+ */
6179
+ filler_words?: boolean;
6180
+ /**
6181
+ * Key term prompting can boost or suppress specialized terminology and brands.
6182
+ */
6183
+ keyterm?: string;
6184
+ /**
6185
+ * Keywords can boost or suppress specialized terminology and brands.
6186
+ */
6187
+ keywords?: string;
6188
+ /**
6189
+ * 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.
6190
+ */
6191
+ language?: string;
6192
+ /**
6193
+ * Spoken measurements will be converted to their corresponding abbreviations.
6194
+ */
6195
+ measurements?: boolean;
6196
+ /**
6197
+ * 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.
6198
+ */
6199
+ mip_opt_out?: boolean;
6200
+ /**
6201
+ * Mode of operation for the model representing broad area of topic that will be talked about in the supplied audio
6202
+ */
6203
+ mode?: "general" | "medical" | "finance";
6204
+ /**
6205
+ * Transcribe each audio channel independently.
6206
+ */
6207
+ multichannel?: boolean;
6208
+ /**
6209
+ * Numerals converts numbers from written format to numerical format.
6210
+ */
6211
+ numerals?: boolean;
6212
+ /**
6213
+ * Splits audio into paragraphs to improve transcript readability.
6214
+ */
6215
+ paragraphs?: boolean;
6216
+ /**
6217
+ * Profanity Filter looks for recognized profanity and converts it to the nearest recognized non-profane word or removes it from the transcript completely.
6218
+ */
6219
+ profanity_filter?: boolean;
6220
+ /**
6221
+ * Add punctuation and capitalization to the transcript.
6222
+ */
6223
+ punctuate?: boolean;
6224
+ /**
6225
+ * Redaction removes sensitive information from your transcripts.
6226
+ */
6227
+ redact?: string;
6228
+ /**
6229
+ * Search for terms or phrases in submitted audio and replaces them.
6230
+ */
6231
+ replace?: string;
6232
+ /**
6233
+ * Search for terms or phrases in submitted audio.
6234
+ */
6235
+ search?: string;
6236
+ /**
6237
+ * Recognizes the sentiment throughout a transcript or text.
6238
+ */
6239
+ sentiment?: boolean;
6240
+ /**
6241
+ * Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability.
6242
+ */
6243
+ smart_format?: boolean;
6244
+ /**
6245
+ * Detect topics throughout a transcript or text.
6246
+ */
6247
+ topics?: boolean;
6248
+ /**
6249
+ * Segments speech into meaningful semantic units.
6250
+ */
6251
+ utterances?: boolean;
6252
+ /**
6253
+ * Seconds to wait before detecting a pause between words in submitted audio.
6254
+ */
6255
+ utt_split?: number;
6256
+ /**
6257
+ * The number of channels in the submitted audio
6258
+ */
6259
+ channels?: number;
6260
+ /**
6261
+ * 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.
6262
+ */
6263
+ interim_results?: boolean;
6264
+ /**
6265
+ * 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
6266
+ */
6267
+ endpointing?: string;
6268
+ /**
6269
+ * Indicates that speech has started. You'll begin receiving Speech Started messages upon speech starting. Note: Supported only for webosockets.
6270
+ */
6271
+ vad_events?: boolean;
6272
+ /**
6273
+ * 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.
6274
+ */
6275
+ utterance_end_ms?: boolean;
6276
+ }
6277
+ interface Ai_Cf_Deepgram_Nova_3_Output {
6278
+ results?: {
6279
+ channels?: {
6280
+ alternatives?: {
6281
+ confidence?: number;
6282
+ transcript?: string;
6283
+ words?: {
6284
+ confidence?: number;
6285
+ end?: number;
6286
+ start?: number;
6287
+ word?: string;
6288
+ }[];
6289
+ }[];
6290
+ }[];
6291
+ summary?: {
6292
+ result?: string;
6293
+ short?: string;
6294
+ };
6295
+ sentiments?: {
6296
+ segments?: {
6297
+ text?: string;
6298
+ start_word?: number;
6299
+ end_word?: number;
6300
+ sentiment?: string;
6301
+ sentiment_score?: number;
6302
+ }[];
6303
+ average?: {
6304
+ sentiment?: string;
6305
+ sentiment_score?: number;
6306
+ };
6307
+ };
6308
+ };
6309
+ }
6310
+ declare abstract class Base_Ai_Cf_Deepgram_Nova_3 {
6311
+ inputs: Ai_Cf_Deepgram_Nova_3_Input;
6312
+ postProcessedOutputs: Ai_Cf_Deepgram_Nova_3_Output;
6313
+ }
6314
+ type Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input =
6315
+ | {
6316
+ /**
6317
+ * readable stream with audio data and content-type specified for that data
6318
+ */
6319
+ audio: {
6320
+ body: object;
6321
+ contentType: string;
6322
+ };
6323
+ /**
6324
+ * type of data PCM data that's sent to the inference server as raw array
6325
+ */
6326
+ dtype?: "uint8" | "float32" | "float64";
6327
+ }
6328
+ | {
6329
+ /**
6330
+ * base64 encoded audio data
6331
+ */
6332
+ audio: string;
6333
+ /**
6334
+ * type of data PCM data that's sent to the inference server as raw array
6335
+ */
6336
+ dtype?: "uint8" | "float32" | "float64";
6337
+ };
6338
+ interface Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output {
6339
+ /**
6340
+ * if true, end-of-turn was detected
6341
+ */
6342
+ is_complete?: boolean;
6343
+ /**
6344
+ * probability of the end-of-turn detection
6345
+ */
6346
+ probability?: number;
6347
+ }
6348
+ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
6349
+ inputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Input;
6350
+ postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
6351
+ }
6352
+ type Ai_Cf_Openai_Gpt_Oss_120B_Input =
6353
+ | GPT_OSS_120B_Responses
6354
+ | GPT_OSS_120B_Responses_Async;
6355
+ interface GPT_OSS_120B_Responses {
6356
+ /**
6357
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6358
+ */
6359
+ input: string | unknown[];
6360
+ reasoning?: {
6361
+ /**
6362
+ * 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.
6363
+ */
6364
+ effort?: "low" | "medium" | "high";
6365
+ /**
6366
+ * 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.
6367
+ */
6368
+ summary?: "auto" | "concise" | "detailed";
6369
+ };
6370
+ }
6371
+ interface GPT_OSS_120B_Responses_Async {
6372
+ requests: {
6373
+ /**
6374
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6375
+ */
6376
+ input: string | unknown[];
6377
+ reasoning?: {
6378
+ /**
6379
+ * 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.
6380
+ */
6381
+ effort?: "low" | "medium" | "high";
6382
+ /**
6383
+ * 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.
6384
+ */
6385
+ summary?: "auto" | "concise" | "detailed";
6386
+ };
6387
+ }[];
6388
+ }
6389
+ type Ai_Cf_Openai_Gpt_Oss_120B_Output = {} | (string & NonNullable<unknown>);
6390
+ declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
6391
+ inputs: Ai_Cf_Openai_Gpt_Oss_120B_Input;
6392
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_120B_Output;
6393
+ }
6394
+ type Ai_Cf_Openai_Gpt_Oss_20B_Input =
6395
+ | GPT_OSS_20B_Responses
6396
+ | GPT_OSS_20B_Responses_Async;
6397
+ interface GPT_OSS_20B_Responses {
6398
+ /**
6399
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6400
+ */
6401
+ input: string | unknown[];
6402
+ reasoning?: {
6403
+ /**
6404
+ * 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.
6405
+ */
6406
+ effort?: "low" | "medium" | "high";
6407
+ /**
6408
+ * 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.
6409
+ */
6410
+ summary?: "auto" | "concise" | "detailed";
6411
+ };
6412
+ }
6413
+ interface GPT_OSS_20B_Responses_Async {
6414
+ requests: {
6415
+ /**
6416
+ * Responses API Input messages. Refer to OpenAI Responses API docs to learn more about supported content types
6417
+ */
6418
+ input: string | unknown[];
6419
+ reasoning?: {
6420
+ /**
6421
+ * 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.
6422
+ */
6423
+ effort?: "low" | "medium" | "high";
6424
+ /**
6425
+ * 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.
6426
+ */
6427
+ summary?: "auto" | "concise" | "detailed";
6428
+ };
6429
+ }[];
6430
+ }
6431
+ type Ai_Cf_Openai_Gpt_Oss_20B_Output = {} | (string & NonNullable<unknown>);
6432
+ declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
6433
+ inputs: Ai_Cf_Openai_Gpt_Oss_20B_Input;
6434
+ postProcessedOutputs: Ai_Cf_Openai_Gpt_Oss_20B_Output;
6435
+ }
6436
+ interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
6437
+ /**
6438
+ * A text description of the image you want to generate.
6439
+ */
6440
+ prompt: string;
6441
+ /**
6442
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6443
+ */
6444
+ guidance?: number;
6445
+ /**
6446
+ * Random seed for reproducibility of the image generation
6447
+ */
6448
+ seed?: number;
6449
+ /**
6450
+ * The height of the generated image in pixels
6451
+ */
6452
+ height?: number;
6453
+ /**
6454
+ * The width of the generated image in pixels
6455
+ */
6456
+ width?: number;
6457
+ /**
6458
+ * The number of diffusion steps; higher values can improve quality but take longer
6459
+ */
6460
+ num_steps?: number;
6461
+ /**
6462
+ * Specify what to exclude from the generated images
6463
+ */
6464
+ negative_prompt?: string;
6465
+ }
6466
+ /**
6467
+ * The generated image in JPEG format
6468
+ */
6469
+ type Ai_Cf_Leonardo_Phoenix_1_0_Output = string;
6470
+ declare abstract class Base_Ai_Cf_Leonardo_Phoenix_1_0 {
6471
+ inputs: Ai_Cf_Leonardo_Phoenix_1_0_Input;
6472
+ postProcessedOutputs: Ai_Cf_Leonardo_Phoenix_1_0_Output;
6473
+ }
6474
+ interface Ai_Cf_Leonardo_Lucid_Origin_Input {
6475
+ /**
6476
+ * A text description of the image you want to generate.
6477
+ */
6478
+ prompt: string;
6479
+ /**
6480
+ * Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt
6481
+ */
6482
+ guidance?: number;
6483
+ /**
6484
+ * Random seed for reproducibility of the image generation
6485
+ */
6486
+ seed?: number;
6487
+ /**
6488
+ * The height of the generated image in pixels
6489
+ */
6490
+ height?: number;
6491
+ /**
6492
+ * The width of the generated image in pixels
6493
+ */
6494
+ width?: number;
6495
+ /**
6496
+ * The number of diffusion steps; higher values can improve quality but take longer
6497
+ */
6498
+ num_steps?: number;
6499
+ /**
6500
+ * The number of diffusion steps; higher values can improve quality but take longer
6501
+ */
6502
+ steps?: number;
6503
+ }
6504
+ interface Ai_Cf_Leonardo_Lucid_Origin_Output {
6505
+ /**
6506
+ * The generated image in Base64 format.
6507
+ */
6508
+ image?: string;
6509
+ }
6510
+ declare abstract class Base_Ai_Cf_Leonardo_Lucid_Origin {
6511
+ inputs: Ai_Cf_Leonardo_Lucid_Origin_Input;
6512
+ postProcessedOutputs: Ai_Cf_Leonardo_Lucid_Origin_Output;
6513
+ }
6514
+ interface Ai_Cf_Deepgram_Aura_1_Input {
6515
+ /**
6516
+ * Speaker used to produce the audio.
6517
+ */
6518
+ speaker?:
6519
+ | "angus"
6520
+ | "asteria"
6521
+ | "arcas"
6522
+ | "orion"
6523
+ | "orpheus"
6524
+ | "athena"
6525
+ | "luna"
6526
+ | "zeus"
6527
+ | "perseus"
6528
+ | "helios"
6529
+ | "hera"
6530
+ | "stella";
6531
+ /**
6532
+ * Encoding of the output audio.
6533
+ */
6534
+ encoding?: "linear16" | "flac" | "mulaw" | "alaw" | "mp3" | "opus" | "aac";
6535
+ /**
6536
+ * Container specifies the file format wrapper for the output audio. The available options depend on the encoding type..
6537
+ */
6538
+ container?: "none" | "wav" | "ogg";
6539
+ /**
6540
+ * The text content to be converted to speech
6541
+ */
6542
+ text: string;
6543
+ /**
6544
+ * 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
6545
+ */
6546
+ sample_rate?: number;
6547
+ /**
6548
+ * The bitrate of the audio in bits per second. Choose from predefined ranges or specific values based on the encoding type.
6549
+ */
6550
+ bit_rate?: number;
6551
+ }
6552
+ /**
6553
+ * The generated audio in MP3 format
6554
+ */
6555
+ type Ai_Cf_Deepgram_Aura_1_Output = string;
6556
+ declare abstract class Base_Ai_Cf_Deepgram_Aura_1 {
6557
+ inputs: Ai_Cf_Deepgram_Aura_1_Input;
6558
+ postProcessedOutputs: Ai_Cf_Deepgram_Aura_1_Output;
6559
+ }
5855
6560
  interface AiModels {
5856
6561
  "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
5857
6562
  "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
@@ -5860,8 +6565,8 @@ interface AiModels {
5860
6565
  "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
5861
6566
  "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
5862
6567
  "@cf/myshell-ai/melotts": BaseAiTextToSpeech;
6568
+ "@cf/google/embeddinggemma-300m": BaseAiTextEmbeddings;
5863
6569
  "@cf/microsoft/resnet-50": BaseAiImageClassification;
5864
- "@cf/facebook/detr-resnet-50": BaseAiObjectDetection;
5865
6570
  "@cf/meta/llama-2-7b-chat-int8": BaseAiTextGeneration;
5866
6571
  "@cf/mistral/mistral-7b-instruct-v0.1": BaseAiTextGeneration;
5867
6572
  "@cf/meta/llama-2-7b-chat-fp16": BaseAiTextGeneration;
@@ -5896,7 +6601,6 @@ interface AiModels {
5896
6601
  "@cf/fblgit/una-cybertron-7b-v2-bf16": BaseAiTextGeneration;
5897
6602
  "@cf/meta/llama-3-8b-instruct-awq": BaseAiTextGeneration;
5898
6603
  "@hf/meta-llama/meta-llama-3-8b-instruct": BaseAiTextGeneration;
5899
- "@cf/meta/llama-3.1-8b-instruct": BaseAiTextGeneration;
5900
6604
  "@cf/meta/llama-3.1-8b-instruct-fp8": BaseAiTextGeneration;
5901
6605
  "@cf/meta/llama-3.1-8b-instruct-awq": BaseAiTextGeneration;
5902
6606
  "@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
@@ -5923,6 +6627,13 @@ interface AiModels {
5923
6627
  "@cf/mistralai/mistral-small-3.1-24b-instruct": Base_Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct;
5924
6628
  "@cf/google/gemma-3-12b-it": Base_Ai_Cf_Google_Gemma_3_12B_It;
5925
6629
  "@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;
6630
+ "@cf/deepgram/nova-3": Base_Ai_Cf_Deepgram_Nova_3;
6631
+ "@cf/pipecat-ai/smart-turn-v2": Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2;
6632
+ "@cf/openai/gpt-oss-120b": Base_Ai_Cf_Openai_Gpt_Oss_120B;
6633
+ "@cf/openai/gpt-oss-20b": Base_Ai_Cf_Openai_Gpt_Oss_20B;
6634
+ "@cf/leonardo/phoenix-1.0": Base_Ai_Cf_Leonardo_Phoenix_1_0;
6635
+ "@cf/leonardo/lucid-origin": Base_Ai_Cf_Leonardo_Lucid_Origin;
6636
+ "@cf/deepgram/aura-1": Base_Ai_Cf_Deepgram_Aura_1;
5926
6637
  }
5927
6638
  type AiOptions = {
5928
6639
  /**
@@ -5930,6 +6641,10 @@ type AiOptions = {
5930
6641
  * https://developers.cloudflare.com/workers-ai/features/batch-api
5931
6642
  */
5932
6643
  queueRequest?: boolean;
6644
+ /**
6645
+ * Establish websocket connections, only works for supported models
6646
+ */
6647
+ websocket?: boolean;
5933
6648
  gateway?: GatewayOptions;
5934
6649
  returnRawResponse?: boolean;
5935
6650
  prefix?: string;
@@ -5973,7 +6688,7 @@ type AiModelListType = Record<string, any>;
5973
6688
  declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
5974
6689
  aiGatewayLogId: string | null;
5975
6690
  gateway(gatewayId: string): AiGateway;
5976
- autorag(autoragId?: string): AutoRAG;
6691
+ autorag(autoragId: string): AutoRAG;
5977
6692
  run<
5978
6693
  Name extends keyof AiModelList,
5979
6694
  Options extends AiOptions,
@@ -5983,9 +6698,13 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
5983
6698
  inputs: InputOptions,
5984
6699
  options?: Options,
5985
6700
  ): Promise<
5986
- Options extends {
5987
- returnRawResponse: true;
5988
- }
6701
+ Options extends
6702
+ | {
6703
+ returnRawResponse: true;
6704
+ }
6705
+ | {
6706
+ websocket: true;
6707
+ }
5989
6708
  ? Response
5990
6709
  : InputOptions extends {
5991
6710
  stream: true;