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