@cloudflare/workers-types 4.20260409.1 → 4.20260411.1
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 +72 -23
- package/2021-11-03/index.ts +72 -23
- package/2022-01-31/index.d.ts +72 -23
- package/2022-01-31/index.ts +72 -23
- package/2022-03-21/index.d.ts +72 -23
- package/2022-03-21/index.ts +72 -23
- package/2022-08-04/index.d.ts +72 -23
- package/2022-08-04/index.ts +72 -23
- package/2022-10-31/index.d.ts +72 -23
- package/2022-10-31/index.ts +72 -23
- package/2022-11-30/index.d.ts +72 -23
- package/2022-11-30/index.ts +72 -23
- package/2023-03-01/index.d.ts +72 -23
- package/2023-03-01/index.ts +72 -23
- package/2023-07-01/index.d.ts +72 -23
- package/2023-07-01/index.ts +72 -23
- package/experimental/index.d.ts +72 -23
- package/experimental/index.ts +72 -23
- package/index.d.ts +72 -23
- package/index.ts +72 -23
- package/latest/index.d.ts +72 -23
- package/latest/index.ts +72 -23
- package/oldest/index.d.ts +72 -23
- package/oldest/index.ts +72 -23
- package/package.json +1 -1
package/latest/index.d.ts
CHANGED
|
@@ -479,6 +479,7 @@ interface ExecutionContext<Props = unknown> {
|
|
|
479
479
|
passThroughOnException(): void;
|
|
480
480
|
readonly exports: Cloudflare.Exports;
|
|
481
481
|
readonly props: Props;
|
|
482
|
+
cache?: CacheContext;
|
|
482
483
|
}
|
|
483
484
|
type ExportedHandlerFetchHandler<
|
|
484
485
|
Env = unknown,
|
|
@@ -562,6 +563,23 @@ interface AlarmInvocationInfo {
|
|
|
562
563
|
interface Cloudflare {
|
|
563
564
|
readonly compatibilityFlags: Record<string, boolean>;
|
|
564
565
|
}
|
|
566
|
+
interface CachePurgeError {
|
|
567
|
+
code: number;
|
|
568
|
+
message: string;
|
|
569
|
+
}
|
|
570
|
+
interface CachePurgeResult {
|
|
571
|
+
success: boolean;
|
|
572
|
+
zoneTag: string;
|
|
573
|
+
errors: CachePurgeError[];
|
|
574
|
+
}
|
|
575
|
+
interface CachePurgeOptions {
|
|
576
|
+
tags?: string[];
|
|
577
|
+
pathPrefixes?: string[];
|
|
578
|
+
purgeEverything?: boolean;
|
|
579
|
+
}
|
|
580
|
+
interface CacheContext {
|
|
581
|
+
purge(options: CachePurgeOptions): Promise<CachePurgeResult>;
|
|
582
|
+
}
|
|
565
583
|
declare abstract class ColoLocalActorNamespace {
|
|
566
584
|
get(actorId: string): Fetcher;
|
|
567
585
|
}
|
|
@@ -10331,6 +10349,10 @@ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
|
10331
10349
|
inputs: ChatCompletionsInput;
|
|
10332
10350
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10333
10351
|
}
|
|
10352
|
+
declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10353
|
+
inputs: ChatCompletionsInput;
|
|
10354
|
+
postProcessedOutputs: ChatCompletionsOutput;
|
|
10355
|
+
}
|
|
10334
10356
|
interface AiModels {
|
|
10335
10357
|
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
|
10336
10358
|
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
|
@@ -10486,6 +10508,9 @@ type ChatCompletionsInput = XOR<
|
|
|
10486
10508
|
interface InferenceUpstreamError extends Error {}
|
|
10487
10509
|
interface AiInternalError extends Error {}
|
|
10488
10510
|
type AiModelListType = Record<string, any>;
|
|
10511
|
+
type AiAsyncBatchResponse = {
|
|
10512
|
+
request_id: string;
|
|
10513
|
+
};
|
|
10489
10514
|
declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
|
|
10490
10515
|
aiGatewayLogId: string | null;
|
|
10491
10516
|
gateway(gatewayId: string): AiGateway;
|
|
@@ -10502,29 +10527,52 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
|
|
|
10502
10527
|
* @param autoragId Instance ID
|
|
10503
10528
|
*/
|
|
10504
10529
|
autorag(autoragId: string): AutoRAG;
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
Options extends AiOptions,
|
|
10508
|
-
InputOptions extends AiModelList[Name]["inputs"],
|
|
10509
|
-
>(
|
|
10530
|
+
// Batch request
|
|
10531
|
+
run<Name extends keyof AiModelList>(
|
|
10510
10532
|
model: Name,
|
|
10511
|
-
inputs:
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
|
|
10533
|
+
inputs: {
|
|
10534
|
+
requests: AiModelList[Name]["inputs"][];
|
|
10535
|
+
},
|
|
10536
|
+
options: AiOptions & {
|
|
10537
|
+
queueRequest: true;
|
|
10538
|
+
},
|
|
10539
|
+
): Promise<AiAsyncBatchResponse>;
|
|
10540
|
+
// Raw response
|
|
10541
|
+
run<Name extends keyof AiModelList>(
|
|
10542
|
+
model: Name,
|
|
10543
|
+
inputs: AiModelList[Name]["inputs"],
|
|
10544
|
+
options: AiOptions & {
|
|
10545
|
+
returnRawResponse: true;
|
|
10546
|
+
},
|
|
10547
|
+
): Promise<Response>;
|
|
10548
|
+
// WebSocket
|
|
10549
|
+
run<Name extends keyof AiModelList>(
|
|
10550
|
+
model: Name,
|
|
10551
|
+
inputs: AiModelList[Name]["inputs"],
|
|
10552
|
+
options: AiOptions & {
|
|
10553
|
+
websocket: true;
|
|
10554
|
+
},
|
|
10555
|
+
): Promise<Response>;
|
|
10556
|
+
// Streaming
|
|
10557
|
+
run<Name extends keyof AiModelList>(
|
|
10558
|
+
model: Name,
|
|
10559
|
+
inputs: AiModelList[Name]["inputs"] & {
|
|
10560
|
+
stream: true;
|
|
10561
|
+
},
|
|
10562
|
+
options?: AiOptions,
|
|
10563
|
+
): Promise<ReadableStream>;
|
|
10564
|
+
// Normal (default) - known model
|
|
10565
|
+
run<Name extends keyof AiModelList>(
|
|
10566
|
+
model: Name,
|
|
10567
|
+
inputs: AiModelList[Name]["inputs"],
|
|
10568
|
+
options?: AiOptions,
|
|
10569
|
+
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
10570
|
+
// Unknown model (gateway fallback)
|
|
10571
|
+
run(
|
|
10572
|
+
model: string & {},
|
|
10573
|
+
inputs: Record<string, unknown>,
|
|
10574
|
+
options?: AiOptions,
|
|
10575
|
+
): Promise<Record<string, unknown>>;
|
|
10528
10576
|
models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
|
|
10529
10577
|
toMarkdown(): ToMarkdownService;
|
|
10530
10578
|
toMarkdown(
|
|
@@ -10653,6 +10701,7 @@ declare abstract class AiGateway {
|
|
|
10653
10701
|
options?: {
|
|
10654
10702
|
gateway?: UniversalGatewayOptions;
|
|
10655
10703
|
extraHeaders?: object;
|
|
10704
|
+
signal?: AbortSignal;
|
|
10656
10705
|
},
|
|
10657
10706
|
): Promise<Response>;
|
|
10658
10707
|
getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
|
|
@@ -13000,7 +13049,7 @@ declare namespace CloudflareWorkersModule {
|
|
|
13000
13049
|
email?(message: ForwardableEmailMessage): void | Promise<void>;
|
|
13001
13050
|
fetch?(request: Request): Response | Promise<Response>;
|
|
13002
13051
|
connect?(socket: Socket): void | Promise<void>;
|
|
13003
|
-
queue?(batch: MessageBatch
|
|
13052
|
+
queue?(batch: MessageBatch): void | Promise<void>;
|
|
13004
13053
|
scheduled?(controller: ScheduledController): void | Promise<void>;
|
|
13005
13054
|
tail?(events: TraceItem[]): void | Promise<void>;
|
|
13006
13055
|
tailStream?(
|
package/latest/index.ts
CHANGED
|
@@ -481,6 +481,7 @@ export interface ExecutionContext<Props = unknown> {
|
|
|
481
481
|
passThroughOnException(): void;
|
|
482
482
|
readonly exports: Cloudflare.Exports;
|
|
483
483
|
readonly props: Props;
|
|
484
|
+
cache?: CacheContext;
|
|
484
485
|
}
|
|
485
486
|
export type ExportedHandlerFetchHandler<
|
|
486
487
|
Env = unknown,
|
|
@@ -564,6 +565,23 @@ export interface AlarmInvocationInfo {
|
|
|
564
565
|
export interface Cloudflare {
|
|
565
566
|
readonly compatibilityFlags: Record<string, boolean>;
|
|
566
567
|
}
|
|
568
|
+
export interface CachePurgeError {
|
|
569
|
+
code: number;
|
|
570
|
+
message: string;
|
|
571
|
+
}
|
|
572
|
+
export interface CachePurgeResult {
|
|
573
|
+
success: boolean;
|
|
574
|
+
zoneTag: string;
|
|
575
|
+
errors: CachePurgeError[];
|
|
576
|
+
}
|
|
577
|
+
export interface CachePurgeOptions {
|
|
578
|
+
tags?: string[];
|
|
579
|
+
pathPrefixes?: string[];
|
|
580
|
+
purgeEverything?: boolean;
|
|
581
|
+
}
|
|
582
|
+
export interface CacheContext {
|
|
583
|
+
purge(options: CachePurgeOptions): Promise<CachePurgeResult>;
|
|
584
|
+
}
|
|
567
585
|
export declare abstract class ColoLocalActorNamespace {
|
|
568
586
|
get(actorId: string): Fetcher;
|
|
569
587
|
}
|
|
@@ -10340,6 +10358,10 @@ export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
|
10340
10358
|
inputs: ChatCompletionsInput;
|
|
10341
10359
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10342
10360
|
}
|
|
10361
|
+
export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10362
|
+
inputs: ChatCompletionsInput;
|
|
10363
|
+
postProcessedOutputs: ChatCompletionsOutput;
|
|
10364
|
+
}
|
|
10343
10365
|
export interface AiModels {
|
|
10344
10366
|
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
|
10345
10367
|
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
|
@@ -10495,6 +10517,9 @@ export type ChatCompletionsInput = XOR<
|
|
|
10495
10517
|
export interface InferenceUpstreamError extends Error {}
|
|
10496
10518
|
export interface AiInternalError extends Error {}
|
|
10497
10519
|
export type AiModelListType = Record<string, any>;
|
|
10520
|
+
export type AiAsyncBatchResponse = {
|
|
10521
|
+
request_id: string;
|
|
10522
|
+
};
|
|
10498
10523
|
export declare abstract class Ai<
|
|
10499
10524
|
AiModelList extends AiModelListType = AiModels,
|
|
10500
10525
|
> {
|
|
@@ -10513,29 +10538,52 @@ export declare abstract class Ai<
|
|
|
10513
10538
|
* @param autoragId Instance ID
|
|
10514
10539
|
*/
|
|
10515
10540
|
autorag(autoragId: string): AutoRAG;
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
Options extends AiOptions,
|
|
10519
|
-
InputOptions extends AiModelList[Name]["inputs"],
|
|
10520
|
-
>(
|
|
10541
|
+
// Batch request
|
|
10542
|
+
run<Name extends keyof AiModelList>(
|
|
10521
10543
|
model: Name,
|
|
10522
|
-
inputs:
|
|
10523
|
-
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10544
|
+
inputs: {
|
|
10545
|
+
requests: AiModelList[Name]["inputs"][];
|
|
10546
|
+
},
|
|
10547
|
+
options: AiOptions & {
|
|
10548
|
+
queueRequest: true;
|
|
10549
|
+
},
|
|
10550
|
+
): Promise<AiAsyncBatchResponse>;
|
|
10551
|
+
// Raw response
|
|
10552
|
+
run<Name extends keyof AiModelList>(
|
|
10553
|
+
model: Name,
|
|
10554
|
+
inputs: AiModelList[Name]["inputs"],
|
|
10555
|
+
options: AiOptions & {
|
|
10556
|
+
returnRawResponse: true;
|
|
10557
|
+
},
|
|
10558
|
+
): Promise<Response>;
|
|
10559
|
+
// WebSocket
|
|
10560
|
+
run<Name extends keyof AiModelList>(
|
|
10561
|
+
model: Name,
|
|
10562
|
+
inputs: AiModelList[Name]["inputs"],
|
|
10563
|
+
options: AiOptions & {
|
|
10564
|
+
websocket: true;
|
|
10565
|
+
},
|
|
10566
|
+
): Promise<Response>;
|
|
10567
|
+
// Streaming
|
|
10568
|
+
run<Name extends keyof AiModelList>(
|
|
10569
|
+
model: Name,
|
|
10570
|
+
inputs: AiModelList[Name]["inputs"] & {
|
|
10571
|
+
stream: true;
|
|
10572
|
+
},
|
|
10573
|
+
options?: AiOptions,
|
|
10574
|
+
): Promise<ReadableStream>;
|
|
10575
|
+
// Normal (default) - known model
|
|
10576
|
+
run<Name extends keyof AiModelList>(
|
|
10577
|
+
model: Name,
|
|
10578
|
+
inputs: AiModelList[Name]["inputs"],
|
|
10579
|
+
options?: AiOptions,
|
|
10580
|
+
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
10581
|
+
// Unknown model (gateway fallback)
|
|
10582
|
+
run(
|
|
10583
|
+
model: string & {},
|
|
10584
|
+
inputs: Record<string, unknown>,
|
|
10585
|
+
options?: AiOptions,
|
|
10586
|
+
): Promise<Record<string, unknown>>;
|
|
10539
10587
|
models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
|
|
10540
10588
|
toMarkdown(): ToMarkdownService;
|
|
10541
10589
|
toMarkdown(
|
|
@@ -10664,6 +10712,7 @@ export declare abstract class AiGateway {
|
|
|
10664
10712
|
options?: {
|
|
10665
10713
|
gateway?: UniversalGatewayOptions;
|
|
10666
10714
|
extraHeaders?: object;
|
|
10715
|
+
signal?: AbortSignal;
|
|
10667
10716
|
},
|
|
10668
10717
|
): Promise<Response>;
|
|
10669
10718
|
getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
|
|
@@ -12967,7 +13016,7 @@ export declare namespace CloudflareWorkersModule {
|
|
|
12967
13016
|
email?(message: ForwardableEmailMessage): void | Promise<void>;
|
|
12968
13017
|
fetch?(request: Request): Response | Promise<Response>;
|
|
12969
13018
|
connect?(socket: Socket): void | Promise<void>;
|
|
12970
|
-
queue?(batch: MessageBatch
|
|
13019
|
+
queue?(batch: MessageBatch): void | Promise<void>;
|
|
12971
13020
|
scheduled?(controller: ScheduledController): void | Promise<void>;
|
|
12972
13021
|
tail?(events: TraceItem[]): void | Promise<void>;
|
|
12973
13022
|
tailStream?(
|
package/oldest/index.d.ts
CHANGED
|
@@ -468,6 +468,7 @@ interface ExecutionContext<Props = unknown> {
|
|
|
468
468
|
waitUntil(promise: Promise<any>): void;
|
|
469
469
|
passThroughOnException(): void;
|
|
470
470
|
readonly props: Props;
|
|
471
|
+
cache?: CacheContext;
|
|
471
472
|
}
|
|
472
473
|
type ExportedHandlerFetchHandler<
|
|
473
474
|
Env = unknown,
|
|
@@ -544,6 +545,23 @@ interface AlarmInvocationInfo {
|
|
|
544
545
|
interface Cloudflare {
|
|
545
546
|
readonly compatibilityFlags: Record<string, boolean>;
|
|
546
547
|
}
|
|
548
|
+
interface CachePurgeError {
|
|
549
|
+
code: number;
|
|
550
|
+
message: string;
|
|
551
|
+
}
|
|
552
|
+
interface CachePurgeResult {
|
|
553
|
+
success: boolean;
|
|
554
|
+
zoneTag: string;
|
|
555
|
+
errors: CachePurgeError[];
|
|
556
|
+
}
|
|
557
|
+
interface CachePurgeOptions {
|
|
558
|
+
tags?: string[];
|
|
559
|
+
pathPrefixes?: string[];
|
|
560
|
+
purgeEverything?: boolean;
|
|
561
|
+
}
|
|
562
|
+
interface CacheContext {
|
|
563
|
+
purge(options: CachePurgeOptions): Promise<CachePurgeResult>;
|
|
564
|
+
}
|
|
547
565
|
declare abstract class ColoLocalActorNamespace {
|
|
548
566
|
get(actorId: string): Fetcher;
|
|
549
567
|
}
|
|
@@ -10191,6 +10209,10 @@ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
|
10191
10209
|
inputs: ChatCompletionsInput;
|
|
10192
10210
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10193
10211
|
}
|
|
10212
|
+
declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10213
|
+
inputs: ChatCompletionsInput;
|
|
10214
|
+
postProcessedOutputs: ChatCompletionsOutput;
|
|
10215
|
+
}
|
|
10194
10216
|
interface AiModels {
|
|
10195
10217
|
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
|
10196
10218
|
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
|
@@ -10346,6 +10368,9 @@ type ChatCompletionsInput = XOR<
|
|
|
10346
10368
|
interface InferenceUpstreamError extends Error {}
|
|
10347
10369
|
interface AiInternalError extends Error {}
|
|
10348
10370
|
type AiModelListType = Record<string, any>;
|
|
10371
|
+
type AiAsyncBatchResponse = {
|
|
10372
|
+
request_id: string;
|
|
10373
|
+
};
|
|
10349
10374
|
declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
|
|
10350
10375
|
aiGatewayLogId: string | null;
|
|
10351
10376
|
gateway(gatewayId: string): AiGateway;
|
|
@@ -10362,29 +10387,52 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
|
|
|
10362
10387
|
* @param autoragId Instance ID
|
|
10363
10388
|
*/
|
|
10364
10389
|
autorag(autoragId: string): AutoRAG;
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
Options extends AiOptions,
|
|
10368
|
-
InputOptions extends AiModelList[Name]["inputs"],
|
|
10369
|
-
>(
|
|
10390
|
+
// Batch request
|
|
10391
|
+
run<Name extends keyof AiModelList>(
|
|
10370
10392
|
model: Name,
|
|
10371
|
-
inputs:
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
|
|
10375
|
-
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10393
|
+
inputs: {
|
|
10394
|
+
requests: AiModelList[Name]["inputs"][];
|
|
10395
|
+
},
|
|
10396
|
+
options: AiOptions & {
|
|
10397
|
+
queueRequest: true;
|
|
10398
|
+
},
|
|
10399
|
+
): Promise<AiAsyncBatchResponse>;
|
|
10400
|
+
// Raw response
|
|
10401
|
+
run<Name extends keyof AiModelList>(
|
|
10402
|
+
model: Name,
|
|
10403
|
+
inputs: AiModelList[Name]["inputs"],
|
|
10404
|
+
options: AiOptions & {
|
|
10405
|
+
returnRawResponse: true;
|
|
10406
|
+
},
|
|
10407
|
+
): Promise<Response>;
|
|
10408
|
+
// WebSocket
|
|
10409
|
+
run<Name extends keyof AiModelList>(
|
|
10410
|
+
model: Name,
|
|
10411
|
+
inputs: AiModelList[Name]["inputs"],
|
|
10412
|
+
options: AiOptions & {
|
|
10413
|
+
websocket: true;
|
|
10414
|
+
},
|
|
10415
|
+
): Promise<Response>;
|
|
10416
|
+
// Streaming
|
|
10417
|
+
run<Name extends keyof AiModelList>(
|
|
10418
|
+
model: Name,
|
|
10419
|
+
inputs: AiModelList[Name]["inputs"] & {
|
|
10420
|
+
stream: true;
|
|
10421
|
+
},
|
|
10422
|
+
options?: AiOptions,
|
|
10423
|
+
): Promise<ReadableStream>;
|
|
10424
|
+
// Normal (default) - known model
|
|
10425
|
+
run<Name extends keyof AiModelList>(
|
|
10426
|
+
model: Name,
|
|
10427
|
+
inputs: AiModelList[Name]["inputs"],
|
|
10428
|
+
options?: AiOptions,
|
|
10429
|
+
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
10430
|
+
// Unknown model (gateway fallback)
|
|
10431
|
+
run(
|
|
10432
|
+
model: string & {},
|
|
10433
|
+
inputs: Record<string, unknown>,
|
|
10434
|
+
options?: AiOptions,
|
|
10435
|
+
): Promise<Record<string, unknown>>;
|
|
10388
10436
|
models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
|
|
10389
10437
|
toMarkdown(): ToMarkdownService;
|
|
10390
10438
|
toMarkdown(
|
|
@@ -10513,6 +10561,7 @@ declare abstract class AiGateway {
|
|
|
10513
10561
|
options?: {
|
|
10514
10562
|
gateway?: UniversalGatewayOptions;
|
|
10515
10563
|
extraHeaders?: object;
|
|
10564
|
+
signal?: AbortSignal;
|
|
10516
10565
|
},
|
|
10517
10566
|
): Promise<Response>;
|
|
10518
10567
|
getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
|
|
@@ -12860,7 +12909,7 @@ declare namespace CloudflareWorkersModule {
|
|
|
12860
12909
|
email?(message: ForwardableEmailMessage): void | Promise<void>;
|
|
12861
12910
|
fetch?(request: Request): Response | Promise<Response>;
|
|
12862
12911
|
connect?(socket: Socket): void | Promise<void>;
|
|
12863
|
-
queue?(batch: MessageBatch
|
|
12912
|
+
queue?(batch: MessageBatch): void | Promise<void>;
|
|
12864
12913
|
scheduled?(controller: ScheduledController): void | Promise<void>;
|
|
12865
12914
|
tail?(events: TraceItem[]): void | Promise<void>;
|
|
12866
12915
|
tailStream?(
|
package/oldest/index.ts
CHANGED
|
@@ -470,6 +470,7 @@ export interface ExecutionContext<Props = unknown> {
|
|
|
470
470
|
waitUntil(promise: Promise<any>): void;
|
|
471
471
|
passThroughOnException(): void;
|
|
472
472
|
readonly props: Props;
|
|
473
|
+
cache?: CacheContext;
|
|
473
474
|
}
|
|
474
475
|
export type ExportedHandlerFetchHandler<
|
|
475
476
|
Env = unknown,
|
|
@@ -546,6 +547,23 @@ export interface AlarmInvocationInfo {
|
|
|
546
547
|
export interface Cloudflare {
|
|
547
548
|
readonly compatibilityFlags: Record<string, boolean>;
|
|
548
549
|
}
|
|
550
|
+
export interface CachePurgeError {
|
|
551
|
+
code: number;
|
|
552
|
+
message: string;
|
|
553
|
+
}
|
|
554
|
+
export interface CachePurgeResult {
|
|
555
|
+
success: boolean;
|
|
556
|
+
zoneTag: string;
|
|
557
|
+
errors: CachePurgeError[];
|
|
558
|
+
}
|
|
559
|
+
export interface CachePurgeOptions {
|
|
560
|
+
tags?: string[];
|
|
561
|
+
pathPrefixes?: string[];
|
|
562
|
+
purgeEverything?: boolean;
|
|
563
|
+
}
|
|
564
|
+
export interface CacheContext {
|
|
565
|
+
purge(options: CachePurgeOptions): Promise<CachePurgeResult>;
|
|
566
|
+
}
|
|
549
567
|
export declare abstract class ColoLocalActorNamespace {
|
|
550
568
|
get(actorId: string): Fetcher;
|
|
551
569
|
}
|
|
@@ -10200,6 +10218,10 @@ export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
|
10200
10218
|
inputs: ChatCompletionsInput;
|
|
10201
10219
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10202
10220
|
}
|
|
10221
|
+
export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10222
|
+
inputs: ChatCompletionsInput;
|
|
10223
|
+
postProcessedOutputs: ChatCompletionsOutput;
|
|
10224
|
+
}
|
|
10203
10225
|
export interface AiModels {
|
|
10204
10226
|
"@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
|
|
10205
10227
|
"@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
|
|
@@ -10355,6 +10377,9 @@ export type ChatCompletionsInput = XOR<
|
|
|
10355
10377
|
export interface InferenceUpstreamError extends Error {}
|
|
10356
10378
|
export interface AiInternalError extends Error {}
|
|
10357
10379
|
export type AiModelListType = Record<string, any>;
|
|
10380
|
+
export type AiAsyncBatchResponse = {
|
|
10381
|
+
request_id: string;
|
|
10382
|
+
};
|
|
10358
10383
|
export declare abstract class Ai<
|
|
10359
10384
|
AiModelList extends AiModelListType = AiModels,
|
|
10360
10385
|
> {
|
|
@@ -10373,29 +10398,52 @@ export declare abstract class Ai<
|
|
|
10373
10398
|
* @param autoragId Instance ID
|
|
10374
10399
|
*/
|
|
10375
10400
|
autorag(autoragId: string): AutoRAG;
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
Options extends AiOptions,
|
|
10379
|
-
InputOptions extends AiModelList[Name]["inputs"],
|
|
10380
|
-
>(
|
|
10401
|
+
// Batch request
|
|
10402
|
+
run<Name extends keyof AiModelList>(
|
|
10381
10403
|
model: Name,
|
|
10382
|
-
inputs:
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10404
|
+
inputs: {
|
|
10405
|
+
requests: AiModelList[Name]["inputs"][];
|
|
10406
|
+
},
|
|
10407
|
+
options: AiOptions & {
|
|
10408
|
+
queueRequest: true;
|
|
10409
|
+
},
|
|
10410
|
+
): Promise<AiAsyncBatchResponse>;
|
|
10411
|
+
// Raw response
|
|
10412
|
+
run<Name extends keyof AiModelList>(
|
|
10413
|
+
model: Name,
|
|
10414
|
+
inputs: AiModelList[Name]["inputs"],
|
|
10415
|
+
options: AiOptions & {
|
|
10416
|
+
returnRawResponse: true;
|
|
10417
|
+
},
|
|
10418
|
+
): Promise<Response>;
|
|
10419
|
+
// WebSocket
|
|
10420
|
+
run<Name extends keyof AiModelList>(
|
|
10421
|
+
model: Name,
|
|
10422
|
+
inputs: AiModelList[Name]["inputs"],
|
|
10423
|
+
options: AiOptions & {
|
|
10424
|
+
websocket: true;
|
|
10425
|
+
},
|
|
10426
|
+
): Promise<Response>;
|
|
10427
|
+
// Streaming
|
|
10428
|
+
run<Name extends keyof AiModelList>(
|
|
10429
|
+
model: Name,
|
|
10430
|
+
inputs: AiModelList[Name]["inputs"] & {
|
|
10431
|
+
stream: true;
|
|
10432
|
+
},
|
|
10433
|
+
options?: AiOptions,
|
|
10434
|
+
): Promise<ReadableStream>;
|
|
10435
|
+
// Normal (default) - known model
|
|
10436
|
+
run<Name extends keyof AiModelList>(
|
|
10437
|
+
model: Name,
|
|
10438
|
+
inputs: AiModelList[Name]["inputs"],
|
|
10439
|
+
options?: AiOptions,
|
|
10440
|
+
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
10441
|
+
// Unknown model (gateway fallback)
|
|
10442
|
+
run(
|
|
10443
|
+
model: string & {},
|
|
10444
|
+
inputs: Record<string, unknown>,
|
|
10445
|
+
options?: AiOptions,
|
|
10446
|
+
): Promise<Record<string, unknown>>;
|
|
10399
10447
|
models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
|
|
10400
10448
|
toMarkdown(): ToMarkdownService;
|
|
10401
10449
|
toMarkdown(
|
|
@@ -10524,6 +10572,7 @@ export declare abstract class AiGateway {
|
|
|
10524
10572
|
options?: {
|
|
10525
10573
|
gateway?: UniversalGatewayOptions;
|
|
10526
10574
|
extraHeaders?: object;
|
|
10575
|
+
signal?: AbortSignal;
|
|
10527
10576
|
},
|
|
10528
10577
|
): Promise<Response>;
|
|
10529
10578
|
getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
|
|
@@ -12827,7 +12876,7 @@ export declare namespace CloudflareWorkersModule {
|
|
|
12827
12876
|
email?(message: ForwardableEmailMessage): void | Promise<void>;
|
|
12828
12877
|
fetch?(request: Request): Response | Promise<Response>;
|
|
12829
12878
|
connect?(socket: Socket): void | Promise<void>;
|
|
12830
|
-
queue?(batch: MessageBatch
|
|
12879
|
+
queue?(batch: MessageBatch): void | Promise<void>;
|
|
12831
12880
|
scheduled?(controller: ScheduledController): void | Promise<void>;
|
|
12832
12881
|
tail?(events: TraceItem[]): void | Promise<void>;
|
|
12833
12882
|
tailStream?(
|
package/package.json
CHANGED