@cloudflare/workers-types 4.20250124.3 → 4.20250204.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 +92 -5
- package/2021-11-03/index.ts +92 -5
- package/2022-01-31/index.d.ts +92 -5
- package/2022-01-31/index.ts +92 -5
- package/2022-03-21/index.d.ts +92 -5
- package/2022-03-21/index.ts +92 -5
- package/2022-08-04/index.d.ts +92 -5
- package/2022-08-04/index.ts +92 -5
- package/2022-10-31/index.d.ts +92 -5
- package/2022-10-31/index.ts +92 -5
- package/2022-11-30/index.d.ts +92 -5
- package/2022-11-30/index.ts +92 -5
- package/2023-03-01/index.d.ts +92 -5
- package/2023-03-01/index.ts +92 -5
- package/2023-07-01/index.d.ts +92 -5
- package/2023-07-01/index.ts +92 -5
- package/experimental/index.d.ts +92 -5
- package/experimental/index.ts +92 -5
- package/index.d.ts +92 -5
- package/index.ts +92 -5
- package/oldest/index.d.ts +92 -5
- package/oldest/index.ts +92 -5
- package/package.json +1 -1
package/2021-11-03/index.d.ts
CHANGED
|
@@ -538,6 +538,7 @@ interface DurableObjectState {
|
|
|
538
538
|
waitUntil(promise: Promise<any>): void;
|
|
539
539
|
readonly id: DurableObjectId;
|
|
540
540
|
readonly storage: DurableObjectStorage;
|
|
541
|
+
container?: Container;
|
|
541
542
|
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
|
|
542
543
|
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
|
|
543
544
|
getWebSockets(tag?: string): WebSocket[];
|
|
@@ -3401,6 +3402,18 @@ interface EventSourceEventSourceInit {
|
|
|
3401
3402
|
withCredentials?: boolean;
|
|
3402
3403
|
fetcher?: Fetcher;
|
|
3403
3404
|
}
|
|
3405
|
+
interface Container {
|
|
3406
|
+
get running(): boolean;
|
|
3407
|
+
start(options?: ContainerStartupOptions): void;
|
|
3408
|
+
monitor(): Promise<void>;
|
|
3409
|
+
destroy(error?: any): Promise<void>;
|
|
3410
|
+
signal(signo: number): void;
|
|
3411
|
+
getTcpPort(port: number): Fetcher;
|
|
3412
|
+
}
|
|
3413
|
+
interface ContainerStartupOptions {
|
|
3414
|
+
entrypoint?: string[];
|
|
3415
|
+
enableInternet: boolean;
|
|
3416
|
+
}
|
|
3404
3417
|
type AiImageClassificationInput = {
|
|
3405
3418
|
image: number[];
|
|
3406
3419
|
};
|
|
@@ -3653,6 +3666,54 @@ declare abstract class Base_Ai_Cf_Openai_Whisper {
|
|
|
3653
3666
|
inputs: Ai_Cf_Openai_Whisper_Input;
|
|
3654
3667
|
postProcessedOutputs: Ai_Cf_Openai_Whisper_Output;
|
|
3655
3668
|
}
|
|
3669
|
+
type Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input =
|
|
3670
|
+
| string
|
|
3671
|
+
| {
|
|
3672
|
+
/**
|
|
3673
|
+
* The input text prompt for the model to generate a response.
|
|
3674
|
+
*/
|
|
3675
|
+
prompt?: string;
|
|
3676
|
+
/**
|
|
3677
|
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
|
|
3678
|
+
*/
|
|
3679
|
+
raw?: boolean;
|
|
3680
|
+
/**
|
|
3681
|
+
* Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
|
|
3682
|
+
*/
|
|
3683
|
+
top_p?: number;
|
|
3684
|
+
/**
|
|
3685
|
+
* 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.
|
|
3686
|
+
*/
|
|
3687
|
+
top_k?: number;
|
|
3688
|
+
/**
|
|
3689
|
+
* Random seed for reproducibility of the generation.
|
|
3690
|
+
*/
|
|
3691
|
+
seed?: number;
|
|
3692
|
+
/**
|
|
3693
|
+
* Penalty for repeated tokens; higher values discourage repetition.
|
|
3694
|
+
*/
|
|
3695
|
+
repetition_penalty?: number;
|
|
3696
|
+
/**
|
|
3697
|
+
* Decreases the likelihood of the model repeating the same lines verbatim.
|
|
3698
|
+
*/
|
|
3699
|
+
frequency_penalty?: number;
|
|
3700
|
+
/**
|
|
3701
|
+
* Increases the likelihood of the model introducing new topics.
|
|
3702
|
+
*/
|
|
3703
|
+
presence_penalty?: number;
|
|
3704
|
+
image: number[] | (string & NonNullable<unknown>);
|
|
3705
|
+
/**
|
|
3706
|
+
* The maximum number of tokens to generate in the response.
|
|
3707
|
+
*/
|
|
3708
|
+
max_tokens?: number;
|
|
3709
|
+
};
|
|
3710
|
+
interface Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output {
|
|
3711
|
+
description?: string;
|
|
3712
|
+
}
|
|
3713
|
+
declare abstract class Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M {
|
|
3714
|
+
inputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input;
|
|
3715
|
+
postProcessedOutputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output;
|
|
3716
|
+
}
|
|
3656
3717
|
type Ai_Cf_Openai_Whisper_Tiny_En_Input =
|
|
3657
3718
|
| string
|
|
3658
3719
|
| {
|
|
@@ -4085,11 +4146,12 @@ interface AiModels {
|
|
|
4085
4146
|
"@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
|
|
4086
4147
|
"@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;
|
|
4087
4148
|
"@cf/meta/llama-3.3-70b-instruct-fp8-fast": BaseAiTextGeneration;
|
|
4149
|
+
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": BaseAiTextGeneration;
|
|
4088
4150
|
"@cf/meta/m2m100-1.2b": BaseAiTranslation;
|
|
4089
4151
|
"@cf/facebook/bart-large-cnn": BaseAiSummarization;
|
|
4090
|
-
"@cf/unum/uform-gen2-qwen-500m": BaseAiImageToText;
|
|
4091
4152
|
"@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;
|
|
4092
4153
|
"@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper;
|
|
4154
|
+
"@cf/unum/uform-gen2-qwen-500m": Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M;
|
|
4093
4155
|
"@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
|
|
4094
4156
|
"@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
|
|
4095
4157
|
"@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
|
|
@@ -4097,6 +4159,7 @@ interface AiModels {
|
|
|
4097
4159
|
}
|
|
4098
4160
|
type AiOptions = {
|
|
4099
4161
|
gateway?: GatewayOptions;
|
|
4162
|
+
returnRawResponse?: boolean;
|
|
4100
4163
|
prefix?: string;
|
|
4101
4164
|
extraHeaders?: object;
|
|
4102
4165
|
};
|
|
@@ -4131,11 +4194,17 @@ type AiModelListType = Record<string, any>;
|
|
|
4131
4194
|
declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
|
|
4132
4195
|
aiGatewayLogId: string | null;
|
|
4133
4196
|
gateway(gatewayId: string): AiGateway;
|
|
4134
|
-
run<Name extends keyof AiModelList>(
|
|
4197
|
+
run<Name extends keyof AiModelList, Options extends AiOptions>(
|
|
4135
4198
|
model: Name,
|
|
4136
4199
|
inputs: AiModelList[Name]["inputs"],
|
|
4137
|
-
options?:
|
|
4138
|
-
): Promise<
|
|
4200
|
+
options?: Options,
|
|
4201
|
+
): Promise<
|
|
4202
|
+
Options extends {
|
|
4203
|
+
returnRawResponse: true;
|
|
4204
|
+
}
|
|
4205
|
+
? Response
|
|
4206
|
+
: AiModelList[Name]["postProcessedOutputs"]
|
|
4207
|
+
>;
|
|
4139
4208
|
public models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
|
|
4140
4209
|
}
|
|
4141
4210
|
type GatewayOptions = {
|
|
@@ -5428,6 +5497,14 @@ type ImageTransform = {
|
|
|
5428
5497
|
};
|
|
5429
5498
|
zoom?: number;
|
|
5430
5499
|
};
|
|
5500
|
+
type ImageDrawOptions = {
|
|
5501
|
+
opacity?: number;
|
|
5502
|
+
repeat?: boolean | string;
|
|
5503
|
+
top?: number;
|
|
5504
|
+
left?: number;
|
|
5505
|
+
bottom?: number;
|
|
5506
|
+
right?: number;
|
|
5507
|
+
};
|
|
5431
5508
|
type ImageOutputOptions = {
|
|
5432
5509
|
format:
|
|
5433
5510
|
| "image/jpeg"
|
|
@@ -5457,10 +5534,20 @@ interface ImagesBinding {
|
|
|
5457
5534
|
interface ImageTransformer {
|
|
5458
5535
|
/**
|
|
5459
5536
|
* Apply transform next, returning a transform handle.
|
|
5460
|
-
* You can then apply more transformations or retrieve the output.
|
|
5537
|
+
* You can then apply more transformations, draw, or retrieve the output.
|
|
5461
5538
|
* @param transform
|
|
5462
5539
|
*/
|
|
5463
5540
|
transform(transform: ImageTransform): ImageTransformer;
|
|
5541
|
+
/**
|
|
5542
|
+
* Draw an image on this transformer, returning a transform handle.
|
|
5543
|
+
* You can then apply more transformations, draw, or retrieve the output.
|
|
5544
|
+
* @param image The image (or transformer that will give the image) to draw
|
|
5545
|
+
* @param options The options configuring how to draw the image
|
|
5546
|
+
*/
|
|
5547
|
+
draw(
|
|
5548
|
+
image: ReadableStream<Uint8Array> | ImageTransformer,
|
|
5549
|
+
options?: ImageDrawOptions,
|
|
5550
|
+
): ImageTransformer;
|
|
5464
5551
|
/**
|
|
5465
5552
|
* Retrieve the image that results from applying the transforms to the
|
|
5466
5553
|
* provided input
|
package/2021-11-03/index.ts
CHANGED
|
@@ -543,6 +543,7 @@ export interface DurableObjectState {
|
|
|
543
543
|
waitUntil(promise: Promise<any>): void;
|
|
544
544
|
readonly id: DurableObjectId;
|
|
545
545
|
readonly storage: DurableObjectStorage;
|
|
546
|
+
container?: Container;
|
|
546
547
|
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
|
|
547
548
|
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
|
|
548
549
|
getWebSockets(tag?: string): WebSocket[];
|
|
@@ -3413,6 +3414,18 @@ export interface EventSourceEventSourceInit {
|
|
|
3413
3414
|
withCredentials?: boolean;
|
|
3414
3415
|
fetcher?: Fetcher;
|
|
3415
3416
|
}
|
|
3417
|
+
export interface Container {
|
|
3418
|
+
get running(): boolean;
|
|
3419
|
+
start(options?: ContainerStartupOptions): void;
|
|
3420
|
+
monitor(): Promise<void>;
|
|
3421
|
+
destroy(error?: any): Promise<void>;
|
|
3422
|
+
signal(signo: number): void;
|
|
3423
|
+
getTcpPort(port: number): Fetcher;
|
|
3424
|
+
}
|
|
3425
|
+
export interface ContainerStartupOptions {
|
|
3426
|
+
entrypoint?: string[];
|
|
3427
|
+
enableInternet: boolean;
|
|
3428
|
+
}
|
|
3416
3429
|
export type AiImageClassificationInput = {
|
|
3417
3430
|
image: number[];
|
|
3418
3431
|
};
|
|
@@ -3665,6 +3678,54 @@ export declare abstract class Base_Ai_Cf_Openai_Whisper {
|
|
|
3665
3678
|
inputs: Ai_Cf_Openai_Whisper_Input;
|
|
3666
3679
|
postProcessedOutputs: Ai_Cf_Openai_Whisper_Output;
|
|
3667
3680
|
}
|
|
3681
|
+
export type Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input =
|
|
3682
|
+
| string
|
|
3683
|
+
| {
|
|
3684
|
+
/**
|
|
3685
|
+
* The input text prompt for the model to generate a response.
|
|
3686
|
+
*/
|
|
3687
|
+
prompt?: string;
|
|
3688
|
+
/**
|
|
3689
|
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
|
|
3690
|
+
*/
|
|
3691
|
+
raw?: boolean;
|
|
3692
|
+
/**
|
|
3693
|
+
* Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
|
|
3694
|
+
*/
|
|
3695
|
+
top_p?: number;
|
|
3696
|
+
/**
|
|
3697
|
+
* 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.
|
|
3698
|
+
*/
|
|
3699
|
+
top_k?: number;
|
|
3700
|
+
/**
|
|
3701
|
+
* Random seed for reproducibility of the generation.
|
|
3702
|
+
*/
|
|
3703
|
+
seed?: number;
|
|
3704
|
+
/**
|
|
3705
|
+
* Penalty for repeated tokens; higher values discourage repetition.
|
|
3706
|
+
*/
|
|
3707
|
+
repetition_penalty?: number;
|
|
3708
|
+
/**
|
|
3709
|
+
* Decreases the likelihood of the model repeating the same lines verbatim.
|
|
3710
|
+
*/
|
|
3711
|
+
frequency_penalty?: number;
|
|
3712
|
+
/**
|
|
3713
|
+
* Increases the likelihood of the model introducing new topics.
|
|
3714
|
+
*/
|
|
3715
|
+
presence_penalty?: number;
|
|
3716
|
+
image: number[] | (string & NonNullable<unknown>);
|
|
3717
|
+
/**
|
|
3718
|
+
* The maximum number of tokens to generate in the response.
|
|
3719
|
+
*/
|
|
3720
|
+
max_tokens?: number;
|
|
3721
|
+
};
|
|
3722
|
+
export interface Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output {
|
|
3723
|
+
description?: string;
|
|
3724
|
+
}
|
|
3725
|
+
export declare abstract class Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M {
|
|
3726
|
+
inputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input;
|
|
3727
|
+
postProcessedOutputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output;
|
|
3728
|
+
}
|
|
3668
3729
|
export type Ai_Cf_Openai_Whisper_Tiny_En_Input =
|
|
3669
3730
|
| string
|
|
3670
3731
|
| {
|
|
@@ -4097,11 +4158,12 @@ export interface AiModels {
|
|
|
4097
4158
|
"@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
|
|
4098
4159
|
"@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;
|
|
4099
4160
|
"@cf/meta/llama-3.3-70b-instruct-fp8-fast": BaseAiTextGeneration;
|
|
4161
|
+
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": BaseAiTextGeneration;
|
|
4100
4162
|
"@cf/meta/m2m100-1.2b": BaseAiTranslation;
|
|
4101
4163
|
"@cf/facebook/bart-large-cnn": BaseAiSummarization;
|
|
4102
|
-
"@cf/unum/uform-gen2-qwen-500m": BaseAiImageToText;
|
|
4103
4164
|
"@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;
|
|
4104
4165
|
"@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper;
|
|
4166
|
+
"@cf/unum/uform-gen2-qwen-500m": Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M;
|
|
4105
4167
|
"@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
|
|
4106
4168
|
"@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
|
|
4107
4169
|
"@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
|
|
@@ -4109,6 +4171,7 @@ export interface AiModels {
|
|
|
4109
4171
|
}
|
|
4110
4172
|
export type AiOptions = {
|
|
4111
4173
|
gateway?: GatewayOptions;
|
|
4174
|
+
returnRawResponse?: boolean;
|
|
4112
4175
|
prefix?: string;
|
|
4113
4176
|
extraHeaders?: object;
|
|
4114
4177
|
};
|
|
@@ -4145,11 +4208,17 @@ export declare abstract class Ai<
|
|
|
4145
4208
|
> {
|
|
4146
4209
|
aiGatewayLogId: string | null;
|
|
4147
4210
|
gateway(gatewayId: string): AiGateway;
|
|
4148
|
-
run<Name extends keyof AiModelList>(
|
|
4211
|
+
run<Name extends keyof AiModelList, Options extends AiOptions>(
|
|
4149
4212
|
model: Name,
|
|
4150
4213
|
inputs: AiModelList[Name]["inputs"],
|
|
4151
|
-
options?:
|
|
4152
|
-
): Promise<
|
|
4214
|
+
options?: Options,
|
|
4215
|
+
): Promise<
|
|
4216
|
+
Options extends {
|
|
4217
|
+
returnRawResponse: true;
|
|
4218
|
+
}
|
|
4219
|
+
? Response
|
|
4220
|
+
: AiModelList[Name]["postProcessedOutputs"]
|
|
4221
|
+
>;
|
|
4153
4222
|
public models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
|
|
4154
4223
|
}
|
|
4155
4224
|
export type GatewayOptions = {
|
|
@@ -5447,6 +5516,14 @@ export type ImageTransform = {
|
|
|
5447
5516
|
};
|
|
5448
5517
|
zoom?: number;
|
|
5449
5518
|
};
|
|
5519
|
+
export type ImageDrawOptions = {
|
|
5520
|
+
opacity?: number;
|
|
5521
|
+
repeat?: boolean | string;
|
|
5522
|
+
top?: number;
|
|
5523
|
+
left?: number;
|
|
5524
|
+
bottom?: number;
|
|
5525
|
+
right?: number;
|
|
5526
|
+
};
|
|
5450
5527
|
export type ImageOutputOptions = {
|
|
5451
5528
|
format:
|
|
5452
5529
|
| "image/jpeg"
|
|
@@ -5476,10 +5553,20 @@ export interface ImagesBinding {
|
|
|
5476
5553
|
export interface ImageTransformer {
|
|
5477
5554
|
/**
|
|
5478
5555
|
* Apply transform next, returning a transform handle.
|
|
5479
|
-
* You can then apply more transformations or retrieve the output.
|
|
5556
|
+
* You can then apply more transformations, draw, or retrieve the output.
|
|
5480
5557
|
* @param transform
|
|
5481
5558
|
*/
|
|
5482
5559
|
transform(transform: ImageTransform): ImageTransformer;
|
|
5560
|
+
/**
|
|
5561
|
+
* Draw an image on this transformer, returning a transform handle.
|
|
5562
|
+
* You can then apply more transformations, draw, or retrieve the output.
|
|
5563
|
+
* @param image The image (or transformer that will give the image) to draw
|
|
5564
|
+
* @param options The options configuring how to draw the image
|
|
5565
|
+
*/
|
|
5566
|
+
draw(
|
|
5567
|
+
image: ReadableStream<Uint8Array> | ImageTransformer,
|
|
5568
|
+
options?: ImageDrawOptions,
|
|
5569
|
+
): ImageTransformer;
|
|
5483
5570
|
/**
|
|
5484
5571
|
* Retrieve the image that results from applying the transforms to the
|
|
5485
5572
|
* provided input
|
package/2022-01-31/index.d.ts
CHANGED
|
@@ -538,6 +538,7 @@ interface DurableObjectState {
|
|
|
538
538
|
waitUntil(promise: Promise<any>): void;
|
|
539
539
|
readonly id: DurableObjectId;
|
|
540
540
|
readonly storage: DurableObjectStorage;
|
|
541
|
+
container?: Container;
|
|
541
542
|
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
|
|
542
543
|
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
|
|
543
544
|
getWebSockets(tag?: string): WebSocket[];
|
|
@@ -3427,6 +3428,18 @@ interface EventSourceEventSourceInit {
|
|
|
3427
3428
|
withCredentials?: boolean;
|
|
3428
3429
|
fetcher?: Fetcher;
|
|
3429
3430
|
}
|
|
3431
|
+
interface Container {
|
|
3432
|
+
get running(): boolean;
|
|
3433
|
+
start(options?: ContainerStartupOptions): void;
|
|
3434
|
+
monitor(): Promise<void>;
|
|
3435
|
+
destroy(error?: any): Promise<void>;
|
|
3436
|
+
signal(signo: number): void;
|
|
3437
|
+
getTcpPort(port: number): Fetcher;
|
|
3438
|
+
}
|
|
3439
|
+
interface ContainerStartupOptions {
|
|
3440
|
+
entrypoint?: string[];
|
|
3441
|
+
enableInternet: boolean;
|
|
3442
|
+
}
|
|
3430
3443
|
type AiImageClassificationInput = {
|
|
3431
3444
|
image: number[];
|
|
3432
3445
|
};
|
|
@@ -3679,6 +3692,54 @@ declare abstract class Base_Ai_Cf_Openai_Whisper {
|
|
|
3679
3692
|
inputs: Ai_Cf_Openai_Whisper_Input;
|
|
3680
3693
|
postProcessedOutputs: Ai_Cf_Openai_Whisper_Output;
|
|
3681
3694
|
}
|
|
3695
|
+
type Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input =
|
|
3696
|
+
| string
|
|
3697
|
+
| {
|
|
3698
|
+
/**
|
|
3699
|
+
* The input text prompt for the model to generate a response.
|
|
3700
|
+
*/
|
|
3701
|
+
prompt?: string;
|
|
3702
|
+
/**
|
|
3703
|
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
|
|
3704
|
+
*/
|
|
3705
|
+
raw?: boolean;
|
|
3706
|
+
/**
|
|
3707
|
+
* Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
|
|
3708
|
+
*/
|
|
3709
|
+
top_p?: number;
|
|
3710
|
+
/**
|
|
3711
|
+
* 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.
|
|
3712
|
+
*/
|
|
3713
|
+
top_k?: number;
|
|
3714
|
+
/**
|
|
3715
|
+
* Random seed for reproducibility of the generation.
|
|
3716
|
+
*/
|
|
3717
|
+
seed?: number;
|
|
3718
|
+
/**
|
|
3719
|
+
* Penalty for repeated tokens; higher values discourage repetition.
|
|
3720
|
+
*/
|
|
3721
|
+
repetition_penalty?: number;
|
|
3722
|
+
/**
|
|
3723
|
+
* Decreases the likelihood of the model repeating the same lines verbatim.
|
|
3724
|
+
*/
|
|
3725
|
+
frequency_penalty?: number;
|
|
3726
|
+
/**
|
|
3727
|
+
* Increases the likelihood of the model introducing new topics.
|
|
3728
|
+
*/
|
|
3729
|
+
presence_penalty?: number;
|
|
3730
|
+
image: number[] | (string & NonNullable<unknown>);
|
|
3731
|
+
/**
|
|
3732
|
+
* The maximum number of tokens to generate in the response.
|
|
3733
|
+
*/
|
|
3734
|
+
max_tokens?: number;
|
|
3735
|
+
};
|
|
3736
|
+
interface Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output {
|
|
3737
|
+
description?: string;
|
|
3738
|
+
}
|
|
3739
|
+
declare abstract class Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M {
|
|
3740
|
+
inputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input;
|
|
3741
|
+
postProcessedOutputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output;
|
|
3742
|
+
}
|
|
3682
3743
|
type Ai_Cf_Openai_Whisper_Tiny_En_Input =
|
|
3683
3744
|
| string
|
|
3684
3745
|
| {
|
|
@@ -4111,11 +4172,12 @@ interface AiModels {
|
|
|
4111
4172
|
"@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
|
|
4112
4173
|
"@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;
|
|
4113
4174
|
"@cf/meta/llama-3.3-70b-instruct-fp8-fast": BaseAiTextGeneration;
|
|
4175
|
+
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": BaseAiTextGeneration;
|
|
4114
4176
|
"@cf/meta/m2m100-1.2b": BaseAiTranslation;
|
|
4115
4177
|
"@cf/facebook/bart-large-cnn": BaseAiSummarization;
|
|
4116
|
-
"@cf/unum/uform-gen2-qwen-500m": BaseAiImageToText;
|
|
4117
4178
|
"@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;
|
|
4118
4179
|
"@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper;
|
|
4180
|
+
"@cf/unum/uform-gen2-qwen-500m": Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M;
|
|
4119
4181
|
"@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
|
|
4120
4182
|
"@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
|
|
4121
4183
|
"@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
|
|
@@ -4123,6 +4185,7 @@ interface AiModels {
|
|
|
4123
4185
|
}
|
|
4124
4186
|
type AiOptions = {
|
|
4125
4187
|
gateway?: GatewayOptions;
|
|
4188
|
+
returnRawResponse?: boolean;
|
|
4126
4189
|
prefix?: string;
|
|
4127
4190
|
extraHeaders?: object;
|
|
4128
4191
|
};
|
|
@@ -4157,11 +4220,17 @@ type AiModelListType = Record<string, any>;
|
|
|
4157
4220
|
declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
|
|
4158
4221
|
aiGatewayLogId: string | null;
|
|
4159
4222
|
gateway(gatewayId: string): AiGateway;
|
|
4160
|
-
run<Name extends keyof AiModelList>(
|
|
4223
|
+
run<Name extends keyof AiModelList, Options extends AiOptions>(
|
|
4161
4224
|
model: Name,
|
|
4162
4225
|
inputs: AiModelList[Name]["inputs"],
|
|
4163
|
-
options?:
|
|
4164
|
-
): Promise<
|
|
4226
|
+
options?: Options,
|
|
4227
|
+
): Promise<
|
|
4228
|
+
Options extends {
|
|
4229
|
+
returnRawResponse: true;
|
|
4230
|
+
}
|
|
4231
|
+
? Response
|
|
4232
|
+
: AiModelList[Name]["postProcessedOutputs"]
|
|
4233
|
+
>;
|
|
4165
4234
|
public models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
|
|
4166
4235
|
}
|
|
4167
4236
|
type GatewayOptions = {
|
|
@@ -5454,6 +5523,14 @@ type ImageTransform = {
|
|
|
5454
5523
|
};
|
|
5455
5524
|
zoom?: number;
|
|
5456
5525
|
};
|
|
5526
|
+
type ImageDrawOptions = {
|
|
5527
|
+
opacity?: number;
|
|
5528
|
+
repeat?: boolean | string;
|
|
5529
|
+
top?: number;
|
|
5530
|
+
left?: number;
|
|
5531
|
+
bottom?: number;
|
|
5532
|
+
right?: number;
|
|
5533
|
+
};
|
|
5457
5534
|
type ImageOutputOptions = {
|
|
5458
5535
|
format:
|
|
5459
5536
|
| "image/jpeg"
|
|
@@ -5483,10 +5560,20 @@ interface ImagesBinding {
|
|
|
5483
5560
|
interface ImageTransformer {
|
|
5484
5561
|
/**
|
|
5485
5562
|
* Apply transform next, returning a transform handle.
|
|
5486
|
-
* You can then apply more transformations or retrieve the output.
|
|
5563
|
+
* You can then apply more transformations, draw, or retrieve the output.
|
|
5487
5564
|
* @param transform
|
|
5488
5565
|
*/
|
|
5489
5566
|
transform(transform: ImageTransform): ImageTransformer;
|
|
5567
|
+
/**
|
|
5568
|
+
* Draw an image on this transformer, returning a transform handle.
|
|
5569
|
+
* You can then apply more transformations, draw, or retrieve the output.
|
|
5570
|
+
* @param image The image (or transformer that will give the image) to draw
|
|
5571
|
+
* @param options The options configuring how to draw the image
|
|
5572
|
+
*/
|
|
5573
|
+
draw(
|
|
5574
|
+
image: ReadableStream<Uint8Array> | ImageTransformer,
|
|
5575
|
+
options?: ImageDrawOptions,
|
|
5576
|
+
): ImageTransformer;
|
|
5490
5577
|
/**
|
|
5491
5578
|
* Retrieve the image that results from applying the transforms to the
|
|
5492
5579
|
* provided input
|
package/2022-01-31/index.ts
CHANGED
|
@@ -543,6 +543,7 @@ export interface DurableObjectState {
|
|
|
543
543
|
waitUntil(promise: Promise<any>): void;
|
|
544
544
|
readonly id: DurableObjectId;
|
|
545
545
|
readonly storage: DurableObjectStorage;
|
|
546
|
+
container?: Container;
|
|
546
547
|
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
|
|
547
548
|
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
|
|
548
549
|
getWebSockets(tag?: string): WebSocket[];
|
|
@@ -3439,6 +3440,18 @@ export interface EventSourceEventSourceInit {
|
|
|
3439
3440
|
withCredentials?: boolean;
|
|
3440
3441
|
fetcher?: Fetcher;
|
|
3441
3442
|
}
|
|
3443
|
+
export interface Container {
|
|
3444
|
+
get running(): boolean;
|
|
3445
|
+
start(options?: ContainerStartupOptions): void;
|
|
3446
|
+
monitor(): Promise<void>;
|
|
3447
|
+
destroy(error?: any): Promise<void>;
|
|
3448
|
+
signal(signo: number): void;
|
|
3449
|
+
getTcpPort(port: number): Fetcher;
|
|
3450
|
+
}
|
|
3451
|
+
export interface ContainerStartupOptions {
|
|
3452
|
+
entrypoint?: string[];
|
|
3453
|
+
enableInternet: boolean;
|
|
3454
|
+
}
|
|
3442
3455
|
export type AiImageClassificationInput = {
|
|
3443
3456
|
image: number[];
|
|
3444
3457
|
};
|
|
@@ -3691,6 +3704,54 @@ export declare abstract class Base_Ai_Cf_Openai_Whisper {
|
|
|
3691
3704
|
inputs: Ai_Cf_Openai_Whisper_Input;
|
|
3692
3705
|
postProcessedOutputs: Ai_Cf_Openai_Whisper_Output;
|
|
3693
3706
|
}
|
|
3707
|
+
export type Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input =
|
|
3708
|
+
| string
|
|
3709
|
+
| {
|
|
3710
|
+
/**
|
|
3711
|
+
* The input text prompt for the model to generate a response.
|
|
3712
|
+
*/
|
|
3713
|
+
prompt?: string;
|
|
3714
|
+
/**
|
|
3715
|
+
* If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
|
|
3716
|
+
*/
|
|
3717
|
+
raw?: boolean;
|
|
3718
|
+
/**
|
|
3719
|
+
* Controls the creativity of the AI's responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
|
|
3720
|
+
*/
|
|
3721
|
+
top_p?: number;
|
|
3722
|
+
/**
|
|
3723
|
+
* 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.
|
|
3724
|
+
*/
|
|
3725
|
+
top_k?: number;
|
|
3726
|
+
/**
|
|
3727
|
+
* Random seed for reproducibility of the generation.
|
|
3728
|
+
*/
|
|
3729
|
+
seed?: number;
|
|
3730
|
+
/**
|
|
3731
|
+
* Penalty for repeated tokens; higher values discourage repetition.
|
|
3732
|
+
*/
|
|
3733
|
+
repetition_penalty?: number;
|
|
3734
|
+
/**
|
|
3735
|
+
* Decreases the likelihood of the model repeating the same lines verbatim.
|
|
3736
|
+
*/
|
|
3737
|
+
frequency_penalty?: number;
|
|
3738
|
+
/**
|
|
3739
|
+
* Increases the likelihood of the model introducing new topics.
|
|
3740
|
+
*/
|
|
3741
|
+
presence_penalty?: number;
|
|
3742
|
+
image: number[] | (string & NonNullable<unknown>);
|
|
3743
|
+
/**
|
|
3744
|
+
* The maximum number of tokens to generate in the response.
|
|
3745
|
+
*/
|
|
3746
|
+
max_tokens?: number;
|
|
3747
|
+
};
|
|
3748
|
+
export interface Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output {
|
|
3749
|
+
description?: string;
|
|
3750
|
+
}
|
|
3751
|
+
export declare abstract class Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M {
|
|
3752
|
+
inputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Input;
|
|
3753
|
+
postProcessedOutputs: Ai_Cf_Unum_Uform_Gen2_Qwen_500M_Output;
|
|
3754
|
+
}
|
|
3694
3755
|
export type Ai_Cf_Openai_Whisper_Tiny_En_Input =
|
|
3695
3756
|
| string
|
|
3696
3757
|
| {
|
|
@@ -4123,11 +4184,12 @@ export interface AiModels {
|
|
|
4123
4184
|
"@cf/meta/llama-3.2-3b-instruct": BaseAiTextGeneration;
|
|
4124
4185
|
"@cf/meta/llama-3.2-1b-instruct": BaseAiTextGeneration;
|
|
4125
4186
|
"@cf/meta/llama-3.3-70b-instruct-fp8-fast": BaseAiTextGeneration;
|
|
4187
|
+
"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": BaseAiTextGeneration;
|
|
4126
4188
|
"@cf/meta/m2m100-1.2b": BaseAiTranslation;
|
|
4127
4189
|
"@cf/facebook/bart-large-cnn": BaseAiSummarization;
|
|
4128
|
-
"@cf/unum/uform-gen2-qwen-500m": BaseAiImageToText;
|
|
4129
4190
|
"@cf/llava-hf/llava-1.5-7b-hf": BaseAiImageToText;
|
|
4130
4191
|
"@cf/openai/whisper": Base_Ai_Cf_Openai_Whisper;
|
|
4192
|
+
"@cf/unum/uform-gen2-qwen-500m": Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M;
|
|
4131
4193
|
"@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
|
|
4132
4194
|
"@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
|
|
4133
4195
|
"@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
|
|
@@ -4135,6 +4197,7 @@ export interface AiModels {
|
|
|
4135
4197
|
}
|
|
4136
4198
|
export type AiOptions = {
|
|
4137
4199
|
gateway?: GatewayOptions;
|
|
4200
|
+
returnRawResponse?: boolean;
|
|
4138
4201
|
prefix?: string;
|
|
4139
4202
|
extraHeaders?: object;
|
|
4140
4203
|
};
|
|
@@ -4171,11 +4234,17 @@ export declare abstract class Ai<
|
|
|
4171
4234
|
> {
|
|
4172
4235
|
aiGatewayLogId: string | null;
|
|
4173
4236
|
gateway(gatewayId: string): AiGateway;
|
|
4174
|
-
run<Name extends keyof AiModelList>(
|
|
4237
|
+
run<Name extends keyof AiModelList, Options extends AiOptions>(
|
|
4175
4238
|
model: Name,
|
|
4176
4239
|
inputs: AiModelList[Name]["inputs"],
|
|
4177
|
-
options?:
|
|
4178
|
-
): Promise<
|
|
4240
|
+
options?: Options,
|
|
4241
|
+
): Promise<
|
|
4242
|
+
Options extends {
|
|
4243
|
+
returnRawResponse: true;
|
|
4244
|
+
}
|
|
4245
|
+
? Response
|
|
4246
|
+
: AiModelList[Name]["postProcessedOutputs"]
|
|
4247
|
+
>;
|
|
4179
4248
|
public models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
|
|
4180
4249
|
}
|
|
4181
4250
|
export type GatewayOptions = {
|
|
@@ -5473,6 +5542,14 @@ export type ImageTransform = {
|
|
|
5473
5542
|
};
|
|
5474
5543
|
zoom?: number;
|
|
5475
5544
|
};
|
|
5545
|
+
export type ImageDrawOptions = {
|
|
5546
|
+
opacity?: number;
|
|
5547
|
+
repeat?: boolean | string;
|
|
5548
|
+
top?: number;
|
|
5549
|
+
left?: number;
|
|
5550
|
+
bottom?: number;
|
|
5551
|
+
right?: number;
|
|
5552
|
+
};
|
|
5476
5553
|
export type ImageOutputOptions = {
|
|
5477
5554
|
format:
|
|
5478
5555
|
| "image/jpeg"
|
|
@@ -5502,10 +5579,20 @@ export interface ImagesBinding {
|
|
|
5502
5579
|
export interface ImageTransformer {
|
|
5503
5580
|
/**
|
|
5504
5581
|
* Apply transform next, returning a transform handle.
|
|
5505
|
-
* You can then apply more transformations or retrieve the output.
|
|
5582
|
+
* You can then apply more transformations, draw, or retrieve the output.
|
|
5506
5583
|
* @param transform
|
|
5507
5584
|
*/
|
|
5508
5585
|
transform(transform: ImageTransform): ImageTransformer;
|
|
5586
|
+
/**
|
|
5587
|
+
* Draw an image on this transformer, returning a transform handle.
|
|
5588
|
+
* You can then apply more transformations, draw, or retrieve the output.
|
|
5589
|
+
* @param image The image (or transformer that will give the image) to draw
|
|
5590
|
+
* @param options The options configuring how to draw the image
|
|
5591
|
+
*/
|
|
5592
|
+
draw(
|
|
5593
|
+
image: ReadableStream<Uint8Array> | ImageTransformer,
|
|
5594
|
+
options?: ImageDrawOptions,
|
|
5595
|
+
): ImageTransformer;
|
|
5509
5596
|
/**
|
|
5510
5597
|
* Retrieve the image that results from applying the transforms to the
|
|
5511
5598
|
* provided input
|