@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/2021-11-03/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;
|
|
@@ -2986,6 +2987,53 @@ declare interface gpuGPUOrigin3DDict {
|
|
|
2986
2987
|
y?: number;
|
|
2987
2988
|
z?: number;
|
|
2988
2989
|
}
|
|
2990
|
+
declare class EventSource {
|
|
2991
|
+
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
2992
|
+
/**
|
|
2993
|
+
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
2994
|
+
*
|
|
2995
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
|
2996
|
+
*/
|
|
2997
|
+
close(): void;
|
|
2998
|
+
/**
|
|
2999
|
+
* Returns the URL providing the event stream.
|
|
3000
|
+
*
|
|
3001
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
|
3002
|
+
*/
|
|
3003
|
+
get url(): string;
|
|
3004
|
+
/**
|
|
3005
|
+
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
3006
|
+
*
|
|
3007
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
|
3008
|
+
*/
|
|
3009
|
+
get withCredentials(): boolean;
|
|
3010
|
+
/**
|
|
3011
|
+
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
3012
|
+
*
|
|
3013
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
|
3014
|
+
*/
|
|
3015
|
+
get readyState(): number;
|
|
3016
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3017
|
+
get onopen(): any | null;
|
|
3018
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3019
|
+
set onopen(value: any | null);
|
|
3020
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3021
|
+
get onmessage(): any | null;
|
|
3022
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3023
|
+
set onmessage(value: any | null);
|
|
3024
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3025
|
+
get onerror(): any | null;
|
|
3026
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3027
|
+
set onerror(value: any | null);
|
|
3028
|
+
static readonly CONNECTING: number;
|
|
3029
|
+
static readonly OPEN: number;
|
|
3030
|
+
static readonly CLOSED: number;
|
|
3031
|
+
static from(stream: ReadableStream): EventSource;
|
|
3032
|
+
}
|
|
3033
|
+
declare interface EventSourceEventSourceInit {
|
|
3034
|
+
withCredentials?: boolean;
|
|
3035
|
+
fetcher?: Fetcher;
|
|
3036
|
+
}
|
|
2989
3037
|
declare type AiImageClassificationInput = {
|
|
2990
3038
|
image: number[];
|
|
2991
3039
|
};
|
|
@@ -3002,6 +3050,12 @@ declare type AiImageToTextInput = {
|
|
|
3002
3050
|
prompt?: string;
|
|
3003
3051
|
max_tokens?: number;
|
|
3004
3052
|
temperature?: number;
|
|
3053
|
+
top_p?: number;
|
|
3054
|
+
top_k?: number;
|
|
3055
|
+
seed?: number;
|
|
3056
|
+
repetition_penalty?: number;
|
|
3057
|
+
frequency_penalty?: number;
|
|
3058
|
+
presence_penalty?: number;
|
|
3005
3059
|
raw?: boolean;
|
|
3006
3060
|
messages?: RoleScopedChatInput[];
|
|
3007
3061
|
};
|
|
@@ -3082,19 +3136,48 @@ declare abstract class BaseAiTextEmbeddings {
|
|
|
3082
3136
|
postProcessedOutputs: AiTextEmbeddingsOutput;
|
|
3083
3137
|
}
|
|
3084
3138
|
declare type RoleScopedChatInput = {
|
|
3085
|
-
role:
|
|
3139
|
+
role: "user" | "assistant" | "system" | "tool";
|
|
3086
3140
|
content: string;
|
|
3087
3141
|
};
|
|
3142
|
+
declare type AiTextGenerationToolInput = {
|
|
3143
|
+
type: "function";
|
|
3144
|
+
function: {
|
|
3145
|
+
name: string;
|
|
3146
|
+
description: string;
|
|
3147
|
+
parameters?: {
|
|
3148
|
+
type: "object";
|
|
3149
|
+
properties: {
|
|
3150
|
+
[key: string]: {
|
|
3151
|
+
type: string;
|
|
3152
|
+
description?: string;
|
|
3153
|
+
};
|
|
3154
|
+
};
|
|
3155
|
+
required: string[];
|
|
3156
|
+
};
|
|
3157
|
+
};
|
|
3158
|
+
};
|
|
3088
3159
|
declare type AiTextGenerationInput = {
|
|
3089
3160
|
prompt?: string;
|
|
3090
3161
|
raw?: boolean;
|
|
3091
3162
|
stream?: boolean;
|
|
3092
3163
|
max_tokens?: number;
|
|
3164
|
+
temperature?: number;
|
|
3165
|
+
top_p?: number;
|
|
3166
|
+
top_k?: number;
|
|
3167
|
+
seed?: number;
|
|
3168
|
+
repetition_penalty?: number;
|
|
3169
|
+
frequency_penalty?: number;
|
|
3170
|
+
presence_penalty?: number;
|
|
3093
3171
|
messages?: RoleScopedChatInput[];
|
|
3172
|
+
tools?: AiTextGenerationToolInput[];
|
|
3094
3173
|
};
|
|
3095
3174
|
declare type AiTextGenerationOutput =
|
|
3096
3175
|
| {
|
|
3097
3176
|
response?: string;
|
|
3177
|
+
tool_calls?: {
|
|
3178
|
+
name: string;
|
|
3179
|
+
arguments: unknown;
|
|
3180
|
+
}[];
|
|
3098
3181
|
}
|
|
3099
3182
|
| ReadableStream;
|
|
3100
3183
|
declare abstract class BaseAiTextGeneration {
|
|
@@ -3137,108 +3220,113 @@ declare type AiOptions = {
|
|
|
3137
3220
|
prefix?: string;
|
|
3138
3221
|
extraHeaders?: object;
|
|
3139
3222
|
};
|
|
3223
|
+
declare type BaseAiTextClassificationModels =
|
|
3224
|
+
"@cf/huggingface/distilbert-sst-2-int8";
|
|
3225
|
+
declare type BaseAiTextToImageModels =
|
|
3226
|
+
| "@cf/stabilityai/stable-diffusion-xl-base-1.0"
|
|
3227
|
+
| "@cf/runwayml/stable-diffusion-v1-5-inpainting"
|
|
3228
|
+
| "@cf/runwayml/stable-diffusion-v1-5-img2img"
|
|
3229
|
+
| "@cf/lykon/dreamshaper-8-lcm"
|
|
3230
|
+
| "@cf/bytedance/stable-diffusion-xl-lightning";
|
|
3231
|
+
declare type BaseAiTextEmbeddingsModels =
|
|
3232
|
+
| "@cf/baai/bge-small-en-v1.5"
|
|
3233
|
+
| "@cf/baai/bge-base-en-v1.5"
|
|
3234
|
+
| "@cf/baai/bge-large-en-v1.5";
|
|
3235
|
+
declare type BaseAiSpeechRecognitionModels =
|
|
3236
|
+
| "@cf/openai/whisper"
|
|
3237
|
+
| "@cf/openai/whisper-tiny-en"
|
|
3238
|
+
| "@cf/openai/whisper-sherpa";
|
|
3239
|
+
declare type BaseAiImageClassificationModels = "@cf/microsoft/resnet-50";
|
|
3240
|
+
declare type BaseAiObjectDetectionModels = "@cf/facebook/detr-resnet-50";
|
|
3241
|
+
declare type BaseAiTextGenerationModels =
|
|
3242
|
+
| "@cf/meta/llama-3-8b-instruct"
|
|
3243
|
+
| "@cf/meta/llama-3-8b-instruct-awq"
|
|
3244
|
+
| "@cf/meta/llama-2-7b-chat-int8"
|
|
3245
|
+
| "@cf/mistral/mistral-7b-instruct-v0.1"
|
|
3246
|
+
| "@cf/mistral/mistral-7b-instruct-v0.2-lora"
|
|
3247
|
+
| "@cf/meta/llama-2-7b-chat-fp16"
|
|
3248
|
+
| "@hf/thebloke/llama-2-13b-chat-awq"
|
|
3249
|
+
| "@hf/thebloke/zephyr-7b-beta-awq"
|
|
3250
|
+
| "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
|
|
3251
|
+
| "@hf/thebloke/codellama-7b-instruct-awq"
|
|
3252
|
+
| "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
|
|
3253
|
+
| "@hf/thebloke/neural-chat-7b-v3-1-awq"
|
|
3254
|
+
| "@hf/thebloke/llamaguard-7b-awq"
|
|
3255
|
+
| "@hf/thebloke/deepseek-coder-6.7b-base-awq"
|
|
3256
|
+
| "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
|
|
3257
|
+
| "@hf/nousresearch/hermes-2-pro-mistral-7b"
|
|
3258
|
+
| "@hf/mistral/mistral-7b-instruct-v0.2"
|
|
3259
|
+
| "@hf/google/gemma-7b-it"
|
|
3260
|
+
| "@hf/nexusflow/starling-lm-7b-beta"
|
|
3261
|
+
| "@cf/deepseek-ai/deepseek-math-7b-instruct"
|
|
3262
|
+
| "@cf/defog/sqlcoder-7b-2"
|
|
3263
|
+
| "@cf/openchat/openchat-3.5-0106"
|
|
3264
|
+
| "@cf/tiiuae/falcon-7b-instruct"
|
|
3265
|
+
| "@cf/thebloke/discolm-german-7b-v1-awq"
|
|
3266
|
+
| "@cf/qwen/qwen1.5-0.5b-chat"
|
|
3267
|
+
| "@cf/qwen/qwen1.5-1.8b-chat"
|
|
3268
|
+
| "@cf/qwen/qwen1.5-7b-chat-awq"
|
|
3269
|
+
| "@cf/qwen/qwen1.5-14b-chat-awq"
|
|
3270
|
+
| "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
|
|
3271
|
+
| "@cf/microsoft/phi-2"
|
|
3272
|
+
| "@cf/google/gemma-2b-it-lora"
|
|
3273
|
+
| "@cf/google/gemma-7b-it-lora"
|
|
3274
|
+
| "@cf/meta-llama/llama-2-7b-chat-hf-lora"
|
|
3275
|
+
| "@cf/fblgit/una-cybertron-7b-v2-bf16"
|
|
3276
|
+
| "@cf/fblgit/una-cybertron-7b-v2-awq";
|
|
3277
|
+
declare type BaseAiTranslationModels = "@cf/meta/m2m100-1.2b";
|
|
3278
|
+
declare type BaseAiSummarizationModels = "@cf/facebook/bart-large-cnn";
|
|
3279
|
+
declare type BaseAiImageToTextModels =
|
|
3280
|
+
| "@cf/unum/uform-gen2-qwen-500m"
|
|
3281
|
+
| "@cf/llava-hf/llava-1.5-7b-hf";
|
|
3140
3282
|
declare abstract class Ai {
|
|
3141
3283
|
run(
|
|
3142
|
-
model:
|
|
3143
|
-
| "@cf/huggingface/distilbert-sst-2-int8"
|
|
3144
|
-
| "@cf/jpmorganchase/roberta-spam"
|
|
3145
|
-
| "@cf/inml/inml-roberta-dga",
|
|
3284
|
+
model: BaseAiTextClassificationModels,
|
|
3146
3285
|
inputs: BaseAiTextClassification["inputs"],
|
|
3147
3286
|
options?: AiOptions,
|
|
3148
3287
|
): Promise<BaseAiTextClassification["postProcessedOutputs"]>;
|
|
3149
3288
|
run(
|
|
3150
|
-
model:
|
|
3151
|
-
| "@cf/stabilityai/stable-diffusion-xl-base-1.0"
|
|
3152
|
-
| "@cf/runwayml/stable-diffusion-v1-5-inpainting"
|
|
3153
|
-
| "@cf/runwayml/stable-diffusion-v1-5-img2img"
|
|
3154
|
-
| "@cf/lykon/dreamshaper-8-lcm"
|
|
3155
|
-
| "@cf/bytedance/stable-diffusion-xl-lightning",
|
|
3289
|
+
model: BaseAiTextToImageModels,
|
|
3156
3290
|
inputs: BaseAiTextToImage["inputs"],
|
|
3157
3291
|
options?: AiOptions,
|
|
3158
3292
|
): Promise<BaseAiTextToImage["postProcessedOutputs"]>;
|
|
3159
3293
|
run(
|
|
3160
|
-
model:
|
|
3161
|
-
inputs: BaseAiSentenceSimilarity["inputs"],
|
|
3162
|
-
options?: AiOptions,
|
|
3163
|
-
): Promise<BaseAiSentenceSimilarity["postProcessedOutputs"]>;
|
|
3164
|
-
run(
|
|
3165
|
-
model:
|
|
3166
|
-
| "@cf/baai/bge-small-en-v1.5"
|
|
3167
|
-
| "@cf/baai/bge-base-en-v1.5"
|
|
3168
|
-
| "@cf/baai/bge-large-en-v1.5",
|
|
3294
|
+
model: BaseAiTextEmbeddingsModels,
|
|
3169
3295
|
inputs: BaseAiTextEmbeddings["inputs"],
|
|
3170
3296
|
options?: AiOptions,
|
|
3171
3297
|
): Promise<BaseAiTextEmbeddings["postProcessedOutputs"]>;
|
|
3172
3298
|
run(
|
|
3173
|
-
model:
|
|
3174
|
-
| "@cf/openai/whisper"
|
|
3175
|
-
| "@cf/openai/whisper-tiny-en"
|
|
3176
|
-
| "@cf/openai/whisper-sherpa",
|
|
3299
|
+
model: BaseAiSpeechRecognitionModels,
|
|
3177
3300
|
inputs: BaseAiSpeechRecognition["inputs"],
|
|
3178
3301
|
options?: AiOptions,
|
|
3179
3302
|
): Promise<BaseAiSpeechRecognition["postProcessedOutputs"]>;
|
|
3180
3303
|
run(
|
|
3181
|
-
model:
|
|
3304
|
+
model: BaseAiImageClassificationModels,
|
|
3182
3305
|
inputs: BaseAiImageClassification["inputs"],
|
|
3183
3306
|
options?: AiOptions,
|
|
3184
3307
|
): Promise<BaseAiImageClassification["postProcessedOutputs"]>;
|
|
3185
3308
|
run(
|
|
3186
|
-
model:
|
|
3309
|
+
model: BaseAiObjectDetectionModels,
|
|
3187
3310
|
inputs: BaseAiObjectDetection["inputs"],
|
|
3188
3311
|
options?: AiOptions,
|
|
3189
3312
|
): Promise<BaseAiObjectDetection["postProcessedOutputs"]>;
|
|
3190
3313
|
run(
|
|
3191
|
-
model:
|
|
3192
|
-
| "@cf/meta/llama-3-8b-instruct"
|
|
3193
|
-
| "@cf/meta/llama-2-7b-chat-int8"
|
|
3194
|
-
| "@cf/mistral/mistral-7b-instruct-v0.1"
|
|
3195
|
-
| "@cf/mistral/mistral-7b-instruct-v0.1-vllm"
|
|
3196
|
-
| "@cf/mistral/mistral-7b-instruct-v0.2-lora"
|
|
3197
|
-
| "@cf/meta/llama-2-7b-chat-fp16"
|
|
3198
|
-
| "@hf/thebloke/llama-2-13b-chat-awq"
|
|
3199
|
-
| "@hf/thebloke/zephyr-7b-beta-awq"
|
|
3200
|
-
| "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
|
|
3201
|
-
| "@hf/thebloke/codellama-7b-instruct-awq"
|
|
3202
|
-
| "@hf/thebloke/openchat_3.5-awq"
|
|
3203
|
-
| "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
|
|
3204
|
-
| "@hf/thebloke/neural-chat-7b-v3-1-awq"
|
|
3205
|
-
| "@hf/thebloke/llamaguard-7b-awq"
|
|
3206
|
-
| "@hf/thebloke/deepseek-coder-6.7b-base-awq"
|
|
3207
|
-
| "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
|
|
3208
|
-
| "@hf/nousresearch/hermes-2-pro-mistral-7b"
|
|
3209
|
-
| "@hf/mistral/mistral-7b-instruct-v0.2"
|
|
3210
|
-
| "@cf/mistral/mixtral-8x7b-instruct-v0.1-awq"
|
|
3211
|
-
| "@hf/google/gemma-7b-it"
|
|
3212
|
-
| "@hf/nexusflow/starling-lm-7b-beta"
|
|
3213
|
-
| "@cf/deepseek-ai/deepseek-math-7b-instruct"
|
|
3214
|
-
| "@cf/defog/sqlcoder-7b-2"
|
|
3215
|
-
| "@cf/openchat/openchat-3.5-0106"
|
|
3216
|
-
| "@cf/tiiuae/falcon-7b-instruct"
|
|
3217
|
-
| "@cf/thebloke/discolm-german-7b-v1-awq"
|
|
3218
|
-
| "@cf/qwen/qwen1.5-0.5b-chat"
|
|
3219
|
-
| "@cf/qwen/qwen1.5-1.8b-chat"
|
|
3220
|
-
| "@cf/qwen/qwen1.5-7b-chat-awq"
|
|
3221
|
-
| "@cf/qwen/qwen1.5-14b-chat-awq"
|
|
3222
|
-
| "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
|
|
3223
|
-
| "@cf/microsoft/phi-2"
|
|
3224
|
-
| "@cf/google/gemma-2b-it-lora"
|
|
3225
|
-
| "@cf/google/gemma-7b-it-lora"
|
|
3226
|
-
| "@cf/meta-llama/llama-2-7b-chat-hf-lora",
|
|
3314
|
+
model: BaseAiTextGenerationModels,
|
|
3227
3315
|
inputs: BaseAiTextGeneration["inputs"],
|
|
3228
3316
|
options?: AiOptions,
|
|
3229
3317
|
): Promise<BaseAiTextGeneration["postProcessedOutputs"]>;
|
|
3230
3318
|
run(
|
|
3231
|
-
model:
|
|
3319
|
+
model: BaseAiTranslationModels,
|
|
3232
3320
|
inputs: BaseAiTranslation["inputs"],
|
|
3233
3321
|
options?: AiOptions,
|
|
3234
3322
|
): Promise<BaseAiTranslation["postProcessedOutputs"]>;
|
|
3235
3323
|
run(
|
|
3236
|
-
model:
|
|
3324
|
+
model: BaseAiSummarizationModels,
|
|
3237
3325
|
inputs: BaseAiSummarization["inputs"],
|
|
3238
3326
|
options?: AiOptions,
|
|
3239
3327
|
): Promise<BaseAiSummarization["postProcessedOutputs"]>;
|
|
3240
3328
|
run(
|
|
3241
|
-
model:
|
|
3329
|
+
model: BaseAiImageToTextModels,
|
|
3242
3330
|
inputs: BaseAiImageToText["inputs"],
|
|
3243
3331
|
options?: AiOptions,
|
|
3244
3332
|
): Promise<BaseAiImageToText["postProcessedOutputs"]>;
|
|
@@ -4835,6 +4923,8 @@ declare type WorkerVersionMetadata = {
|
|
|
4835
4923
|
id: string;
|
|
4836
4924
|
/** The tag of the Worker Version using this binding */
|
|
4837
4925
|
tag: string;
|
|
4926
|
+
/** The timestamp of when the Worker Version was uploaded */
|
|
4927
|
+
timestamp: string;
|
|
4838
4928
|
};
|
|
4839
4929
|
declare interface DynamicDispatchLimits {
|
|
4840
4930
|
/**
|
package/2021-11-03/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;
|
|
@@ -2991,6 +2992,53 @@ export interface gpuGPUOrigin3DDict {
|
|
|
2991
2992
|
y?: number;
|
|
2992
2993
|
z?: number;
|
|
2993
2994
|
}
|
|
2995
|
+
export declare class EventSource {
|
|
2996
|
+
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
2997
|
+
/**
|
|
2998
|
+
* Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
|
|
2999
|
+
*
|
|
3000
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
|
3001
|
+
*/
|
|
3002
|
+
close(): void;
|
|
3003
|
+
/**
|
|
3004
|
+
* Returns the URL providing the event stream.
|
|
3005
|
+
*
|
|
3006
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
|
3007
|
+
*/
|
|
3008
|
+
get url(): string;
|
|
3009
|
+
/**
|
|
3010
|
+
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
3011
|
+
*
|
|
3012
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
|
3013
|
+
*/
|
|
3014
|
+
get withCredentials(): boolean;
|
|
3015
|
+
/**
|
|
3016
|
+
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
3017
|
+
*
|
|
3018
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
|
3019
|
+
*/
|
|
3020
|
+
get readyState(): number;
|
|
3021
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3022
|
+
get onopen(): any | null;
|
|
3023
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3024
|
+
set onopen(value: any | null);
|
|
3025
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3026
|
+
get onmessage(): any | null;
|
|
3027
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3028
|
+
set onmessage(value: any | null);
|
|
3029
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3030
|
+
get onerror(): any | null;
|
|
3031
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3032
|
+
set onerror(value: any | null);
|
|
3033
|
+
static readonly CONNECTING: number;
|
|
3034
|
+
static readonly OPEN: number;
|
|
3035
|
+
static readonly CLOSED: number;
|
|
3036
|
+
static from(stream: ReadableStream): EventSource;
|
|
3037
|
+
}
|
|
3038
|
+
export interface EventSourceEventSourceInit {
|
|
3039
|
+
withCredentials?: boolean;
|
|
3040
|
+
fetcher?: Fetcher;
|
|
3041
|
+
}
|
|
2994
3042
|
export type AiImageClassificationInput = {
|
|
2995
3043
|
image: number[];
|
|
2996
3044
|
};
|
|
@@ -3007,6 +3055,12 @@ export type AiImageToTextInput = {
|
|
|
3007
3055
|
prompt?: string;
|
|
3008
3056
|
max_tokens?: number;
|
|
3009
3057
|
temperature?: number;
|
|
3058
|
+
top_p?: number;
|
|
3059
|
+
top_k?: number;
|
|
3060
|
+
seed?: number;
|
|
3061
|
+
repetition_penalty?: number;
|
|
3062
|
+
frequency_penalty?: number;
|
|
3063
|
+
presence_penalty?: number;
|
|
3010
3064
|
raw?: boolean;
|
|
3011
3065
|
messages?: RoleScopedChatInput[];
|
|
3012
3066
|
};
|
|
@@ -3087,19 +3141,48 @@ export declare abstract class BaseAiTextEmbeddings {
|
|
|
3087
3141
|
postProcessedOutputs: AiTextEmbeddingsOutput;
|
|
3088
3142
|
}
|
|
3089
3143
|
export type RoleScopedChatInput = {
|
|
3090
|
-
role:
|
|
3144
|
+
role: "user" | "assistant" | "system" | "tool";
|
|
3091
3145
|
content: string;
|
|
3092
3146
|
};
|
|
3147
|
+
export type AiTextGenerationToolInput = {
|
|
3148
|
+
type: "function";
|
|
3149
|
+
function: {
|
|
3150
|
+
name: string;
|
|
3151
|
+
description: string;
|
|
3152
|
+
parameters?: {
|
|
3153
|
+
type: "object";
|
|
3154
|
+
properties: {
|
|
3155
|
+
[key: string]: {
|
|
3156
|
+
type: string;
|
|
3157
|
+
description?: string;
|
|
3158
|
+
};
|
|
3159
|
+
};
|
|
3160
|
+
required: string[];
|
|
3161
|
+
};
|
|
3162
|
+
};
|
|
3163
|
+
};
|
|
3093
3164
|
export type AiTextGenerationInput = {
|
|
3094
3165
|
prompt?: string;
|
|
3095
3166
|
raw?: boolean;
|
|
3096
3167
|
stream?: boolean;
|
|
3097
3168
|
max_tokens?: number;
|
|
3169
|
+
temperature?: number;
|
|
3170
|
+
top_p?: number;
|
|
3171
|
+
top_k?: number;
|
|
3172
|
+
seed?: number;
|
|
3173
|
+
repetition_penalty?: number;
|
|
3174
|
+
frequency_penalty?: number;
|
|
3175
|
+
presence_penalty?: number;
|
|
3098
3176
|
messages?: RoleScopedChatInput[];
|
|
3177
|
+
tools?: AiTextGenerationToolInput[];
|
|
3099
3178
|
};
|
|
3100
3179
|
export type AiTextGenerationOutput =
|
|
3101
3180
|
| {
|
|
3102
3181
|
response?: string;
|
|
3182
|
+
tool_calls?: {
|
|
3183
|
+
name: string;
|
|
3184
|
+
arguments: unknown;
|
|
3185
|
+
}[];
|
|
3103
3186
|
}
|
|
3104
3187
|
| ReadableStream;
|
|
3105
3188
|
export declare abstract class BaseAiTextGeneration {
|
|
@@ -3142,108 +3225,113 @@ export type AiOptions = {
|
|
|
3142
3225
|
prefix?: string;
|
|
3143
3226
|
extraHeaders?: object;
|
|
3144
3227
|
};
|
|
3228
|
+
export type BaseAiTextClassificationModels =
|
|
3229
|
+
"@cf/huggingface/distilbert-sst-2-int8";
|
|
3230
|
+
export type BaseAiTextToImageModels =
|
|
3231
|
+
| "@cf/stabilityai/stable-diffusion-xl-base-1.0"
|
|
3232
|
+
| "@cf/runwayml/stable-diffusion-v1-5-inpainting"
|
|
3233
|
+
| "@cf/runwayml/stable-diffusion-v1-5-img2img"
|
|
3234
|
+
| "@cf/lykon/dreamshaper-8-lcm"
|
|
3235
|
+
| "@cf/bytedance/stable-diffusion-xl-lightning";
|
|
3236
|
+
export type BaseAiTextEmbeddingsModels =
|
|
3237
|
+
| "@cf/baai/bge-small-en-v1.5"
|
|
3238
|
+
| "@cf/baai/bge-base-en-v1.5"
|
|
3239
|
+
| "@cf/baai/bge-large-en-v1.5";
|
|
3240
|
+
export type BaseAiSpeechRecognitionModels =
|
|
3241
|
+
| "@cf/openai/whisper"
|
|
3242
|
+
| "@cf/openai/whisper-tiny-en"
|
|
3243
|
+
| "@cf/openai/whisper-sherpa";
|
|
3244
|
+
export type BaseAiImageClassificationModels = "@cf/microsoft/resnet-50";
|
|
3245
|
+
export type BaseAiObjectDetectionModels = "@cf/facebook/detr-resnet-50";
|
|
3246
|
+
export type BaseAiTextGenerationModels =
|
|
3247
|
+
| "@cf/meta/llama-3-8b-instruct"
|
|
3248
|
+
| "@cf/meta/llama-3-8b-instruct-awq"
|
|
3249
|
+
| "@cf/meta/llama-2-7b-chat-int8"
|
|
3250
|
+
| "@cf/mistral/mistral-7b-instruct-v0.1"
|
|
3251
|
+
| "@cf/mistral/mistral-7b-instruct-v0.2-lora"
|
|
3252
|
+
| "@cf/meta/llama-2-7b-chat-fp16"
|
|
3253
|
+
| "@hf/thebloke/llama-2-13b-chat-awq"
|
|
3254
|
+
| "@hf/thebloke/zephyr-7b-beta-awq"
|
|
3255
|
+
| "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
|
|
3256
|
+
| "@hf/thebloke/codellama-7b-instruct-awq"
|
|
3257
|
+
| "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
|
|
3258
|
+
| "@hf/thebloke/neural-chat-7b-v3-1-awq"
|
|
3259
|
+
| "@hf/thebloke/llamaguard-7b-awq"
|
|
3260
|
+
| "@hf/thebloke/deepseek-coder-6.7b-base-awq"
|
|
3261
|
+
| "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
|
|
3262
|
+
| "@hf/nousresearch/hermes-2-pro-mistral-7b"
|
|
3263
|
+
| "@hf/mistral/mistral-7b-instruct-v0.2"
|
|
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"
|
|
3280
|
+
| "@cf/fblgit/una-cybertron-7b-v2-bf16"
|
|
3281
|
+
| "@cf/fblgit/una-cybertron-7b-v2-awq";
|
|
3282
|
+
export type BaseAiTranslationModels = "@cf/meta/m2m100-1.2b";
|
|
3283
|
+
export type BaseAiSummarizationModels = "@cf/facebook/bart-large-cnn";
|
|
3284
|
+
export type BaseAiImageToTextModels =
|
|
3285
|
+
| "@cf/unum/uform-gen2-qwen-500m"
|
|
3286
|
+
| "@cf/llava-hf/llava-1.5-7b-hf";
|
|
3145
3287
|
export declare abstract class Ai {
|
|
3146
3288
|
run(
|
|
3147
|
-
model:
|
|
3148
|
-
| "@cf/huggingface/distilbert-sst-2-int8"
|
|
3149
|
-
| "@cf/jpmorganchase/roberta-spam"
|
|
3150
|
-
| "@cf/inml/inml-roberta-dga",
|
|
3289
|
+
model: BaseAiTextClassificationModels,
|
|
3151
3290
|
inputs: BaseAiTextClassification["inputs"],
|
|
3152
3291
|
options?: AiOptions,
|
|
3153
3292
|
): Promise<BaseAiTextClassification["postProcessedOutputs"]>;
|
|
3154
3293
|
run(
|
|
3155
|
-
model:
|
|
3156
|
-
| "@cf/stabilityai/stable-diffusion-xl-base-1.0"
|
|
3157
|
-
| "@cf/runwayml/stable-diffusion-v1-5-inpainting"
|
|
3158
|
-
| "@cf/runwayml/stable-diffusion-v1-5-img2img"
|
|
3159
|
-
| "@cf/lykon/dreamshaper-8-lcm"
|
|
3160
|
-
| "@cf/bytedance/stable-diffusion-xl-lightning",
|
|
3294
|
+
model: BaseAiTextToImageModels,
|
|
3161
3295
|
inputs: BaseAiTextToImage["inputs"],
|
|
3162
3296
|
options?: AiOptions,
|
|
3163
3297
|
): Promise<BaseAiTextToImage["postProcessedOutputs"]>;
|
|
3164
3298
|
run(
|
|
3165
|
-
model:
|
|
3166
|
-
inputs: BaseAiSentenceSimilarity["inputs"],
|
|
3167
|
-
options?: AiOptions,
|
|
3168
|
-
): Promise<BaseAiSentenceSimilarity["postProcessedOutputs"]>;
|
|
3169
|
-
run(
|
|
3170
|
-
model:
|
|
3171
|
-
| "@cf/baai/bge-small-en-v1.5"
|
|
3172
|
-
| "@cf/baai/bge-base-en-v1.5"
|
|
3173
|
-
| "@cf/baai/bge-large-en-v1.5",
|
|
3299
|
+
model: BaseAiTextEmbeddingsModels,
|
|
3174
3300
|
inputs: BaseAiTextEmbeddings["inputs"],
|
|
3175
3301
|
options?: AiOptions,
|
|
3176
3302
|
): Promise<BaseAiTextEmbeddings["postProcessedOutputs"]>;
|
|
3177
3303
|
run(
|
|
3178
|
-
model:
|
|
3179
|
-
| "@cf/openai/whisper"
|
|
3180
|
-
| "@cf/openai/whisper-tiny-en"
|
|
3181
|
-
| "@cf/openai/whisper-sherpa",
|
|
3304
|
+
model: BaseAiSpeechRecognitionModels,
|
|
3182
3305
|
inputs: BaseAiSpeechRecognition["inputs"],
|
|
3183
3306
|
options?: AiOptions,
|
|
3184
3307
|
): Promise<BaseAiSpeechRecognition["postProcessedOutputs"]>;
|
|
3185
3308
|
run(
|
|
3186
|
-
model:
|
|
3309
|
+
model: BaseAiImageClassificationModels,
|
|
3187
3310
|
inputs: BaseAiImageClassification["inputs"],
|
|
3188
3311
|
options?: AiOptions,
|
|
3189
3312
|
): Promise<BaseAiImageClassification["postProcessedOutputs"]>;
|
|
3190
3313
|
run(
|
|
3191
|
-
model:
|
|
3314
|
+
model: BaseAiObjectDetectionModels,
|
|
3192
3315
|
inputs: BaseAiObjectDetection["inputs"],
|
|
3193
3316
|
options?: AiOptions,
|
|
3194
3317
|
): Promise<BaseAiObjectDetection["postProcessedOutputs"]>;
|
|
3195
3318
|
run(
|
|
3196
|
-
model:
|
|
3197
|
-
| "@cf/meta/llama-3-8b-instruct"
|
|
3198
|
-
| "@cf/meta/llama-2-7b-chat-int8"
|
|
3199
|
-
| "@cf/mistral/mistral-7b-instruct-v0.1"
|
|
3200
|
-
| "@cf/mistral/mistral-7b-instruct-v0.1-vllm"
|
|
3201
|
-
| "@cf/mistral/mistral-7b-instruct-v0.2-lora"
|
|
3202
|
-
| "@cf/meta/llama-2-7b-chat-fp16"
|
|
3203
|
-
| "@hf/thebloke/llama-2-13b-chat-awq"
|
|
3204
|
-
| "@hf/thebloke/zephyr-7b-beta-awq"
|
|
3205
|
-
| "@hf/thebloke/mistral-7b-instruct-v0.1-awq"
|
|
3206
|
-
| "@hf/thebloke/codellama-7b-instruct-awq"
|
|
3207
|
-
| "@hf/thebloke/openchat_3.5-awq"
|
|
3208
|
-
| "@hf/thebloke/openhermes-2.5-mistral-7b-awq"
|
|
3209
|
-
| "@hf/thebloke/neural-chat-7b-v3-1-awq"
|
|
3210
|
-
| "@hf/thebloke/llamaguard-7b-awq"
|
|
3211
|
-
| "@hf/thebloke/deepseek-coder-6.7b-base-awq"
|
|
3212
|
-
| "@hf/thebloke/deepseek-coder-6.7b-instruct-awq"
|
|
3213
|
-
| "@hf/nousresearch/hermes-2-pro-mistral-7b"
|
|
3214
|
-
| "@hf/mistral/mistral-7b-instruct-v0.2"
|
|
3215
|
-
| "@cf/mistral/mixtral-8x7b-instruct-v0.1-awq"
|
|
3216
|
-
| "@hf/google/gemma-7b-it"
|
|
3217
|
-
| "@hf/nexusflow/starling-lm-7b-beta"
|
|
3218
|
-
| "@cf/deepseek-ai/deepseek-math-7b-instruct"
|
|
3219
|
-
| "@cf/defog/sqlcoder-7b-2"
|
|
3220
|
-
| "@cf/openchat/openchat-3.5-0106"
|
|
3221
|
-
| "@cf/tiiuae/falcon-7b-instruct"
|
|
3222
|
-
| "@cf/thebloke/discolm-german-7b-v1-awq"
|
|
3223
|
-
| "@cf/qwen/qwen1.5-0.5b-chat"
|
|
3224
|
-
| "@cf/qwen/qwen1.5-1.8b-chat"
|
|
3225
|
-
| "@cf/qwen/qwen1.5-7b-chat-awq"
|
|
3226
|
-
| "@cf/qwen/qwen1.5-14b-chat-awq"
|
|
3227
|
-
| "@cf/tinyllama/tinyllama-1.1b-chat-v1.0"
|
|
3228
|
-
| "@cf/microsoft/phi-2"
|
|
3229
|
-
| "@cf/google/gemma-2b-it-lora"
|
|
3230
|
-
| "@cf/google/gemma-7b-it-lora"
|
|
3231
|
-
| "@cf/meta-llama/llama-2-7b-chat-hf-lora",
|
|
3319
|
+
model: BaseAiTextGenerationModels,
|
|
3232
3320
|
inputs: BaseAiTextGeneration["inputs"],
|
|
3233
3321
|
options?: AiOptions,
|
|
3234
3322
|
): Promise<BaseAiTextGeneration["postProcessedOutputs"]>;
|
|
3235
3323
|
run(
|
|
3236
|
-
model:
|
|
3324
|
+
model: BaseAiTranslationModels,
|
|
3237
3325
|
inputs: BaseAiTranslation["inputs"],
|
|
3238
3326
|
options?: AiOptions,
|
|
3239
3327
|
): Promise<BaseAiTranslation["postProcessedOutputs"]>;
|
|
3240
3328
|
run(
|
|
3241
|
-
model:
|
|
3329
|
+
model: BaseAiSummarizationModels,
|
|
3242
3330
|
inputs: BaseAiSummarization["inputs"],
|
|
3243
3331
|
options?: AiOptions,
|
|
3244
3332
|
): Promise<BaseAiSummarization["postProcessedOutputs"]>;
|
|
3245
3333
|
run(
|
|
3246
|
-
model:
|
|
3334
|
+
model: BaseAiImageToTextModels,
|
|
3247
3335
|
inputs: BaseAiImageToText["inputs"],
|
|
3248
3336
|
options?: AiOptions,
|
|
3249
3337
|
): Promise<BaseAiImageToText["postProcessedOutputs"]>;
|
|
@@ -4774,6 +4862,8 @@ export type WorkerVersionMetadata = {
|
|
|
4774
4862
|
id: string;
|
|
4775
4863
|
/** The tag of the Worker Version using this binding */
|
|
4776
4864
|
tag: string;
|
|
4865
|
+
/** The timestamp of when the Worker Version was uploaded */
|
|
4866
|
+
timestamp: string;
|
|
4777
4867
|
};
|
|
4778
4868
|
export interface DynamicDispatchLimits {
|
|
4779
4869
|
/**
|