@cloudflare/workers-types 4.20240614.0 → 4.20240701.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.
@@ -249,6 +249,7 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
249
249
  ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
250
250
  CountQueuingStrategy: typeof CountQueuingStrategy;
251
251
  ErrorEvent: typeof ErrorEvent;
252
+ EventSource: typeof EventSource;
252
253
  ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;
253
254
  ReadableStreamDefaultController: typeof ReadableStreamDefaultController;
254
255
  ReadableByteStreamController: typeof ReadableByteStreamController;
@@ -3110,6 +3111,53 @@ declare interface gpuGPUOrigin3DDict {
3110
3111
  y?: number;
3111
3112
  z?: number;
3112
3113
  }
3114
+ declare class EventSource {
3115
+ constructor(url: string, init?: EventSourceEventSourceInit);
3116
+ /**
3117
+ * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
3118
+ *
3119
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
3120
+ */
3121
+ close(): void;
3122
+ /**
3123
+ * Returns the URL providing the event stream.
3124
+ *
3125
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3126
+ */
3127
+ get url(): string;
3128
+ /**
3129
+ * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3130
+ *
3131
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3132
+ */
3133
+ get withCredentials(): boolean;
3134
+ /**
3135
+ * Returns the state of this EventSource object's connection. It can have the values described below.
3136
+ *
3137
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3138
+ */
3139
+ get readyState(): number;
3140
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3141
+ get onopen(): any | null;
3142
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3143
+ set onopen(value: any | null);
3144
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3145
+ get onmessage(): any | null;
3146
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3147
+ set onmessage(value: any | null);
3148
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3149
+ get onerror(): any | null;
3150
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3151
+ set onerror(value: any | null);
3152
+ static readonly CONNECTING: number;
3153
+ static readonly OPEN: number;
3154
+ static readonly CLOSED: number;
3155
+ static from(stream: ReadableStream): EventSource;
3156
+ }
3157
+ declare interface EventSourceEventSourceInit {
3158
+ withCredentials?: boolean;
3159
+ fetcher?: Fetcher;
3160
+ }
3113
3161
  declare type AiImageClassificationInput = {
3114
3162
  image: number[];
3115
3163
  };
@@ -3126,6 +3174,12 @@ declare type AiImageToTextInput = {
3126
3174
  prompt?: string;
3127
3175
  max_tokens?: number;
3128
3176
  temperature?: number;
3177
+ top_p?: number;
3178
+ top_k?: number;
3179
+ seed?: number;
3180
+ repetition_penalty?: number;
3181
+ frequency_penalty?: number;
3182
+ presence_penalty?: number;
3129
3183
  raw?: boolean;
3130
3184
  messages?: RoleScopedChatInput[];
3131
3185
  };
@@ -3206,19 +3260,48 @@ declare abstract class BaseAiTextEmbeddings {
3206
3260
  postProcessedOutputs: AiTextEmbeddingsOutput;
3207
3261
  }
3208
3262
  declare type RoleScopedChatInput = {
3209
- role: string;
3263
+ role: "user" | "assistant" | "system" | "tool";
3210
3264
  content: string;
3211
3265
  };
3266
+ declare type AiTextGenerationToolInput = {
3267
+ type: "function";
3268
+ function: {
3269
+ name: string;
3270
+ description: string;
3271
+ parameters?: {
3272
+ type: "object";
3273
+ properties: {
3274
+ [key: string]: {
3275
+ type: string;
3276
+ description?: string;
3277
+ };
3278
+ };
3279
+ required: string[];
3280
+ };
3281
+ };
3282
+ };
3212
3283
  declare type AiTextGenerationInput = {
3213
3284
  prompt?: string;
3214
3285
  raw?: boolean;
3215
3286
  stream?: boolean;
3216
3287
  max_tokens?: number;
3288
+ temperature?: number;
3289
+ top_p?: number;
3290
+ top_k?: number;
3291
+ seed?: number;
3292
+ repetition_penalty?: number;
3293
+ frequency_penalty?: number;
3294
+ presence_penalty?: number;
3217
3295
  messages?: RoleScopedChatInput[];
3296
+ tools?: AiTextGenerationToolInput[];
3218
3297
  };
3219
3298
  declare type AiTextGenerationOutput =
3220
3299
  | {
3221
3300
  response?: string;
3301
+ tool_calls?: {
3302
+ name: string;
3303
+ arguments: unknown;
3304
+ }[];
3222
3305
  }
3223
3306
  | ReadableStream;
3224
3307
  declare abstract class BaseAiTextGeneration {
@@ -3261,108 +3344,113 @@ declare type AiOptions = {
3261
3344
  prefix?: string;
3262
3345
  extraHeaders?: object;
3263
3346
  };
3347
+ declare type BaseAiTextClassificationModels =
3348
+ "@cf/huggingface/distilbert-sst-2-int8";
3349
+ declare type BaseAiTextToImageModels =
3350
+ | "@cf/stabilityai/stable-diffusion-xl-base-1.0"
3351
+ | "@cf/runwayml/stable-diffusion-v1-5-inpainting"
3352
+ | "@cf/runwayml/stable-diffusion-v1-5-img2img"
3353
+ | "@cf/lykon/dreamshaper-8-lcm"
3354
+ | "@cf/bytedance/stable-diffusion-xl-lightning";
3355
+ declare type BaseAiTextEmbeddingsModels =
3356
+ | "@cf/baai/bge-small-en-v1.5"
3357
+ | "@cf/baai/bge-base-en-v1.5"
3358
+ | "@cf/baai/bge-large-en-v1.5";
3359
+ declare type BaseAiSpeechRecognitionModels =
3360
+ | "@cf/openai/whisper"
3361
+ | "@cf/openai/whisper-tiny-en"
3362
+ | "@cf/openai/whisper-sherpa";
3363
+ declare type BaseAiImageClassificationModels = "@cf/microsoft/resnet-50";
3364
+ declare type BaseAiObjectDetectionModels = "@cf/facebook/detr-resnet-50";
3365
+ declare type BaseAiTextGenerationModels =
3366
+ | "@cf/meta/llama-3-8b-instruct"
3367
+ | "@cf/meta/llama-3-8b-instruct-awq"
3368
+ | "@cf/meta/llama-2-7b-chat-int8"
3369
+ | "@cf/mistral/mistral-7b-instruct-v0.1"
3370
+ | "@cf/mistral/mistral-7b-instruct-v0.2-lora"
3371
+ | "@cf/meta/llama-2-7b-chat-fp16"
3372
+ | "@hf/thebloke/llama-2-13b-chat-awq"
3373
+ | "@hf/thebloke/zephyr-7b-beta-awq"
3374
+ | "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
3375
+ | "@hf/thebloke/codellama-7b-instruct-awq"
3376
+ | "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
3377
+ | "@hf/thebloke/neural-chat-7b-v3-1-awq"
3378
+ | "@hf/thebloke/llamaguard-7b-awq"
3379
+ | "@hf/thebloke/deepseek-coder-6.7b-base-awq"
3380
+ | "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
3381
+ | "@hf/nousresearch/hermes-2-pro-mistral-7b"
3382
+ | "@hf/mistral/mistral-7b-instruct-v0.2"
3383
+ | "@hf/google/gemma-7b-it"
3384
+ | "@hf/nexusflow/starling-lm-7b-beta"
3385
+ | "@cf/deepseek-ai/deepseek-math-7b-instruct"
3386
+ | "@cf/defog/sqlcoder-7b-2"
3387
+ | "@cf/openchat/openchat-3.5-0106"
3388
+ | "@cf/tiiuae/falcon-7b-instruct"
3389
+ | "@cf/thebloke/discolm-german-7b-v1-awq"
3390
+ | "@cf/qwen/qwen1.5-0.5b-chat"
3391
+ | "@cf/qwen/qwen1.5-1.8b-chat"
3392
+ | "@cf/qwen/qwen1.5-7b-chat-awq"
3393
+ | "@cf/qwen/qwen1.5-14b-chat-awq"
3394
+ | "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
3395
+ | "@cf/microsoft/phi-2"
3396
+ | "@cf/google/gemma-2b-it-lora"
3397
+ | "@cf/google/gemma-7b-it-lora"
3398
+ | "@cf/meta-llama/llama-2-7b-chat-hf-lora"
3399
+ | "@cf/fblgit/una-cybertron-7b-v2-bf16"
3400
+ | "@cf/fblgit/una-cybertron-7b-v2-awq";
3401
+ declare type BaseAiTranslationModels = "@cf/meta/m2m100-1.2b";
3402
+ declare type BaseAiSummarizationModels = "@cf/facebook/bart-large-cnn";
3403
+ declare type BaseAiImageToTextModels =
3404
+ | "@cf/unum/uform-gen2-qwen-500m"
3405
+ | "@cf/llava-hf/llava-1.5-7b-hf";
3264
3406
  declare abstract class Ai {
3265
3407
  run(
3266
- model:
3267
- | "@cf/huggingface/distilbert-sst-2-int8"
3268
- | "@cf/jpmorganchase/roberta-spam"
3269
- | "@cf/inml/inml-roberta-dga",
3408
+ model: BaseAiTextClassificationModels,
3270
3409
  inputs: BaseAiTextClassification["inputs"],
3271
3410
  options?: AiOptions,
3272
3411
  ): Promise<BaseAiTextClassification["postProcessedOutputs"]>;
3273
3412
  run(
3274
- model:
3275
- | "@cf/stabilityai/stable-diffusion-xl-base-1.0"
3276
- | "@cf/runwayml/stable-diffusion-v1-5-inpainting"
3277
- | "@cf/runwayml/stable-diffusion-v1-5-img2img"
3278
- | "@cf/lykon/dreamshaper-8-lcm"
3279
- | "@cf/bytedance/stable-diffusion-xl-lightning",
3413
+ model: BaseAiTextToImageModels,
3280
3414
  inputs: BaseAiTextToImage["inputs"],
3281
3415
  options?: AiOptions,
3282
3416
  ): Promise<BaseAiTextToImage["postProcessedOutputs"]>;
3283
3417
  run(
3284
- model: "@hf/sentence-transformers/all-minilm-l6-v2",
3285
- inputs: BaseAiSentenceSimilarity["inputs"],
3286
- options?: AiOptions,
3287
- ): Promise<BaseAiSentenceSimilarity["postProcessedOutputs"]>;
3288
- run(
3289
- model:
3290
- | "@cf/baai/bge-small-en-v1.5"
3291
- | "@cf/baai/bge-base-en-v1.5"
3292
- | "@cf/baai/bge-large-en-v1.5",
3418
+ model: BaseAiTextEmbeddingsModels,
3293
3419
  inputs: BaseAiTextEmbeddings["inputs"],
3294
3420
  options?: AiOptions,
3295
3421
  ): Promise<BaseAiTextEmbeddings["postProcessedOutputs"]>;
3296
3422
  run(
3297
- model:
3298
- | "@cf/openai/whisper"
3299
- | "@cf/openai/whisper-tiny-en"
3300
- | "@cf/openai/whisper-sherpa",
3423
+ model: BaseAiSpeechRecognitionModels,
3301
3424
  inputs: BaseAiSpeechRecognition["inputs"],
3302
3425
  options?: AiOptions,
3303
3426
  ): Promise<BaseAiSpeechRecognition["postProcessedOutputs"]>;
3304
3427
  run(
3305
- model: "@cf/microsoft/resnet-50",
3428
+ model: BaseAiImageClassificationModels,
3306
3429
  inputs: BaseAiImageClassification["inputs"],
3307
3430
  options?: AiOptions,
3308
3431
  ): Promise<BaseAiImageClassification["postProcessedOutputs"]>;
3309
3432
  run(
3310
- model: "@cf/facebook/detr-resnet-50",
3433
+ model: BaseAiObjectDetectionModels,
3311
3434
  inputs: BaseAiObjectDetection["inputs"],
3312
3435
  options?: AiOptions,
3313
3436
  ): Promise<BaseAiObjectDetection["postProcessedOutputs"]>;
3314
3437
  run(
3315
- model:
3316
- | "@cf/meta/llama-3-8b-instruct"
3317
- | "@cf/meta/llama-2-7b-chat-int8"
3318
- | "@cf/mistral/mistral-7b-instruct-v0.1"
3319
- | "@cf/mistral/mistral-7b-instruct-v0.1-vllm"
3320
- | "@cf/mistral/mistral-7b-instruct-v0.2-lora"
3321
- | "@cf/meta/llama-2-7b-chat-fp16"
3322
- | "@hf/thebloke/llama-2-13b-chat-awq"
3323
- | "@hf/thebloke/zephyr-7b-beta-awq"
3324
- | "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
3325
- | "@hf/thebloke/codellama-7b-instruct-awq"
3326
- | "@hf/thebloke/openchat_3.5-awq"
3327
- | "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
3328
- | "@hf/thebloke/neural-chat-7b-v3-1-awq"
3329
- | "@hf/thebloke/llamaguard-7b-awq"
3330
- | "@hf/thebloke/deepseek-coder-6.7b-base-awq"
3331
- | "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
3332
- | "@hf/nousresearch/hermes-2-pro-mistral-7b"
3333
- | "@hf/mistral/mistral-7b-instruct-v0.2"
3334
- | "@cf/mistral/mixtral-8x7b-instruct-v0.1-awq"
3335
- | "@hf/google/gemma-7b-it"
3336
- | "@hf/nexusflow/starling-lm-7b-beta"
3337
- | "@cf/deepseek-ai/deepseek-math-7b-instruct"
3338
- | "@cf/defog/sqlcoder-7b-2"
3339
- | "@cf/openchat/openchat-3.5-0106"
3340
- | "@cf/tiiuae/falcon-7b-instruct"
3341
- | "@cf/thebloke/discolm-german-7b-v1-awq"
3342
- | "@cf/qwen/qwen1.5-0.5b-chat"
3343
- | "@cf/qwen/qwen1.5-1.8b-chat"
3344
- | "@cf/qwen/qwen1.5-7b-chat-awq"
3345
- | "@cf/qwen/qwen1.5-14b-chat-awq"
3346
- | "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
3347
- | "@cf/microsoft/phi-2"
3348
- | "@cf/google/gemma-2b-it-lora"
3349
- | "@cf/google/gemma-7b-it-lora"
3350
- | "@cf/meta-llama/llama-2-7b-chat-hf-lora",
3438
+ model: BaseAiTextGenerationModels,
3351
3439
  inputs: BaseAiTextGeneration["inputs"],
3352
3440
  options?: AiOptions,
3353
3441
  ): Promise<BaseAiTextGeneration["postProcessedOutputs"]>;
3354
3442
  run(
3355
- model: "@cf/meta/m2m100-1.2b",
3443
+ model: BaseAiTranslationModels,
3356
3444
  inputs: BaseAiTranslation["inputs"],
3357
3445
  options?: AiOptions,
3358
3446
  ): Promise<BaseAiTranslation["postProcessedOutputs"]>;
3359
3447
  run(
3360
- model: "@cf/facebook/bart-large-cnn",
3448
+ model: BaseAiSummarizationModels,
3361
3449
  inputs: BaseAiSummarization["inputs"],
3362
3450
  options?: AiOptions,
3363
3451
  ): Promise<BaseAiSummarization["postProcessedOutputs"]>;
3364
3452
  run(
3365
- model: "@cf/unum/uform-gen2-qwen-500m" | "@cf/llava-hf/llava-1.5-7b-hf",
3453
+ model: BaseAiImageToTextModels,
3366
3454
  inputs: BaseAiImageToText["inputs"],
3367
3455
  options?: AiOptions,
3368
3456
  ): Promise<BaseAiImageToText["postProcessedOutputs"]>;
@@ -4959,6 +5047,8 @@ declare type WorkerVersionMetadata = {
4959
5047
  id: string;
4960
5048
  /** The tag of the Worker Version using this binding */
4961
5049
  tag: string;
5050
+ /** The timestamp of when the Worker Version was uploaded */
5051
+ timestamp: string;
4962
5052
  };
4963
5053
  declare interface DynamicDispatchLimits {
4964
5054
  /**
@@ -249,6 +249,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
249
249
  ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
250
250
  CountQueuingStrategy: typeof CountQueuingStrategy;
251
251
  ErrorEvent: typeof ErrorEvent;
252
+ EventSource: typeof EventSource;
252
253
  ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;
253
254
  ReadableStreamDefaultController: typeof ReadableStreamDefaultController;
254
255
  ReadableByteStreamController: typeof ReadableByteStreamController;
@@ -3115,6 +3116,53 @@ export interface gpuGPUOrigin3DDict {
3115
3116
  y?: number;
3116
3117
  z?: number;
3117
3118
  }
3119
+ export declare class EventSource {
3120
+ constructor(url: string, init?: EventSourceEventSourceInit);
3121
+ /**
3122
+ * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
3123
+ *
3124
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
3125
+ */
3126
+ close(): void;
3127
+ /**
3128
+ * Returns the URL providing the event stream.
3129
+ *
3130
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3131
+ */
3132
+ get url(): string;
3133
+ /**
3134
+ * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3135
+ *
3136
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3137
+ */
3138
+ get withCredentials(): boolean;
3139
+ /**
3140
+ * Returns the state of this EventSource object's connection. It can have the values described below.
3141
+ *
3142
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3143
+ */
3144
+ get readyState(): number;
3145
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3146
+ get onopen(): any | null;
3147
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3148
+ set onopen(value: any | null);
3149
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3150
+ get onmessage(): any | null;
3151
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3152
+ set onmessage(value: any | null);
3153
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3154
+ get onerror(): any | null;
3155
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3156
+ set onerror(value: any | null);
3157
+ static readonly CONNECTING: number;
3158
+ static readonly OPEN: number;
3159
+ static readonly CLOSED: number;
3160
+ static from(stream: ReadableStream): EventSource;
3161
+ }
3162
+ export interface EventSourceEventSourceInit {
3163
+ withCredentials?: boolean;
3164
+ fetcher?: Fetcher;
3165
+ }
3118
3166
  export type AiImageClassificationInput = {
3119
3167
  image: number[];
3120
3168
  };
@@ -3131,6 +3179,12 @@ export type AiImageToTextInput = {
3131
3179
  prompt?: string;
3132
3180
  max_tokens?: number;
3133
3181
  temperature?: number;
3182
+ top_p?: number;
3183
+ top_k?: number;
3184
+ seed?: number;
3185
+ repetition_penalty?: number;
3186
+ frequency_penalty?: number;
3187
+ presence_penalty?: number;
3134
3188
  raw?: boolean;
3135
3189
  messages?: RoleScopedChatInput[];
3136
3190
  };
@@ -3211,19 +3265,48 @@ export declare abstract class BaseAiTextEmbeddings {
3211
3265
  postProcessedOutputs: AiTextEmbeddingsOutput;
3212
3266
  }
3213
3267
  export type RoleScopedChatInput = {
3214
- role: string;
3268
+ role: "user" | "assistant" | "system" | "tool";
3215
3269
  content: string;
3216
3270
  };
3271
+ export type AiTextGenerationToolInput = {
3272
+ type: "function";
3273
+ function: {
3274
+ name: string;
3275
+ description: string;
3276
+ parameters?: {
3277
+ type: "object";
3278
+ properties: {
3279
+ [key: string]: {
3280
+ type: string;
3281
+ description?: string;
3282
+ };
3283
+ };
3284
+ required: string[];
3285
+ };
3286
+ };
3287
+ };
3217
3288
  export type AiTextGenerationInput = {
3218
3289
  prompt?: string;
3219
3290
  raw?: boolean;
3220
3291
  stream?: boolean;
3221
3292
  max_tokens?: number;
3293
+ temperature?: number;
3294
+ top_p?: number;
3295
+ top_k?: number;
3296
+ seed?: number;
3297
+ repetition_penalty?: number;
3298
+ frequency_penalty?: number;
3299
+ presence_penalty?: number;
3222
3300
  messages?: RoleScopedChatInput[];
3301
+ tools?: AiTextGenerationToolInput[];
3223
3302
  };
3224
3303
  export type AiTextGenerationOutput =
3225
3304
  | {
3226
3305
  response?: string;
3306
+ tool_calls?: {
3307
+ name: string;
3308
+ arguments: unknown;
3309
+ }[];
3227
3310
  }
3228
3311
  | ReadableStream;
3229
3312
  export declare abstract class BaseAiTextGeneration {
@@ -3266,108 +3349,113 @@ export type AiOptions = {
3266
3349
  prefix?: string;
3267
3350
  extraHeaders?: object;
3268
3351
  };
3352
+ export type BaseAiTextClassificationModels =
3353
+ "@cf/huggingface/distilbert-sst-2-int8";
3354
+ export type BaseAiTextToImageModels =
3355
+ | "@cf/stabilityai/stable-diffusion-xl-base-1.0"
3356
+ | "@cf/runwayml/stable-diffusion-v1-5-inpainting"
3357
+ | "@cf/runwayml/stable-diffusion-v1-5-img2img"
3358
+ | "@cf/lykon/dreamshaper-8-lcm"
3359
+ | "@cf/bytedance/stable-diffusion-xl-lightning";
3360
+ export type BaseAiTextEmbeddingsModels =
3361
+ | "@cf/baai/bge-small-en-v1.5"
3362
+ | "@cf/baai/bge-base-en-v1.5"
3363
+ | "@cf/baai/bge-large-en-v1.5";
3364
+ export type BaseAiSpeechRecognitionModels =
3365
+ | "@cf/openai/whisper"
3366
+ | "@cf/openai/whisper-tiny-en"
3367
+ | "@cf/openai/whisper-sherpa";
3368
+ export type BaseAiImageClassificationModels = "@cf/microsoft/resnet-50";
3369
+ export type BaseAiObjectDetectionModels = "@cf/facebook/detr-resnet-50";
3370
+ export type BaseAiTextGenerationModels =
3371
+ | "@cf/meta/llama-3-8b-instruct"
3372
+ | "@cf/meta/llama-3-8b-instruct-awq"
3373
+ | "@cf/meta/llama-2-7b-chat-int8"
3374
+ | "@cf/mistral/mistral-7b-instruct-v0.1"
3375
+ | "@cf/mistral/mistral-7b-instruct-v0.2-lora"
3376
+ | "@cf/meta/llama-2-7b-chat-fp16"
3377
+ | "@hf/thebloke/llama-2-13b-chat-awq"
3378
+ | "@hf/thebloke/zephyr-7b-beta-awq"
3379
+ | "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
3380
+ | "@hf/thebloke/codellama-7b-instruct-awq"
3381
+ | "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
3382
+ | "@hf/thebloke/neural-chat-7b-v3-1-awq"
3383
+ | "@hf/thebloke/llamaguard-7b-awq"
3384
+ | "@hf/thebloke/deepseek-coder-6.7b-base-awq"
3385
+ | "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
3386
+ | "@hf/nousresearch/hermes-2-pro-mistral-7b"
3387
+ | "@hf/mistral/mistral-7b-instruct-v0.2"
3388
+ | "@hf/google/gemma-7b-it"
3389
+ | "@hf/nexusflow/starling-lm-7b-beta"
3390
+ | "@cf/deepseek-ai/deepseek-math-7b-instruct"
3391
+ | "@cf/defog/sqlcoder-7b-2"
3392
+ | "@cf/openchat/openchat-3.5-0106"
3393
+ | "@cf/tiiuae/falcon-7b-instruct"
3394
+ | "@cf/thebloke/discolm-german-7b-v1-awq"
3395
+ | "@cf/qwen/qwen1.5-0.5b-chat"
3396
+ | "@cf/qwen/qwen1.5-1.8b-chat"
3397
+ | "@cf/qwen/qwen1.5-7b-chat-awq"
3398
+ | "@cf/qwen/qwen1.5-14b-chat-awq"
3399
+ | "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
3400
+ | "@cf/microsoft/phi-2"
3401
+ | "@cf/google/gemma-2b-it-lora"
3402
+ | "@cf/google/gemma-7b-it-lora"
3403
+ | "@cf/meta-llama/llama-2-7b-chat-hf-lora"
3404
+ | "@cf/fblgit/una-cybertron-7b-v2-bf16"
3405
+ | "@cf/fblgit/una-cybertron-7b-v2-awq";
3406
+ export type BaseAiTranslationModels = "@cf/meta/m2m100-1.2b";
3407
+ export type BaseAiSummarizationModels = "@cf/facebook/bart-large-cnn";
3408
+ export type BaseAiImageToTextModels =
3409
+ | "@cf/unum/uform-gen2-qwen-500m"
3410
+ | "@cf/llava-hf/llava-1.5-7b-hf";
3269
3411
  export declare abstract class Ai {
3270
3412
  run(
3271
- model:
3272
- | "@cf/huggingface/distilbert-sst-2-int8"
3273
- | "@cf/jpmorganchase/roberta-spam"
3274
- | "@cf/inml/inml-roberta-dga",
3413
+ model: BaseAiTextClassificationModels,
3275
3414
  inputs: BaseAiTextClassification["inputs"],
3276
3415
  options?: AiOptions,
3277
3416
  ): Promise<BaseAiTextClassification["postProcessedOutputs"]>;
3278
3417
  run(
3279
- model:
3280
- | "@cf/stabilityai/stable-diffusion-xl-base-1.0"
3281
- | "@cf/runwayml/stable-diffusion-v1-5-inpainting"
3282
- | "@cf/runwayml/stable-diffusion-v1-5-img2img"
3283
- | "@cf/lykon/dreamshaper-8-lcm"
3284
- | "@cf/bytedance/stable-diffusion-xl-lightning",
3418
+ model: BaseAiTextToImageModels,
3285
3419
  inputs: BaseAiTextToImage["inputs"],
3286
3420
  options?: AiOptions,
3287
3421
  ): Promise<BaseAiTextToImage["postProcessedOutputs"]>;
3288
3422
  run(
3289
- model: "@hf/sentence-transformers/all-minilm-l6-v2",
3290
- inputs: BaseAiSentenceSimilarity["inputs"],
3291
- options?: AiOptions,
3292
- ): Promise<BaseAiSentenceSimilarity["postProcessedOutputs"]>;
3293
- run(
3294
- model:
3295
- | "@cf/baai/bge-small-en-v1.5"
3296
- | "@cf/baai/bge-base-en-v1.5"
3297
- | "@cf/baai/bge-large-en-v1.5",
3423
+ model: BaseAiTextEmbeddingsModels,
3298
3424
  inputs: BaseAiTextEmbeddings["inputs"],
3299
3425
  options?: AiOptions,
3300
3426
  ): Promise<BaseAiTextEmbeddings["postProcessedOutputs"]>;
3301
3427
  run(
3302
- model:
3303
- | "@cf/openai/whisper"
3304
- | "@cf/openai/whisper-tiny-en"
3305
- | "@cf/openai/whisper-sherpa",
3428
+ model: BaseAiSpeechRecognitionModels,
3306
3429
  inputs: BaseAiSpeechRecognition["inputs"],
3307
3430
  options?: AiOptions,
3308
3431
  ): Promise<BaseAiSpeechRecognition["postProcessedOutputs"]>;
3309
3432
  run(
3310
- model: "@cf/microsoft/resnet-50",
3433
+ model: BaseAiImageClassificationModels,
3311
3434
  inputs: BaseAiImageClassification["inputs"],
3312
3435
  options?: AiOptions,
3313
3436
  ): Promise<BaseAiImageClassification["postProcessedOutputs"]>;
3314
3437
  run(
3315
- model: "@cf/facebook/detr-resnet-50",
3438
+ model: BaseAiObjectDetectionModels,
3316
3439
  inputs: BaseAiObjectDetection["inputs"],
3317
3440
  options?: AiOptions,
3318
3441
  ): Promise<BaseAiObjectDetection["postProcessedOutputs"]>;
3319
3442
  run(
3320
- model:
3321
- | "@cf/meta/llama-3-8b-instruct"
3322
- | "@cf/meta/llama-2-7b-chat-int8"
3323
- | "@cf/mistral/mistral-7b-instruct-v0.1"
3324
- | "@cf/mistral/mistral-7b-instruct-v0.1-vllm"
3325
- | "@cf/mistral/mistral-7b-instruct-v0.2-lora"
3326
- | "@cf/meta/llama-2-7b-chat-fp16"
3327
- | "@hf/thebloke/llama-2-13b-chat-awq"
3328
- | "@hf/thebloke/zephyr-7b-beta-awq"
3329
- | "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
3330
- | "@hf/thebloke/codellama-7b-instruct-awq"
3331
- | "@hf/thebloke/openchat_3.5-awq"
3332
- | "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
3333
- | "@hf/thebloke/neural-chat-7b-v3-1-awq"
3334
- | "@hf/thebloke/llamaguard-7b-awq"
3335
- | "@hf/thebloke/deepseek-coder-6.7b-base-awq"
3336
- | "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
3337
- | "@hf/nousresearch/hermes-2-pro-mistral-7b"
3338
- | "@hf/mistral/mistral-7b-instruct-v0.2"
3339
- | "@cf/mistral/mixtral-8x7b-instruct-v0.1-awq"
3340
- | "@hf/google/gemma-7b-it"
3341
- | "@hf/nexusflow/starling-lm-7b-beta"
3342
- | "@cf/deepseek-ai/deepseek-math-7b-instruct"
3343
- | "@cf/defog/sqlcoder-7b-2"
3344
- | "@cf/openchat/openchat-3.5-0106"
3345
- | "@cf/tiiuae/falcon-7b-instruct"
3346
- | "@cf/thebloke/discolm-german-7b-v1-awq"
3347
- | "@cf/qwen/qwen1.5-0.5b-chat"
3348
- | "@cf/qwen/qwen1.5-1.8b-chat"
3349
- | "@cf/qwen/qwen1.5-7b-chat-awq"
3350
- | "@cf/qwen/qwen1.5-14b-chat-awq"
3351
- | "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
3352
- | "@cf/microsoft/phi-2"
3353
- | "@cf/google/gemma-2b-it-lora"
3354
- | "@cf/google/gemma-7b-it-lora"
3355
- | "@cf/meta-llama/llama-2-7b-chat-hf-lora",
3443
+ model: BaseAiTextGenerationModels,
3356
3444
  inputs: BaseAiTextGeneration["inputs"],
3357
3445
  options?: AiOptions,
3358
3446
  ): Promise<BaseAiTextGeneration["postProcessedOutputs"]>;
3359
3447
  run(
3360
- model: "@cf/meta/m2m100-1.2b",
3448
+ model: BaseAiTranslationModels,
3361
3449
  inputs: BaseAiTranslation["inputs"],
3362
3450
  options?: AiOptions,
3363
3451
  ): Promise<BaseAiTranslation["postProcessedOutputs"]>;
3364
3452
  run(
3365
- model: "@cf/facebook/bart-large-cnn",
3453
+ model: BaseAiSummarizationModels,
3366
3454
  inputs: BaseAiSummarization["inputs"],
3367
3455
  options?: AiOptions,
3368
3456
  ): Promise<BaseAiSummarization["postProcessedOutputs"]>;
3369
3457
  run(
3370
- model: "@cf/unum/uform-gen2-qwen-500m" | "@cf/llava-hf/llava-1.5-7b-hf",
3458
+ model: BaseAiImageToTextModels,
3371
3459
  inputs: BaseAiImageToText["inputs"],
3372
3460
  options?: AiOptions,
3373
3461
  ): Promise<BaseAiImageToText["postProcessedOutputs"]>;
@@ -4898,6 +4986,8 @@ export type WorkerVersionMetadata = {
4898
4986
  id: string;
4899
4987
  /** The tag of the Worker Version using this binding */
4900
4988
  tag: string;
4989
+ /** The timestamp of when the Worker Version was uploaded */
4990
+ timestamp: string;
4901
4991
  };
4902
4992
  export interface DynamicDispatchLimits {
4903
4993
  /**