@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.
- package/2021-11-03/index.d.ts +155 -65
- package/2021-11-03/index.ts +155 -65
- package/2022-01-31/index.d.ts +155 -65
- package/2022-01-31/index.ts +155 -65
- package/2022-03-21/index.d.ts +155 -65
- package/2022-03-21/index.ts +155 -65
- package/2022-08-04/index.d.ts +155 -65
- package/2022-08-04/index.ts +155 -65
- package/2022-10-31/index.d.ts +155 -65
- package/2022-10-31/index.ts +155 -65
- package/2022-11-30/index.d.ts +155 -65
- package/2022-11-30/index.ts +155 -65
- package/2023-03-01/index.d.ts +155 -65
- package/2023-03-01/index.ts +155 -65
- package/2023-07-01/index.d.ts +155 -65
- package/2023-07-01/index.ts +155 -65
- package/experimental/index.d.ts +155 -65
- package/experimental/index.ts +155 -65
- package/index.d.ts +155 -65
- package/index.ts +155 -65
- package/oldest/index.d.ts +155 -65
- package/oldest/index.ts +155 -65
- package/package.json +1 -1
package/2022-08-04/index.d.ts
CHANGED
|
@@ -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
|
CompressionStream: typeof CompressionStream;
|
|
253
254
|
DecompressionStream: typeof DecompressionStream;
|
|
254
255
|
TextEncoderStream: typeof TextEncoderStream;
|
|
@@ -3039,6 +3040,53 @@ declare interface gpuGPUOrigin3DDict {
|
|
|
3039
3040
|
y?: number;
|
|
3040
3041
|
z?: number;
|
|
3041
3042
|
}
|
|
3043
|
+
declare class EventSource {
|
|
3044
|
+
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3045
|
+
/**
|
|
3046
|
+
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
3047
|
+
*
|
|
3048
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
|
3049
|
+
*/
|
|
3050
|
+
close(): void;
|
|
3051
|
+
/**
|
|
3052
|
+
* Returns the URL providing the event stream.
|
|
3053
|
+
*
|
|
3054
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
|
3055
|
+
*/
|
|
3056
|
+
get url(): string;
|
|
3057
|
+
/**
|
|
3058
|
+
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
3059
|
+
*
|
|
3060
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
|
3061
|
+
*/
|
|
3062
|
+
get withCredentials(): boolean;
|
|
3063
|
+
/**
|
|
3064
|
+
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
3065
|
+
*
|
|
3066
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
|
3067
|
+
*/
|
|
3068
|
+
get readyState(): number;
|
|
3069
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3070
|
+
get onopen(): any | null;
|
|
3071
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3072
|
+
set onopen(value: any | null);
|
|
3073
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3074
|
+
get onmessage(): any | null;
|
|
3075
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3076
|
+
set onmessage(value: any | null);
|
|
3077
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3078
|
+
get onerror(): any | null;
|
|
3079
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3080
|
+
set onerror(value: any | null);
|
|
3081
|
+
static readonly CONNECTING: number;
|
|
3082
|
+
static readonly OPEN: number;
|
|
3083
|
+
static readonly CLOSED: number;
|
|
3084
|
+
static from(stream: ReadableStream): EventSource;
|
|
3085
|
+
}
|
|
3086
|
+
declare interface EventSourceEventSourceInit {
|
|
3087
|
+
withCredentials?: boolean;
|
|
3088
|
+
fetcher?: Fetcher;
|
|
3089
|
+
}
|
|
3042
3090
|
declare type AiImageClassificationInput = {
|
|
3043
3091
|
image: number[];
|
|
3044
3092
|
};
|
|
@@ -3055,6 +3103,12 @@ declare type AiImageToTextInput = {
|
|
|
3055
3103
|
prompt?: string;
|
|
3056
3104
|
max_tokens?: number;
|
|
3057
3105
|
temperature?: number;
|
|
3106
|
+
top_p?: number;
|
|
3107
|
+
top_k?: number;
|
|
3108
|
+
seed?: number;
|
|
3109
|
+
repetition_penalty?: number;
|
|
3110
|
+
frequency_penalty?: number;
|
|
3111
|
+
presence_penalty?: number;
|
|
3058
3112
|
raw?: boolean;
|
|
3059
3113
|
messages?: RoleScopedChatInput[];
|
|
3060
3114
|
};
|
|
@@ -3135,19 +3189,48 @@ declare abstract class BaseAiTextEmbeddings {
|
|
|
3135
3189
|
postProcessedOutputs: AiTextEmbeddingsOutput;
|
|
3136
3190
|
}
|
|
3137
3191
|
declare type RoleScopedChatInput = {
|
|
3138
|
-
role:
|
|
3192
|
+
role: "user" | "assistant" | "system" | "tool";
|
|
3139
3193
|
content: string;
|
|
3140
3194
|
};
|
|
3195
|
+
declare type AiTextGenerationToolInput = {
|
|
3196
|
+
type: "function";
|
|
3197
|
+
function: {
|
|
3198
|
+
name: string;
|
|
3199
|
+
description: string;
|
|
3200
|
+
parameters?: {
|
|
3201
|
+
type: "object";
|
|
3202
|
+
properties: {
|
|
3203
|
+
[key: string]: {
|
|
3204
|
+
type: string;
|
|
3205
|
+
description?: string;
|
|
3206
|
+
};
|
|
3207
|
+
};
|
|
3208
|
+
required: string[];
|
|
3209
|
+
};
|
|
3210
|
+
};
|
|
3211
|
+
};
|
|
3141
3212
|
declare type AiTextGenerationInput = {
|
|
3142
3213
|
prompt?: string;
|
|
3143
3214
|
raw?: boolean;
|
|
3144
3215
|
stream?: boolean;
|
|
3145
3216
|
max_tokens?: number;
|
|
3217
|
+
temperature?: number;
|
|
3218
|
+
top_p?: number;
|
|
3219
|
+
top_k?: number;
|
|
3220
|
+
seed?: number;
|
|
3221
|
+
repetition_penalty?: number;
|
|
3222
|
+
frequency_penalty?: number;
|
|
3223
|
+
presence_penalty?: number;
|
|
3146
3224
|
messages?: RoleScopedChatInput[];
|
|
3225
|
+
tools?: AiTextGenerationToolInput[];
|
|
3147
3226
|
};
|
|
3148
3227
|
declare type AiTextGenerationOutput =
|
|
3149
3228
|
| {
|
|
3150
3229
|
response?: string;
|
|
3230
|
+
tool_calls?: {
|
|
3231
|
+
name: string;
|
|
3232
|
+
arguments: unknown;
|
|
3233
|
+
}[];
|
|
3151
3234
|
}
|
|
3152
3235
|
| ReadableStream;
|
|
3153
3236
|
declare abstract class BaseAiTextGeneration {
|
|
@@ -3190,108 +3273,113 @@ declare type AiOptions = {
|
|
|
3190
3273
|
prefix?: string;
|
|
3191
3274
|
extraHeaders?: object;
|
|
3192
3275
|
};
|
|
3276
|
+
declare type BaseAiTextClassificationModels =
|
|
3277
|
+
"@cf/huggingface/distilbert-sst-2-int8";
|
|
3278
|
+
declare type BaseAiTextToImageModels =
|
|
3279
|
+
| "@cf/stabilityai/stable-diffusion-xl-base-1.0"
|
|
3280
|
+
| "@cf/runwayml/stable-diffusion-v1-5-inpainting"
|
|
3281
|
+
| "@cf/runwayml/stable-diffusion-v1-5-img2img"
|
|
3282
|
+
| "@cf/lykon/dreamshaper-8-lcm"
|
|
3283
|
+
| "@cf/bytedance/stable-diffusion-xl-lightning";
|
|
3284
|
+
declare type BaseAiTextEmbeddingsModels =
|
|
3285
|
+
| "@cf/baai/bge-small-en-v1.5"
|
|
3286
|
+
| "@cf/baai/bge-base-en-v1.5"
|
|
3287
|
+
| "@cf/baai/bge-large-en-v1.5";
|
|
3288
|
+
declare type BaseAiSpeechRecognitionModels =
|
|
3289
|
+
| "@cf/openai/whisper"
|
|
3290
|
+
| "@cf/openai/whisper-tiny-en"
|
|
3291
|
+
| "@cf/openai/whisper-sherpa";
|
|
3292
|
+
declare type BaseAiImageClassificationModels = "@cf/microsoft/resnet-50";
|
|
3293
|
+
declare type BaseAiObjectDetectionModels = "@cf/facebook/detr-resnet-50";
|
|
3294
|
+
declare type BaseAiTextGenerationModels =
|
|
3295
|
+
| "@cf/meta/llama-3-8b-instruct"
|
|
3296
|
+
| "@cf/meta/llama-3-8b-instruct-awq"
|
|
3297
|
+
| "@cf/meta/llama-2-7b-chat-int8"
|
|
3298
|
+
| "@cf/mistral/mistral-7b-instruct-v0.1"
|
|
3299
|
+
| "@cf/mistral/mistral-7b-instruct-v0.2-lora"
|
|
3300
|
+
| "@cf/meta/llama-2-7b-chat-fp16"
|
|
3301
|
+
| "@hf/thebloke/llama-2-13b-chat-awq"
|
|
3302
|
+
| "@hf/thebloke/zephyr-7b-beta-awq"
|
|
3303
|
+
| "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
|
|
3304
|
+
| "@hf/thebloke/codellama-7b-instruct-awq"
|
|
3305
|
+
| "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
|
|
3306
|
+
| "@hf/thebloke/neural-chat-7b-v3-1-awq"
|
|
3307
|
+
| "@hf/thebloke/llamaguard-7b-awq"
|
|
3308
|
+
| "@hf/thebloke/deepseek-coder-6.7b-base-awq"
|
|
3309
|
+
| "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
|
|
3310
|
+
| "@hf/nousresearch/hermes-2-pro-mistral-7b"
|
|
3311
|
+
| "@hf/mistral/mistral-7b-instruct-v0.2"
|
|
3312
|
+
| "@hf/google/gemma-7b-it"
|
|
3313
|
+
| "@hf/nexusflow/starling-lm-7b-beta"
|
|
3314
|
+
| "@cf/deepseek-ai/deepseek-math-7b-instruct"
|
|
3315
|
+
| "@cf/defog/sqlcoder-7b-2"
|
|
3316
|
+
| "@cf/openchat/openchat-3.5-0106"
|
|
3317
|
+
| "@cf/tiiuae/falcon-7b-instruct"
|
|
3318
|
+
| "@cf/thebloke/discolm-german-7b-v1-awq"
|
|
3319
|
+
| "@cf/qwen/qwen1.5-0.5b-chat"
|
|
3320
|
+
| "@cf/qwen/qwen1.5-1.8b-chat"
|
|
3321
|
+
| "@cf/qwen/qwen1.5-7b-chat-awq"
|
|
3322
|
+
| "@cf/qwen/qwen1.5-14b-chat-awq"
|
|
3323
|
+
| "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
|
|
3324
|
+
| "@cf/microsoft/phi-2"
|
|
3325
|
+
| "@cf/google/gemma-2b-it-lora"
|
|
3326
|
+
| "@cf/google/gemma-7b-it-lora"
|
|
3327
|
+
| "@cf/meta-llama/llama-2-7b-chat-hf-lora"
|
|
3328
|
+
| "@cf/fblgit/una-cybertron-7b-v2-bf16"
|
|
3329
|
+
| "@cf/fblgit/una-cybertron-7b-v2-awq";
|
|
3330
|
+
declare type BaseAiTranslationModels = "@cf/meta/m2m100-1.2b";
|
|
3331
|
+
declare type BaseAiSummarizationModels = "@cf/facebook/bart-large-cnn";
|
|
3332
|
+
declare type BaseAiImageToTextModels =
|
|
3333
|
+
| "@cf/unum/uform-gen2-qwen-500m"
|
|
3334
|
+
| "@cf/llava-hf/llava-1.5-7b-hf";
|
|
3193
3335
|
declare abstract class Ai {
|
|
3194
3336
|
run(
|
|
3195
|
-
model:
|
|
3196
|
-
| "@cf/huggingface/distilbert-sst-2-int8"
|
|
3197
|
-
| "@cf/jpmorganchase/roberta-spam"
|
|
3198
|
-
| "@cf/inml/inml-roberta-dga",
|
|
3337
|
+
model: BaseAiTextClassificationModels,
|
|
3199
3338
|
inputs: BaseAiTextClassification["inputs"],
|
|
3200
3339
|
options?: AiOptions,
|
|
3201
3340
|
): Promise<BaseAiTextClassification["postProcessedOutputs"]>;
|
|
3202
3341
|
run(
|
|
3203
|
-
model:
|
|
3204
|
-
| "@cf/stabilityai/stable-diffusion-xl-base-1.0"
|
|
3205
|
-
| "@cf/runwayml/stable-diffusion-v1-5-inpainting"
|
|
3206
|
-
| "@cf/runwayml/stable-diffusion-v1-5-img2img"
|
|
3207
|
-
| "@cf/lykon/dreamshaper-8-lcm"
|
|
3208
|
-
| "@cf/bytedance/stable-diffusion-xl-lightning",
|
|
3342
|
+
model: BaseAiTextToImageModels,
|
|
3209
3343
|
inputs: BaseAiTextToImage["inputs"],
|
|
3210
3344
|
options?: AiOptions,
|
|
3211
3345
|
): Promise<BaseAiTextToImage["postProcessedOutputs"]>;
|
|
3212
3346
|
run(
|
|
3213
|
-
model:
|
|
3214
|
-
inputs: BaseAiSentenceSimilarity["inputs"],
|
|
3215
|
-
options?: AiOptions,
|
|
3216
|
-
): Promise<BaseAiSentenceSimilarity["postProcessedOutputs"]>;
|
|
3217
|
-
run(
|
|
3218
|
-
model:
|
|
3219
|
-
| "@cf/baai/bge-small-en-v1.5"
|
|
3220
|
-
| "@cf/baai/bge-base-en-v1.5"
|
|
3221
|
-
| "@cf/baai/bge-large-en-v1.5",
|
|
3347
|
+
model: BaseAiTextEmbeddingsModels,
|
|
3222
3348
|
inputs: BaseAiTextEmbeddings["inputs"],
|
|
3223
3349
|
options?: AiOptions,
|
|
3224
3350
|
): Promise<BaseAiTextEmbeddings["postProcessedOutputs"]>;
|
|
3225
3351
|
run(
|
|
3226
|
-
model:
|
|
3227
|
-
| "@cf/openai/whisper"
|
|
3228
|
-
| "@cf/openai/whisper-tiny-en"
|
|
3229
|
-
| "@cf/openai/whisper-sherpa",
|
|
3352
|
+
model: BaseAiSpeechRecognitionModels,
|
|
3230
3353
|
inputs: BaseAiSpeechRecognition["inputs"],
|
|
3231
3354
|
options?: AiOptions,
|
|
3232
3355
|
): Promise<BaseAiSpeechRecognition["postProcessedOutputs"]>;
|
|
3233
3356
|
run(
|
|
3234
|
-
model:
|
|
3357
|
+
model: BaseAiImageClassificationModels,
|
|
3235
3358
|
inputs: BaseAiImageClassification["inputs"],
|
|
3236
3359
|
options?: AiOptions,
|
|
3237
3360
|
): Promise<BaseAiImageClassification["postProcessedOutputs"]>;
|
|
3238
3361
|
run(
|
|
3239
|
-
model:
|
|
3362
|
+
model: BaseAiObjectDetectionModels,
|
|
3240
3363
|
inputs: BaseAiObjectDetection["inputs"],
|
|
3241
3364
|
options?: AiOptions,
|
|
3242
3365
|
): Promise<BaseAiObjectDetection["postProcessedOutputs"]>;
|
|
3243
3366
|
run(
|
|
3244
|
-
model:
|
|
3245
|
-
| "@cf/meta/llama-3-8b-instruct"
|
|
3246
|
-
| "@cf/meta/llama-2-7b-chat-int8"
|
|
3247
|
-
| "@cf/mistral/mistral-7b-instruct-v0.1"
|
|
3248
|
-
| "@cf/mistral/mistral-7b-instruct-v0.1-vllm"
|
|
3249
|
-
| "@cf/mistral/mistral-7b-instruct-v0.2-lora"
|
|
3250
|
-
| "@cf/meta/llama-2-7b-chat-fp16"
|
|
3251
|
-
| "@hf/thebloke/llama-2-13b-chat-awq"
|
|
3252
|
-
| "@hf/thebloke/zephyr-7b-beta-awq"
|
|
3253
|
-
| "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
|
|
3254
|
-
| "@hf/thebloke/codellama-7b-instruct-awq"
|
|
3255
|
-
| "@hf/thebloke/openchat_3.5-awq"
|
|
3256
|
-
| "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
|
|
3257
|
-
| "@hf/thebloke/neural-chat-7b-v3-1-awq"
|
|
3258
|
-
| "@hf/thebloke/llamaguard-7b-awq"
|
|
3259
|
-
| "@hf/thebloke/deepseek-coder-6.7b-base-awq"
|
|
3260
|
-
| "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
|
|
3261
|
-
| "@hf/nousresearch/hermes-2-pro-mistral-7b"
|
|
3262
|
-
| "@hf/mistral/mistral-7b-instruct-v0.2"
|
|
3263
|
-
| "@cf/mistral/mixtral-8x7b-instruct-v0.1-awq"
|
|
3264
|
-
| "@hf/google/gemma-7b-it"
|
|
3265
|
-
| "@hf/nexusflow/starling-lm-7b-beta"
|
|
3266
|
-
| "@cf/deepseek-ai/deepseek-math-7b-instruct"
|
|
3267
|
-
| "@cf/defog/sqlcoder-7b-2"
|
|
3268
|
-
| "@cf/openchat/openchat-3.5-0106"
|
|
3269
|
-
| "@cf/tiiuae/falcon-7b-instruct"
|
|
3270
|
-
| "@cf/thebloke/discolm-german-7b-v1-awq"
|
|
3271
|
-
| "@cf/qwen/qwen1.5-0.5b-chat"
|
|
3272
|
-
| "@cf/qwen/qwen1.5-1.8b-chat"
|
|
3273
|
-
| "@cf/qwen/qwen1.5-7b-chat-awq"
|
|
3274
|
-
| "@cf/qwen/qwen1.5-14b-chat-awq"
|
|
3275
|
-
| "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
|
|
3276
|
-
| "@cf/microsoft/phi-2"
|
|
3277
|
-
| "@cf/google/gemma-2b-it-lora"
|
|
3278
|
-
| "@cf/google/gemma-7b-it-lora"
|
|
3279
|
-
| "@cf/meta-llama/llama-2-7b-chat-hf-lora",
|
|
3367
|
+
model: BaseAiTextGenerationModels,
|
|
3280
3368
|
inputs: BaseAiTextGeneration["inputs"],
|
|
3281
3369
|
options?: AiOptions,
|
|
3282
3370
|
): Promise<BaseAiTextGeneration["postProcessedOutputs"]>;
|
|
3283
3371
|
run(
|
|
3284
|
-
model:
|
|
3372
|
+
model: BaseAiTranslationModels,
|
|
3285
3373
|
inputs: BaseAiTranslation["inputs"],
|
|
3286
3374
|
options?: AiOptions,
|
|
3287
3375
|
): Promise<BaseAiTranslation["postProcessedOutputs"]>;
|
|
3288
3376
|
run(
|
|
3289
|
-
model:
|
|
3377
|
+
model: BaseAiSummarizationModels,
|
|
3290
3378
|
inputs: BaseAiSummarization["inputs"],
|
|
3291
3379
|
options?: AiOptions,
|
|
3292
3380
|
): Promise<BaseAiSummarization["postProcessedOutputs"]>;
|
|
3293
3381
|
run(
|
|
3294
|
-
model:
|
|
3382
|
+
model: BaseAiImageToTextModels,
|
|
3295
3383
|
inputs: BaseAiImageToText["inputs"],
|
|
3296
3384
|
options?: AiOptions,
|
|
3297
3385
|
): Promise<BaseAiImageToText["postProcessedOutputs"]>;
|
|
@@ -4888,6 +4976,8 @@ declare type WorkerVersionMetadata = {
|
|
|
4888
4976
|
id: string;
|
|
4889
4977
|
/** The tag of the Worker Version using this binding */
|
|
4890
4978
|
tag: string;
|
|
4979
|
+
/** The timestamp of when the Worker Version was uploaded */
|
|
4980
|
+
timestamp: string;
|
|
4891
4981
|
};
|
|
4892
4982
|
declare interface DynamicDispatchLimits {
|
|
4893
4983
|
/**
|
package/2022-08-04/index.ts
CHANGED
|
@@ -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
|
CompressionStream: typeof CompressionStream;
|
|
253
254
|
DecompressionStream: typeof DecompressionStream;
|
|
254
255
|
TextEncoderStream: typeof TextEncoderStream;
|
|
@@ -3044,6 +3045,53 @@ export interface gpuGPUOrigin3DDict {
|
|
|
3044
3045
|
y?: number;
|
|
3045
3046
|
z?: number;
|
|
3046
3047
|
}
|
|
3048
|
+
export declare class EventSource {
|
|
3049
|
+
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3050
|
+
/**
|
|
3051
|
+
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
3052
|
+
*
|
|
3053
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
|
3054
|
+
*/
|
|
3055
|
+
close(): void;
|
|
3056
|
+
/**
|
|
3057
|
+
* Returns the URL providing the event stream.
|
|
3058
|
+
*
|
|
3059
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
|
3060
|
+
*/
|
|
3061
|
+
get url(): string;
|
|
3062
|
+
/**
|
|
3063
|
+
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
3064
|
+
*
|
|
3065
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
|
3066
|
+
*/
|
|
3067
|
+
get withCredentials(): boolean;
|
|
3068
|
+
/**
|
|
3069
|
+
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
3070
|
+
*
|
|
3071
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
|
3072
|
+
*/
|
|
3073
|
+
get readyState(): number;
|
|
3074
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3075
|
+
get onopen(): any | null;
|
|
3076
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3077
|
+
set onopen(value: any | null);
|
|
3078
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3079
|
+
get onmessage(): any | null;
|
|
3080
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3081
|
+
set onmessage(value: any | null);
|
|
3082
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3083
|
+
get onerror(): any | null;
|
|
3084
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3085
|
+
set onerror(value: any | null);
|
|
3086
|
+
static readonly CONNECTING: number;
|
|
3087
|
+
static readonly OPEN: number;
|
|
3088
|
+
static readonly CLOSED: number;
|
|
3089
|
+
static from(stream: ReadableStream): EventSource;
|
|
3090
|
+
}
|
|
3091
|
+
export interface EventSourceEventSourceInit {
|
|
3092
|
+
withCredentials?: boolean;
|
|
3093
|
+
fetcher?: Fetcher;
|
|
3094
|
+
}
|
|
3047
3095
|
export type AiImageClassificationInput = {
|
|
3048
3096
|
image: number[];
|
|
3049
3097
|
};
|
|
@@ -3060,6 +3108,12 @@ export type AiImageToTextInput = {
|
|
|
3060
3108
|
prompt?: string;
|
|
3061
3109
|
max_tokens?: number;
|
|
3062
3110
|
temperature?: number;
|
|
3111
|
+
top_p?: number;
|
|
3112
|
+
top_k?: number;
|
|
3113
|
+
seed?: number;
|
|
3114
|
+
repetition_penalty?: number;
|
|
3115
|
+
frequency_penalty?: number;
|
|
3116
|
+
presence_penalty?: number;
|
|
3063
3117
|
raw?: boolean;
|
|
3064
3118
|
messages?: RoleScopedChatInput[];
|
|
3065
3119
|
};
|
|
@@ -3140,19 +3194,48 @@ export declare abstract class BaseAiTextEmbeddings {
|
|
|
3140
3194
|
postProcessedOutputs: AiTextEmbeddingsOutput;
|
|
3141
3195
|
}
|
|
3142
3196
|
export type RoleScopedChatInput = {
|
|
3143
|
-
role:
|
|
3197
|
+
role: "user" | "assistant" | "system" | "tool";
|
|
3144
3198
|
content: string;
|
|
3145
3199
|
};
|
|
3200
|
+
export type AiTextGenerationToolInput = {
|
|
3201
|
+
type: "function";
|
|
3202
|
+
function: {
|
|
3203
|
+
name: string;
|
|
3204
|
+
description: string;
|
|
3205
|
+
parameters?: {
|
|
3206
|
+
type: "object";
|
|
3207
|
+
properties: {
|
|
3208
|
+
[key: string]: {
|
|
3209
|
+
type: string;
|
|
3210
|
+
description?: string;
|
|
3211
|
+
};
|
|
3212
|
+
};
|
|
3213
|
+
required: string[];
|
|
3214
|
+
};
|
|
3215
|
+
};
|
|
3216
|
+
};
|
|
3146
3217
|
export type AiTextGenerationInput = {
|
|
3147
3218
|
prompt?: string;
|
|
3148
3219
|
raw?: boolean;
|
|
3149
3220
|
stream?: boolean;
|
|
3150
3221
|
max_tokens?: number;
|
|
3222
|
+
temperature?: number;
|
|
3223
|
+
top_p?: number;
|
|
3224
|
+
top_k?: number;
|
|
3225
|
+
seed?: number;
|
|
3226
|
+
repetition_penalty?: number;
|
|
3227
|
+
frequency_penalty?: number;
|
|
3228
|
+
presence_penalty?: number;
|
|
3151
3229
|
messages?: RoleScopedChatInput[];
|
|
3230
|
+
tools?: AiTextGenerationToolInput[];
|
|
3152
3231
|
};
|
|
3153
3232
|
export type AiTextGenerationOutput =
|
|
3154
3233
|
| {
|
|
3155
3234
|
response?: string;
|
|
3235
|
+
tool_calls?: {
|
|
3236
|
+
name: string;
|
|
3237
|
+
arguments: unknown;
|
|
3238
|
+
}[];
|
|
3156
3239
|
}
|
|
3157
3240
|
| ReadableStream;
|
|
3158
3241
|
export declare abstract class BaseAiTextGeneration {
|
|
@@ -3195,108 +3278,113 @@ export type AiOptions = {
|
|
|
3195
3278
|
prefix?: string;
|
|
3196
3279
|
extraHeaders?: object;
|
|
3197
3280
|
};
|
|
3281
|
+
export type BaseAiTextClassificationModels =
|
|
3282
|
+
"@cf/huggingface/distilbert-sst-2-int8";
|
|
3283
|
+
export type BaseAiTextToImageModels =
|
|
3284
|
+
| "@cf/stabilityai/stable-diffusion-xl-base-1.0"
|
|
3285
|
+
| "@cf/runwayml/stable-diffusion-v1-5-inpainting"
|
|
3286
|
+
| "@cf/runwayml/stable-diffusion-v1-5-img2img"
|
|
3287
|
+
| "@cf/lykon/dreamshaper-8-lcm"
|
|
3288
|
+
| "@cf/bytedance/stable-diffusion-xl-lightning";
|
|
3289
|
+
export type BaseAiTextEmbeddingsModels =
|
|
3290
|
+
| "@cf/baai/bge-small-en-v1.5"
|
|
3291
|
+
| "@cf/baai/bge-base-en-v1.5"
|
|
3292
|
+
| "@cf/baai/bge-large-en-v1.5";
|
|
3293
|
+
export type BaseAiSpeechRecognitionModels =
|
|
3294
|
+
| "@cf/openai/whisper"
|
|
3295
|
+
| "@cf/openai/whisper-tiny-en"
|
|
3296
|
+
| "@cf/openai/whisper-sherpa";
|
|
3297
|
+
export type BaseAiImageClassificationModels = "@cf/microsoft/resnet-50";
|
|
3298
|
+
export type BaseAiObjectDetectionModels = "@cf/facebook/detr-resnet-50";
|
|
3299
|
+
export type BaseAiTextGenerationModels =
|
|
3300
|
+
| "@cf/meta/llama-3-8b-instruct"
|
|
3301
|
+
| "@cf/meta/llama-3-8b-instruct-awq"
|
|
3302
|
+
| "@cf/meta/llama-2-7b-chat-int8"
|
|
3303
|
+
| "@cf/mistral/mistral-7b-instruct-v0.1"
|
|
3304
|
+
| "@cf/mistral/mistral-7b-instruct-v0.2-lora"
|
|
3305
|
+
| "@cf/meta/llama-2-7b-chat-fp16"
|
|
3306
|
+
| "@hf/thebloke/llama-2-13b-chat-awq"
|
|
3307
|
+
| "@hf/thebloke/zephyr-7b-beta-awq"
|
|
3308
|
+
| "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
|
|
3309
|
+
| "@hf/thebloke/codellama-7b-instruct-awq"
|
|
3310
|
+
| "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
|
|
3311
|
+
| "@hf/thebloke/neural-chat-7b-v3-1-awq"
|
|
3312
|
+
| "@hf/thebloke/llamaguard-7b-awq"
|
|
3313
|
+
| "@hf/thebloke/deepseek-coder-6.7b-base-awq"
|
|
3314
|
+
| "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
|
|
3315
|
+
| "@hf/nousresearch/hermes-2-pro-mistral-7b"
|
|
3316
|
+
| "@hf/mistral/mistral-7b-instruct-v0.2"
|
|
3317
|
+
| "@hf/google/gemma-7b-it"
|
|
3318
|
+
| "@hf/nexusflow/starling-lm-7b-beta"
|
|
3319
|
+
| "@cf/deepseek-ai/deepseek-math-7b-instruct"
|
|
3320
|
+
| "@cf/defog/sqlcoder-7b-2"
|
|
3321
|
+
| "@cf/openchat/openchat-3.5-0106"
|
|
3322
|
+
| "@cf/tiiuae/falcon-7b-instruct"
|
|
3323
|
+
| "@cf/thebloke/discolm-german-7b-v1-awq"
|
|
3324
|
+
| "@cf/qwen/qwen1.5-0.5b-chat"
|
|
3325
|
+
| "@cf/qwen/qwen1.5-1.8b-chat"
|
|
3326
|
+
| "@cf/qwen/qwen1.5-7b-chat-awq"
|
|
3327
|
+
| "@cf/qwen/qwen1.5-14b-chat-awq"
|
|
3328
|
+
| "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
|
|
3329
|
+
| "@cf/microsoft/phi-2"
|
|
3330
|
+
| "@cf/google/gemma-2b-it-lora"
|
|
3331
|
+
| "@cf/google/gemma-7b-it-lora"
|
|
3332
|
+
| "@cf/meta-llama/llama-2-7b-chat-hf-lora"
|
|
3333
|
+
| "@cf/fblgit/una-cybertron-7b-v2-bf16"
|
|
3334
|
+
| "@cf/fblgit/una-cybertron-7b-v2-awq";
|
|
3335
|
+
export type BaseAiTranslationModels = "@cf/meta/m2m100-1.2b";
|
|
3336
|
+
export type BaseAiSummarizationModels = "@cf/facebook/bart-large-cnn";
|
|
3337
|
+
export type BaseAiImageToTextModels =
|
|
3338
|
+
| "@cf/unum/uform-gen2-qwen-500m"
|
|
3339
|
+
| "@cf/llava-hf/llava-1.5-7b-hf";
|
|
3198
3340
|
export declare abstract class Ai {
|
|
3199
3341
|
run(
|
|
3200
|
-
model:
|
|
3201
|
-
| "@cf/huggingface/distilbert-sst-2-int8"
|
|
3202
|
-
| "@cf/jpmorganchase/roberta-spam"
|
|
3203
|
-
| "@cf/inml/inml-roberta-dga",
|
|
3342
|
+
model: BaseAiTextClassificationModels,
|
|
3204
3343
|
inputs: BaseAiTextClassification["inputs"],
|
|
3205
3344
|
options?: AiOptions,
|
|
3206
3345
|
): Promise<BaseAiTextClassification["postProcessedOutputs"]>;
|
|
3207
3346
|
run(
|
|
3208
|
-
model:
|
|
3209
|
-
| "@cf/stabilityai/stable-diffusion-xl-base-1.0"
|
|
3210
|
-
| "@cf/runwayml/stable-diffusion-v1-5-inpainting"
|
|
3211
|
-
| "@cf/runwayml/stable-diffusion-v1-5-img2img"
|
|
3212
|
-
| "@cf/lykon/dreamshaper-8-lcm"
|
|
3213
|
-
| "@cf/bytedance/stable-diffusion-xl-lightning",
|
|
3347
|
+
model: BaseAiTextToImageModels,
|
|
3214
3348
|
inputs: BaseAiTextToImage["inputs"],
|
|
3215
3349
|
options?: AiOptions,
|
|
3216
3350
|
): Promise<BaseAiTextToImage["postProcessedOutputs"]>;
|
|
3217
3351
|
run(
|
|
3218
|
-
model:
|
|
3219
|
-
inputs: BaseAiSentenceSimilarity["inputs"],
|
|
3220
|
-
options?: AiOptions,
|
|
3221
|
-
): Promise<BaseAiSentenceSimilarity["postProcessedOutputs"]>;
|
|
3222
|
-
run(
|
|
3223
|
-
model:
|
|
3224
|
-
| "@cf/baai/bge-small-en-v1.5"
|
|
3225
|
-
| "@cf/baai/bge-base-en-v1.5"
|
|
3226
|
-
| "@cf/baai/bge-large-en-v1.5",
|
|
3352
|
+
model: BaseAiTextEmbeddingsModels,
|
|
3227
3353
|
inputs: BaseAiTextEmbeddings["inputs"],
|
|
3228
3354
|
options?: AiOptions,
|
|
3229
3355
|
): Promise<BaseAiTextEmbeddings["postProcessedOutputs"]>;
|
|
3230
3356
|
run(
|
|
3231
|
-
model:
|
|
3232
|
-
| "@cf/openai/whisper"
|
|
3233
|
-
| "@cf/openai/whisper-tiny-en"
|
|
3234
|
-
| "@cf/openai/whisper-sherpa",
|
|
3357
|
+
model: BaseAiSpeechRecognitionModels,
|
|
3235
3358
|
inputs: BaseAiSpeechRecognition["inputs"],
|
|
3236
3359
|
options?: AiOptions,
|
|
3237
3360
|
): Promise<BaseAiSpeechRecognition["postProcessedOutputs"]>;
|
|
3238
3361
|
run(
|
|
3239
|
-
model:
|
|
3362
|
+
model: BaseAiImageClassificationModels,
|
|
3240
3363
|
inputs: BaseAiImageClassification["inputs"],
|
|
3241
3364
|
options?: AiOptions,
|
|
3242
3365
|
): Promise<BaseAiImageClassification["postProcessedOutputs"]>;
|
|
3243
3366
|
run(
|
|
3244
|
-
model:
|
|
3367
|
+
model: BaseAiObjectDetectionModels,
|
|
3245
3368
|
inputs: BaseAiObjectDetection["inputs"],
|
|
3246
3369
|
options?: AiOptions,
|
|
3247
3370
|
): Promise<BaseAiObjectDetection["postProcessedOutputs"]>;
|
|
3248
3371
|
run(
|
|
3249
|
-
model:
|
|
3250
|
-
| "@cf/meta/llama-3-8b-instruct"
|
|
3251
|
-
| "@cf/meta/llama-2-7b-chat-int8"
|
|
3252
|
-
| "@cf/mistral/mistral-7b-instruct-v0.1"
|
|
3253
|
-
| "@cf/mistral/mistral-7b-instruct-v0.1-vllm"
|
|
3254
|
-
| "@cf/mistral/mistral-7b-instruct-v0.2-lora"
|
|
3255
|
-
| "@cf/meta/llama-2-7b-chat-fp16"
|
|
3256
|
-
| "@hf/thebloke/llama-2-13b-chat-awq"
|
|
3257
|
-
| "@hf/thebloke/zephyr-7b-beta-awq"
|
|
3258
|
-
| "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
|
|
3259
|
-
| "@hf/thebloke/codellama-7b-instruct-awq"
|
|
3260
|
-
| "@hf/thebloke/openchat_3.5-awq"
|
|
3261
|
-
| "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
|
|
3262
|
-
| "@hf/thebloke/neural-chat-7b-v3-1-awq"
|
|
3263
|
-
| "@hf/thebloke/llamaguard-7b-awq"
|
|
3264
|
-
| "@hf/thebloke/deepseek-coder-6.7b-base-awq"
|
|
3265
|
-
| "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
|
|
3266
|
-
| "@hf/nousresearch/hermes-2-pro-mistral-7b"
|
|
3267
|
-
| "@hf/mistral/mistral-7b-instruct-v0.2"
|
|
3268
|
-
| "@cf/mistral/mixtral-8x7b-instruct-v0.1-awq"
|
|
3269
|
-
| "@hf/google/gemma-7b-it"
|
|
3270
|
-
| "@hf/nexusflow/starling-lm-7b-beta"
|
|
3271
|
-
| "@cf/deepseek-ai/deepseek-math-7b-instruct"
|
|
3272
|
-
| "@cf/defog/sqlcoder-7b-2"
|
|
3273
|
-
| "@cf/openchat/openchat-3.5-0106"
|
|
3274
|
-
| "@cf/tiiuae/falcon-7b-instruct"
|
|
3275
|
-
| "@cf/thebloke/discolm-german-7b-v1-awq"
|
|
3276
|
-
| "@cf/qwen/qwen1.5-0.5b-chat"
|
|
3277
|
-
| "@cf/qwen/qwen1.5-1.8b-chat"
|
|
3278
|
-
| "@cf/qwen/qwen1.5-7b-chat-awq"
|
|
3279
|
-
| "@cf/qwen/qwen1.5-14b-chat-awq"
|
|
3280
|
-
| "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
|
|
3281
|
-
| "@cf/microsoft/phi-2"
|
|
3282
|
-
| "@cf/google/gemma-2b-it-lora"
|
|
3283
|
-
| "@cf/google/gemma-7b-it-lora"
|
|
3284
|
-
| "@cf/meta-llama/llama-2-7b-chat-hf-lora",
|
|
3372
|
+
model: BaseAiTextGenerationModels,
|
|
3285
3373
|
inputs: BaseAiTextGeneration["inputs"],
|
|
3286
3374
|
options?: AiOptions,
|
|
3287
3375
|
): Promise<BaseAiTextGeneration["postProcessedOutputs"]>;
|
|
3288
3376
|
run(
|
|
3289
|
-
model:
|
|
3377
|
+
model: BaseAiTranslationModels,
|
|
3290
3378
|
inputs: BaseAiTranslation["inputs"],
|
|
3291
3379
|
options?: AiOptions,
|
|
3292
3380
|
): Promise<BaseAiTranslation["postProcessedOutputs"]>;
|
|
3293
3381
|
run(
|
|
3294
|
-
model:
|
|
3382
|
+
model: BaseAiSummarizationModels,
|
|
3295
3383
|
inputs: BaseAiSummarization["inputs"],
|
|
3296
3384
|
options?: AiOptions,
|
|
3297
3385
|
): Promise<BaseAiSummarization["postProcessedOutputs"]>;
|
|
3298
3386
|
run(
|
|
3299
|
-
model:
|
|
3387
|
+
model: BaseAiImageToTextModels,
|
|
3300
3388
|
inputs: BaseAiImageToText["inputs"],
|
|
3301
3389
|
options?: AiOptions,
|
|
3302
3390
|
): Promise<BaseAiImageToText["postProcessedOutputs"]>;
|
|
@@ -4827,6 +4915,8 @@ export type WorkerVersionMetadata = {
|
|
|
4827
4915
|
id: string;
|
|
4828
4916
|
/** The tag of the Worker Version using this binding */
|
|
4829
4917
|
tag: string;
|
|
4918
|
+
/** The timestamp of when the Worker Version was uploaded */
|
|
4919
|
+
timestamp: string;
|
|
4830
4920
|
};
|
|
4831
4921
|
export interface DynamicDispatchLimits {
|
|
4832
4922
|
/**
|