@ai-sdk/gateway 3.0.144 → 3.0.146
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/CHANGELOG.md +20 -0
- package/dist/index.d.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +409 -365
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +453 -409
- package/dist/index.mjs.map +1 -1
- package/docs/00-ai-gateway.mdx +1 -1
- package/package.json +5 -5
- package/src/errors/create-gateway-error.ts +12 -2
- package/src/errors/gateway-forbidden-error.ts +14 -0
- package/src/gateway-image-model.ts +7 -1
- package/src/gateway-language-model-settings.ts +5 -0
- package/src/gateway-speech-model.ts +8 -6
- package/src/gateway-transcription-model.ts +7 -2
- package/src/gateway-video-model-settings.ts +2 -0
- package/src/gateway-video-model.ts +7 -1
- package/src/map-gateway-warnings.ts +21 -0
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { APICallError } from "@ai-sdk/provider";
|
|
10
10
|
|
|
11
11
|
// src/errors/create-gateway-error.ts
|
|
12
|
-
import { z as
|
|
12
|
+
import { z as z3 } from "zod/v4";
|
|
13
13
|
|
|
14
14
|
// src/errors/gateway-error.ts
|
|
15
15
|
var marker = "vercel.ai.gateway.error";
|
|
@@ -238,22 +238,33 @@ var GatewayFailedDependencyError = class extends (_b7 = GatewayError, _a7 = symb
|
|
|
238
238
|
};
|
|
239
239
|
|
|
240
240
|
// src/errors/gateway-forbidden-error.ts
|
|
241
|
+
import { z as z2 } from "zod/v4";
|
|
242
|
+
import { lazySchema as lazySchema2, zodSchema as zodSchema2 } from "@ai-sdk/provider-utils";
|
|
241
243
|
var name7 = "GatewayForbiddenError";
|
|
242
244
|
var marker8 = `vercel.ai.gateway.error.${name7}`;
|
|
243
245
|
var symbol8 = Symbol.for(marker8);
|
|
246
|
+
var forbiddenParamSchema = lazySchema2(
|
|
247
|
+
() => zodSchema2(
|
|
248
|
+
z2.object({
|
|
249
|
+
ruleId: z2.string()
|
|
250
|
+
})
|
|
251
|
+
)
|
|
252
|
+
);
|
|
244
253
|
var _a8, _b8;
|
|
245
254
|
var GatewayForbiddenError = class extends (_b8 = GatewayError, _a8 = symbol8, _b8) {
|
|
246
255
|
constructor({
|
|
247
256
|
message = "Forbidden",
|
|
248
257
|
statusCode = 403,
|
|
249
258
|
cause,
|
|
250
|
-
generationId
|
|
259
|
+
generationId,
|
|
260
|
+
ruleId
|
|
251
261
|
} = {}) {
|
|
252
262
|
super({ message, statusCode, cause, generationId });
|
|
253
263
|
this[_a8] = true;
|
|
254
264
|
// used in isInstance
|
|
255
265
|
this.name = name7;
|
|
256
266
|
this.type = "forbidden";
|
|
267
|
+
this.ruleId = ruleId;
|
|
257
268
|
}
|
|
258
269
|
static isInstance(error) {
|
|
259
270
|
return GatewayError.hasMarker(error) && symbol8 in error;
|
|
@@ -289,9 +300,9 @@ var GatewayResponseError = class extends (_b9 = GatewayError, _a9 = symbol9, _b9
|
|
|
289
300
|
|
|
290
301
|
// src/errors/create-gateway-error.ts
|
|
291
302
|
import {
|
|
292
|
-
lazySchema as
|
|
303
|
+
lazySchema as lazySchema3,
|
|
293
304
|
safeValidateTypes,
|
|
294
|
-
zodSchema as
|
|
305
|
+
zodSchema as zodSchema3
|
|
295
306
|
} from "@ai-sdk/provider-utils";
|
|
296
307
|
async function createGatewayErrorFromResponse({
|
|
297
308
|
response,
|
|
@@ -370,13 +381,19 @@ async function createGatewayErrorFromResponse({
|
|
|
370
381
|
cause,
|
|
371
382
|
generationId
|
|
372
383
|
});
|
|
373
|
-
case "forbidden":
|
|
384
|
+
case "forbidden": {
|
|
385
|
+
const ruleResult = await safeValidateTypes({
|
|
386
|
+
value: validatedResponse.error.param,
|
|
387
|
+
schema: forbiddenParamSchema
|
|
388
|
+
});
|
|
374
389
|
return new GatewayForbiddenError({
|
|
375
390
|
message,
|
|
376
391
|
statusCode,
|
|
377
392
|
cause,
|
|
378
|
-
generationId
|
|
393
|
+
generationId,
|
|
394
|
+
ruleId: ruleResult.success ? ruleResult.value.ruleId : void 0
|
|
379
395
|
});
|
|
396
|
+
}
|
|
380
397
|
default:
|
|
381
398
|
return new GatewayInternalServerError({
|
|
382
399
|
message,
|
|
@@ -386,16 +403,16 @@ async function createGatewayErrorFromResponse({
|
|
|
386
403
|
});
|
|
387
404
|
}
|
|
388
405
|
}
|
|
389
|
-
var gatewayErrorResponseSchema =
|
|
390
|
-
() =>
|
|
391
|
-
|
|
392
|
-
error:
|
|
393
|
-
message:
|
|
394
|
-
type:
|
|
395
|
-
param:
|
|
396
|
-
code:
|
|
406
|
+
var gatewayErrorResponseSchema = lazySchema3(
|
|
407
|
+
() => zodSchema3(
|
|
408
|
+
z3.object({
|
|
409
|
+
error: z3.object({
|
|
410
|
+
message: z3.string(),
|
|
411
|
+
type: z3.string().nullish(),
|
|
412
|
+
param: z3.unknown().nullish(),
|
|
413
|
+
code: z3.union([z3.string(), z3.number()]).nullish()
|
|
397
414
|
}),
|
|
398
|
-
generationId:
|
|
415
|
+
generationId: z3.string().nullish()
|
|
399
416
|
})
|
|
400
417
|
)
|
|
401
418
|
);
|
|
@@ -510,11 +527,11 @@ async function asGatewayError(error, authMethod) {
|
|
|
510
527
|
}
|
|
511
528
|
|
|
512
529
|
// src/errors/parse-auth-method.ts
|
|
513
|
-
import { z as
|
|
530
|
+
import { z as z4 } from "zod/v4";
|
|
514
531
|
import {
|
|
515
|
-
lazySchema as
|
|
532
|
+
lazySchema as lazySchema4,
|
|
516
533
|
safeValidateTypes as safeValidateTypes2,
|
|
517
|
-
zodSchema as
|
|
534
|
+
zodSchema as zodSchema4
|
|
518
535
|
} from "@ai-sdk/provider-utils";
|
|
519
536
|
var GATEWAY_AUTH_METHOD_HEADER = "ai-gateway-auth-method";
|
|
520
537
|
async function parseAuthMethod(headers) {
|
|
@@ -524,8 +541,8 @@ async function parseAuthMethod(headers) {
|
|
|
524
541
|
});
|
|
525
542
|
return result.success ? result.value : void 0;
|
|
526
543
|
}
|
|
527
|
-
var gatewayAuthMethodSchema =
|
|
528
|
-
() =>
|
|
544
|
+
var gatewayAuthMethodSchema = lazySchema4(
|
|
545
|
+
() => zodSchema4(z4.union([z4.literal("api-key"), z4.literal("oidc")]))
|
|
529
546
|
);
|
|
530
547
|
|
|
531
548
|
// src/gateway-fetch-metadata.ts
|
|
@@ -533,11 +550,11 @@ import {
|
|
|
533
550
|
createJsonErrorResponseHandler,
|
|
534
551
|
createJsonResponseHandler,
|
|
535
552
|
getFromApi,
|
|
536
|
-
lazySchema as
|
|
553
|
+
lazySchema as lazySchema5,
|
|
537
554
|
resolve,
|
|
538
|
-
zodSchema as
|
|
555
|
+
zodSchema as zodSchema5
|
|
539
556
|
} from "@ai-sdk/provider-utils";
|
|
540
|
-
import { z as
|
|
557
|
+
import { z as z5 } from "zod/v4";
|
|
541
558
|
|
|
542
559
|
// src/gateway-model-entry.ts
|
|
543
560
|
var KNOWN_MODEL_TYPES = [
|
|
@@ -564,7 +581,7 @@ var GatewayFetchMetadata = class {
|
|
|
564
581
|
gatewayAvailableModelsResponseSchema
|
|
565
582
|
),
|
|
566
583
|
failedResponseHandler: createJsonErrorResponseHandler({
|
|
567
|
-
errorSchema:
|
|
584
|
+
errorSchema: z5.any(),
|
|
568
585
|
errorToMessage: (data) => data
|
|
569
586
|
}),
|
|
570
587
|
fetch: this.config.fetch
|
|
@@ -584,7 +601,7 @@ var GatewayFetchMetadata = class {
|
|
|
584
601
|
gatewayCreditsResponseSchema
|
|
585
602
|
),
|
|
586
603
|
failedResponseHandler: createJsonErrorResponseHandler({
|
|
587
|
-
errorSchema:
|
|
604
|
+
errorSchema: z5.any(),
|
|
588
605
|
errorToMessage: (data) => data
|
|
589
606
|
}),
|
|
590
607
|
fetch: this.config.fetch
|
|
@@ -595,19 +612,19 @@ var GatewayFetchMetadata = class {
|
|
|
595
612
|
}
|
|
596
613
|
}
|
|
597
614
|
};
|
|
598
|
-
var gatewayAvailableModelsResponseSchema =
|
|
599
|
-
() =>
|
|
600
|
-
|
|
601
|
-
models:
|
|
602
|
-
|
|
603
|
-
id:
|
|
604
|
-
name:
|
|
605
|
-
description:
|
|
606
|
-
pricing:
|
|
607
|
-
input:
|
|
608
|
-
output:
|
|
609
|
-
input_cache_read:
|
|
610
|
-
input_cache_write:
|
|
615
|
+
var gatewayAvailableModelsResponseSchema = lazySchema5(
|
|
616
|
+
() => zodSchema5(
|
|
617
|
+
z5.object({
|
|
618
|
+
models: z5.array(
|
|
619
|
+
z5.object({
|
|
620
|
+
id: z5.string(),
|
|
621
|
+
name: z5.string(),
|
|
622
|
+
description: z5.string().nullish(),
|
|
623
|
+
pricing: z5.object({
|
|
624
|
+
input: z5.string(),
|
|
625
|
+
output: z5.string(),
|
|
626
|
+
input_cache_read: z5.string().nullish(),
|
|
627
|
+
input_cache_write: z5.string().nullish()
|
|
611
628
|
}).transform(
|
|
612
629
|
({ input, output, input_cache_read, input_cache_write }) => ({
|
|
613
630
|
input,
|
|
@@ -616,12 +633,12 @@ var gatewayAvailableModelsResponseSchema = lazySchema4(
|
|
|
616
633
|
...input_cache_write ? { cacheCreationInputTokens: input_cache_write } : {}
|
|
617
634
|
})
|
|
618
635
|
).nullish(),
|
|
619
|
-
specification:
|
|
620
|
-
specificationVersion:
|
|
621
|
-
provider:
|
|
622
|
-
modelId:
|
|
636
|
+
specification: z5.object({
|
|
637
|
+
specificationVersion: z5.literal("v3"),
|
|
638
|
+
provider: z5.string(),
|
|
639
|
+
modelId: z5.string()
|
|
623
640
|
}),
|
|
624
|
-
modelType:
|
|
641
|
+
modelType: z5.string().nullish()
|
|
625
642
|
})
|
|
626
643
|
).transform(
|
|
627
644
|
(models) => models.filter(
|
|
@@ -631,11 +648,11 @@ var gatewayAvailableModelsResponseSchema = lazySchema4(
|
|
|
631
648
|
})
|
|
632
649
|
)
|
|
633
650
|
);
|
|
634
|
-
var gatewayCreditsResponseSchema =
|
|
635
|
-
() =>
|
|
636
|
-
|
|
637
|
-
balance:
|
|
638
|
-
total_used:
|
|
651
|
+
var gatewayCreditsResponseSchema = lazySchema5(
|
|
652
|
+
() => zodSchema5(
|
|
653
|
+
z5.object({
|
|
654
|
+
balance: z5.string(),
|
|
655
|
+
total_used: z5.string()
|
|
639
656
|
}).transform(({ balance, total_used }) => ({
|
|
640
657
|
balance,
|
|
641
658
|
totalUsed: total_used
|
|
@@ -648,11 +665,11 @@ import {
|
|
|
648
665
|
createJsonErrorResponseHandler as createJsonErrorResponseHandler2,
|
|
649
666
|
createJsonResponseHandler as createJsonResponseHandler2,
|
|
650
667
|
getFromApi as getFromApi2,
|
|
651
|
-
lazySchema as
|
|
668
|
+
lazySchema as lazySchema6,
|
|
652
669
|
resolve as resolve2,
|
|
653
|
-
zodSchema as
|
|
670
|
+
zodSchema as zodSchema6
|
|
654
671
|
} from "@ai-sdk/provider-utils";
|
|
655
|
-
import { z as
|
|
672
|
+
import { z as z6 } from "zod/v4";
|
|
656
673
|
var GatewaySpendReport = class {
|
|
657
674
|
constructor(config) {
|
|
658
675
|
this.config = config;
|
|
@@ -691,7 +708,7 @@ var GatewaySpendReport = class {
|
|
|
691
708
|
gatewaySpendReportResponseSchema
|
|
692
709
|
),
|
|
693
710
|
failedResponseHandler: createJsonErrorResponseHandler2({
|
|
694
|
-
errorSchema:
|
|
711
|
+
errorSchema: z6.any(),
|
|
695
712
|
errorToMessage: (data) => data
|
|
696
713
|
}),
|
|
697
714
|
fetch: this.config.fetch
|
|
@@ -702,26 +719,26 @@ var GatewaySpendReport = class {
|
|
|
702
719
|
}
|
|
703
720
|
}
|
|
704
721
|
};
|
|
705
|
-
var gatewaySpendReportResponseSchema =
|
|
706
|
-
() =>
|
|
707
|
-
|
|
708
|
-
results:
|
|
709
|
-
|
|
710
|
-
day:
|
|
711
|
-
hour:
|
|
712
|
-
user:
|
|
713
|
-
model:
|
|
714
|
-
tag:
|
|
715
|
-
provider:
|
|
716
|
-
credential_type:
|
|
717
|
-
total_cost:
|
|
718
|
-
market_cost:
|
|
719
|
-
input_tokens:
|
|
720
|
-
output_tokens:
|
|
721
|
-
cached_input_tokens:
|
|
722
|
-
cache_creation_input_tokens:
|
|
723
|
-
reasoning_tokens:
|
|
724
|
-
request_count:
|
|
722
|
+
var gatewaySpendReportResponseSchema = lazySchema6(
|
|
723
|
+
() => zodSchema6(
|
|
724
|
+
z6.object({
|
|
725
|
+
results: z6.array(
|
|
726
|
+
z6.object({
|
|
727
|
+
day: z6.string().optional(),
|
|
728
|
+
hour: z6.string().optional(),
|
|
729
|
+
user: z6.string().optional(),
|
|
730
|
+
model: z6.string().optional(),
|
|
731
|
+
tag: z6.string().optional(),
|
|
732
|
+
provider: z6.string().optional(),
|
|
733
|
+
credential_type: z6.enum(["byok", "system"]).optional(),
|
|
734
|
+
total_cost: z6.number(),
|
|
735
|
+
market_cost: z6.number().optional(),
|
|
736
|
+
input_tokens: z6.number().optional(),
|
|
737
|
+
output_tokens: z6.number().optional(),
|
|
738
|
+
cached_input_tokens: z6.number().optional(),
|
|
739
|
+
cache_creation_input_tokens: z6.number().optional(),
|
|
740
|
+
reasoning_tokens: z6.number().optional(),
|
|
741
|
+
request_count: z6.number().optional()
|
|
725
742
|
}).transform(
|
|
726
743
|
({
|
|
727
744
|
credential_type,
|
|
@@ -757,11 +774,11 @@ import {
|
|
|
757
774
|
createJsonErrorResponseHandler as createJsonErrorResponseHandler3,
|
|
758
775
|
createJsonResponseHandler as createJsonResponseHandler3,
|
|
759
776
|
getFromApi as getFromApi3,
|
|
760
|
-
lazySchema as
|
|
777
|
+
lazySchema as lazySchema7,
|
|
761
778
|
resolve as resolve3,
|
|
762
|
-
zodSchema as
|
|
779
|
+
zodSchema as zodSchema7
|
|
763
780
|
} from "@ai-sdk/provider-utils";
|
|
764
|
-
import { z as
|
|
781
|
+
import { z as z7 } from "zod/v4";
|
|
765
782
|
var GatewayGenerationInfoFetcher = class {
|
|
766
783
|
constructor(config) {
|
|
767
784
|
this.config = config;
|
|
@@ -776,7 +793,7 @@ var GatewayGenerationInfoFetcher = class {
|
|
|
776
793
|
gatewayGenerationInfoResponseSchema
|
|
777
794
|
),
|
|
778
795
|
failedResponseHandler: createJsonErrorResponseHandler3({
|
|
779
|
-
errorSchema:
|
|
796
|
+
errorSchema: z7.any(),
|
|
780
797
|
errorToMessage: (data) => data
|
|
781
798
|
}),
|
|
782
799
|
fetch: this.config.fetch
|
|
@@ -787,28 +804,28 @@ var GatewayGenerationInfoFetcher = class {
|
|
|
787
804
|
}
|
|
788
805
|
}
|
|
789
806
|
};
|
|
790
|
-
var gatewayGenerationInfoResponseSchema =
|
|
791
|
-
() =>
|
|
792
|
-
|
|
793
|
-
data:
|
|
794
|
-
id:
|
|
795
|
-
total_cost:
|
|
796
|
-
upstream_inference_cost:
|
|
797
|
-
usage:
|
|
798
|
-
created_at:
|
|
799
|
-
model:
|
|
800
|
-
is_byok:
|
|
801
|
-
provider_name:
|
|
802
|
-
streamed:
|
|
803
|
-
finish_reason:
|
|
804
|
-
latency:
|
|
805
|
-
generation_time:
|
|
806
|
-
native_tokens_prompt:
|
|
807
|
-
native_tokens_completion:
|
|
808
|
-
native_tokens_reasoning:
|
|
809
|
-
native_tokens_cached:
|
|
810
|
-
native_tokens_cache_creation:
|
|
811
|
-
billable_web_search_calls:
|
|
807
|
+
var gatewayGenerationInfoResponseSchema = lazySchema7(
|
|
808
|
+
() => zodSchema7(
|
|
809
|
+
z7.object({
|
|
810
|
+
data: z7.object({
|
|
811
|
+
id: z7.string(),
|
|
812
|
+
total_cost: z7.number(),
|
|
813
|
+
upstream_inference_cost: z7.number(),
|
|
814
|
+
usage: z7.number(),
|
|
815
|
+
created_at: z7.string(),
|
|
816
|
+
model: z7.string(),
|
|
817
|
+
is_byok: z7.boolean(),
|
|
818
|
+
provider_name: z7.string(),
|
|
819
|
+
streamed: z7.boolean(),
|
|
820
|
+
finish_reason: z7.string(),
|
|
821
|
+
latency: z7.number(),
|
|
822
|
+
generation_time: z7.number(),
|
|
823
|
+
native_tokens_prompt: z7.number(),
|
|
824
|
+
native_tokens_completion: z7.number(),
|
|
825
|
+
native_tokens_reasoning: z7.number(),
|
|
826
|
+
native_tokens_cached: z7.number(),
|
|
827
|
+
native_tokens_cache_creation: z7.number(),
|
|
828
|
+
billable_web_search_calls: z7.number()
|
|
812
829
|
}).transform(
|
|
813
830
|
({
|
|
814
831
|
total_cost,
|
|
@@ -855,7 +872,7 @@ import {
|
|
|
855
872
|
postJsonToApi,
|
|
856
873
|
resolve as resolve4
|
|
857
874
|
} from "@ai-sdk/provider-utils";
|
|
858
|
-
import { z as
|
|
875
|
+
import { z as z8 } from "zod/v4";
|
|
859
876
|
var GatewayLanguageModel = class {
|
|
860
877
|
constructor(modelId, config) {
|
|
861
878
|
this.modelId = modelId;
|
|
@@ -891,9 +908,9 @@ var GatewayLanguageModel = class {
|
|
|
891
908
|
await resolve4(this.config.o11yHeaders)
|
|
892
909
|
),
|
|
893
910
|
body: args,
|
|
894
|
-
successfulResponseHandler: createJsonResponseHandler4(
|
|
911
|
+
successfulResponseHandler: createJsonResponseHandler4(z8.any()),
|
|
895
912
|
failedResponseHandler: createJsonErrorResponseHandler4({
|
|
896
|
-
errorSchema:
|
|
913
|
+
errorSchema: z8.any(),
|
|
897
914
|
errorToMessage: (data) => data
|
|
898
915
|
}),
|
|
899
916
|
...abortSignal && { abortSignal },
|
|
@@ -923,9 +940,9 @@ var GatewayLanguageModel = class {
|
|
|
923
940
|
await resolve4(this.config.o11yHeaders)
|
|
924
941
|
),
|
|
925
942
|
body: args,
|
|
926
|
-
successfulResponseHandler: createEventSourceResponseHandler(
|
|
943
|
+
successfulResponseHandler: createEventSourceResponseHandler(z8.any()),
|
|
927
944
|
failedResponseHandler: createJsonErrorResponseHandler4({
|
|
928
|
-
errorSchema:
|
|
945
|
+
errorSchema: z8.any(),
|
|
929
946
|
errorToMessage: (data) => data
|
|
930
947
|
}),
|
|
931
948
|
...abortSignal && { abortSignal },
|
|
@@ -1007,12 +1024,12 @@ import {
|
|
|
1007
1024
|
combineHeaders as combineHeaders2,
|
|
1008
1025
|
createJsonErrorResponseHandler as createJsonErrorResponseHandler5,
|
|
1009
1026
|
createJsonResponseHandler as createJsonResponseHandler5,
|
|
1010
|
-
lazySchema as
|
|
1027
|
+
lazySchema as lazySchema8,
|
|
1011
1028
|
postJsonToApi as postJsonToApi2,
|
|
1012
1029
|
resolve as resolve5,
|
|
1013
|
-
zodSchema as
|
|
1030
|
+
zodSchema as zodSchema8
|
|
1014
1031
|
} from "@ai-sdk/provider-utils";
|
|
1015
|
-
import { z as
|
|
1032
|
+
import { z as z9 } from "zod/v4";
|
|
1016
1033
|
var GatewayEmbeddingModel = class {
|
|
1017
1034
|
constructor(modelId, config) {
|
|
1018
1035
|
this.modelId = modelId;
|
|
@@ -1053,7 +1070,7 @@ var GatewayEmbeddingModel = class {
|
|
|
1053
1070
|
gatewayEmbeddingResponseSchema
|
|
1054
1071
|
),
|
|
1055
1072
|
failedResponseHandler: createJsonErrorResponseHandler5({
|
|
1056
|
-
errorSchema:
|
|
1073
|
+
errorSchema: z9.any(),
|
|
1057
1074
|
errorToMessage: (data) => data
|
|
1058
1075
|
}),
|
|
1059
1076
|
...abortSignal && { abortSignal },
|
|
@@ -1080,29 +1097,29 @@ var GatewayEmbeddingModel = class {
|
|
|
1080
1097
|
};
|
|
1081
1098
|
}
|
|
1082
1099
|
};
|
|
1083
|
-
var gatewayEmbeddingWarningSchema =
|
|
1084
|
-
|
|
1085
|
-
type:
|
|
1086
|
-
feature:
|
|
1087
|
-
details:
|
|
1100
|
+
var gatewayEmbeddingWarningSchema = z9.discriminatedUnion("type", [
|
|
1101
|
+
z9.object({
|
|
1102
|
+
type: z9.literal("unsupported"),
|
|
1103
|
+
feature: z9.string(),
|
|
1104
|
+
details: z9.string().optional()
|
|
1088
1105
|
}),
|
|
1089
|
-
|
|
1090
|
-
type:
|
|
1091
|
-
feature:
|
|
1092
|
-
details:
|
|
1106
|
+
z9.object({
|
|
1107
|
+
type: z9.literal("compatibility"),
|
|
1108
|
+
feature: z9.string(),
|
|
1109
|
+
details: z9.string().optional()
|
|
1093
1110
|
}),
|
|
1094
|
-
|
|
1095
|
-
type:
|
|
1096
|
-
message:
|
|
1111
|
+
z9.object({
|
|
1112
|
+
type: z9.literal("other"),
|
|
1113
|
+
message: z9.string()
|
|
1097
1114
|
})
|
|
1098
1115
|
]);
|
|
1099
|
-
var gatewayEmbeddingResponseSchema =
|
|
1100
|
-
() =>
|
|
1101
|
-
|
|
1102
|
-
embeddings:
|
|
1103
|
-
usage:
|
|
1104
|
-
warnings:
|
|
1105
|
-
providerMetadata:
|
|
1116
|
+
var gatewayEmbeddingResponseSchema = lazySchema8(
|
|
1117
|
+
() => zodSchema8(
|
|
1118
|
+
z9.object({
|
|
1119
|
+
embeddings: z9.array(z9.array(z9.number())),
|
|
1120
|
+
usage: z9.object({ tokens: z9.number() }).nullish(),
|
|
1121
|
+
warnings: z9.array(gatewayEmbeddingWarningSchema).optional(),
|
|
1122
|
+
providerMetadata: z9.record(z9.string(), z9.record(z9.string(), z9.unknown())).optional()
|
|
1106
1123
|
})
|
|
1107
1124
|
)
|
|
1108
1125
|
);
|
|
@@ -1116,7 +1133,16 @@ import {
|
|
|
1116
1133
|
postJsonToApi as postJsonToApi3,
|
|
1117
1134
|
resolve as resolve6
|
|
1118
1135
|
} from "@ai-sdk/provider-utils";
|
|
1119
|
-
import { z as
|
|
1136
|
+
import { z as z10 } from "zod/v4";
|
|
1137
|
+
|
|
1138
|
+
// src/map-gateway-warnings.ts
|
|
1139
|
+
function mapGatewayWarnings(warnings) {
|
|
1140
|
+
return (warnings != null ? warnings : []).map(
|
|
1141
|
+
(warning) => warning.type === "deprecated" ? { type: "other", message: warning.message } : warning
|
|
1142
|
+
);
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
// src/gateway-image-model.ts
|
|
1120
1146
|
var GatewayImageModel = class {
|
|
1121
1147
|
constructor(modelId, config) {
|
|
1122
1148
|
this.modelId = modelId;
|
|
@@ -1140,7 +1166,7 @@ var GatewayImageModel = class {
|
|
|
1140
1166
|
headers,
|
|
1141
1167
|
abortSignal
|
|
1142
1168
|
}) {
|
|
1143
|
-
var _a11, _b11, _c
|
|
1169
|
+
var _a11, _b11, _c;
|
|
1144
1170
|
const resolvedHeaders = await resolve6(this.config.headers());
|
|
1145
1171
|
try {
|
|
1146
1172
|
const {
|
|
@@ -1171,7 +1197,7 @@ var GatewayImageModel = class {
|
|
|
1171
1197
|
gatewayImageResponseSchema
|
|
1172
1198
|
),
|
|
1173
1199
|
failedResponseHandler: createJsonErrorResponseHandler6({
|
|
1174
|
-
errorSchema:
|
|
1200
|
+
errorSchema: z10.any(),
|
|
1175
1201
|
errorToMessage: (data) => data
|
|
1176
1202
|
}),
|
|
1177
1203
|
...abortSignal && { abortSignal },
|
|
@@ -1180,7 +1206,7 @@ var GatewayImageModel = class {
|
|
|
1180
1206
|
return {
|
|
1181
1207
|
images: responseBody.images,
|
|
1182
1208
|
// Always base64 strings from server
|
|
1183
|
-
warnings: (
|
|
1209
|
+
warnings: mapGatewayWarnings(responseBody.warnings),
|
|
1184
1210
|
providerMetadata: responseBody.providerMetadata,
|
|
1185
1211
|
response: {
|
|
1186
1212
|
timestamp: /* @__PURE__ */ new Date(),
|
|
@@ -1189,9 +1215,9 @@ var GatewayImageModel = class {
|
|
|
1189
1215
|
},
|
|
1190
1216
|
...responseBody.usage != null && {
|
|
1191
1217
|
usage: {
|
|
1192
|
-
inputTokens: (
|
|
1193
|
-
outputTokens: (
|
|
1194
|
-
totalTokens: (
|
|
1218
|
+
inputTokens: (_a11 = responseBody.usage.inputTokens) != null ? _a11 : void 0,
|
|
1219
|
+
outputTokens: (_b11 = responseBody.usage.outputTokens) != null ? _b11 : void 0,
|
|
1220
|
+
totalTokens: (_c = responseBody.usage.totalTokens) != null ? _c : void 0
|
|
1195
1221
|
}
|
|
1196
1222
|
}
|
|
1197
1223
|
};
|
|
@@ -1218,35 +1244,40 @@ function maybeEncodeImageFile(file) {
|
|
|
1218
1244
|
}
|
|
1219
1245
|
return file;
|
|
1220
1246
|
}
|
|
1221
|
-
var providerMetadataEntrySchema =
|
|
1222
|
-
images:
|
|
1223
|
-
}).catchall(
|
|
1224
|
-
var gatewayImageWarningSchema =
|
|
1225
|
-
|
|
1226
|
-
type:
|
|
1227
|
-
feature:
|
|
1228
|
-
details:
|
|
1247
|
+
var providerMetadataEntrySchema = z10.object({
|
|
1248
|
+
images: z10.array(z10.unknown()).optional()
|
|
1249
|
+
}).catchall(z10.unknown());
|
|
1250
|
+
var gatewayImageWarningSchema = z10.discriminatedUnion("type", [
|
|
1251
|
+
z10.object({
|
|
1252
|
+
type: z10.literal("unsupported"),
|
|
1253
|
+
feature: z10.string(),
|
|
1254
|
+
details: z10.string().optional()
|
|
1229
1255
|
}),
|
|
1230
|
-
|
|
1231
|
-
type:
|
|
1232
|
-
feature:
|
|
1233
|
-
details:
|
|
1256
|
+
z10.object({
|
|
1257
|
+
type: z10.literal("compatibility"),
|
|
1258
|
+
feature: z10.string(),
|
|
1259
|
+
details: z10.string().optional()
|
|
1234
1260
|
}),
|
|
1235
|
-
|
|
1236
|
-
type:
|
|
1237
|
-
|
|
1261
|
+
z10.object({
|
|
1262
|
+
type: z10.literal("deprecated"),
|
|
1263
|
+
setting: z10.string(),
|
|
1264
|
+
message: z10.string()
|
|
1265
|
+
}),
|
|
1266
|
+
z10.object({
|
|
1267
|
+
type: z10.literal("other"),
|
|
1268
|
+
message: z10.string()
|
|
1238
1269
|
})
|
|
1239
1270
|
]);
|
|
1240
|
-
var gatewayImageUsageSchema =
|
|
1241
|
-
inputTokens:
|
|
1242
|
-
outputTokens:
|
|
1243
|
-
totalTokens:
|
|
1271
|
+
var gatewayImageUsageSchema = z10.object({
|
|
1272
|
+
inputTokens: z10.number().nullish(),
|
|
1273
|
+
outputTokens: z10.number().nullish(),
|
|
1274
|
+
totalTokens: z10.number().nullish()
|
|
1244
1275
|
});
|
|
1245
|
-
var gatewayImageResponseSchema =
|
|
1246
|
-
images:
|
|
1276
|
+
var gatewayImageResponseSchema = z10.object({
|
|
1277
|
+
images: z10.array(z10.string()),
|
|
1247
1278
|
// Always base64 strings over the wire
|
|
1248
|
-
warnings:
|
|
1249
|
-
providerMetadata:
|
|
1279
|
+
warnings: z10.array(gatewayImageWarningSchema).optional(),
|
|
1280
|
+
providerMetadata: z10.record(z10.string(), providerMetadataEntrySchema).optional(),
|
|
1250
1281
|
usage: gatewayImageUsageSchema.optional()
|
|
1251
1282
|
});
|
|
1252
1283
|
|
|
@@ -1262,7 +1293,7 @@ import {
|
|
|
1262
1293
|
postJsonToApi as postJsonToApi4,
|
|
1263
1294
|
resolve as resolve7
|
|
1264
1295
|
} from "@ai-sdk/provider-utils";
|
|
1265
|
-
import { z as
|
|
1296
|
+
import { z as z11 } from "zod/v4";
|
|
1266
1297
|
var GatewayVideoModel = class {
|
|
1267
1298
|
constructor(modelId, config) {
|
|
1268
1299
|
this.modelId = modelId;
|
|
@@ -1290,7 +1321,6 @@ var GatewayVideoModel = class {
|
|
|
1290
1321
|
headers,
|
|
1291
1322
|
abortSignal
|
|
1292
1323
|
}) {
|
|
1293
|
-
var _a11;
|
|
1294
1324
|
const resolvedHeaders = await resolve7(this.config.headers());
|
|
1295
1325
|
try {
|
|
1296
1326
|
const { responseHeaders, value: responseBody } = await postJsonToApi4({
|
|
@@ -1390,7 +1420,7 @@ var GatewayVideoModel = class {
|
|
|
1390
1420
|
};
|
|
1391
1421
|
},
|
|
1392
1422
|
failedResponseHandler: createJsonErrorResponseHandler7({
|
|
1393
|
-
errorSchema:
|
|
1423
|
+
errorSchema: z11.any(),
|
|
1394
1424
|
errorToMessage: (data) => data
|
|
1395
1425
|
}),
|
|
1396
1426
|
...abortSignal && { abortSignal },
|
|
@@ -1398,7 +1428,7 @@ var GatewayVideoModel = class {
|
|
|
1398
1428
|
});
|
|
1399
1429
|
return {
|
|
1400
1430
|
videos: responseBody.videos,
|
|
1401
|
-
warnings: (
|
|
1431
|
+
warnings: mapGatewayWarnings(responseBody.warnings),
|
|
1402
1432
|
providerMetadata: responseBody.providerMetadata,
|
|
1403
1433
|
response: {
|
|
1404
1434
|
timestamp: /* @__PURE__ */ new Date(),
|
|
@@ -1429,50 +1459,55 @@ function maybeEncodeVideoFile(file) {
|
|
|
1429
1459
|
}
|
|
1430
1460
|
return file;
|
|
1431
1461
|
}
|
|
1432
|
-
var providerMetadataEntrySchema2 =
|
|
1433
|
-
videos:
|
|
1434
|
-
}).catchall(
|
|
1435
|
-
var gatewayVideoDataSchema =
|
|
1436
|
-
|
|
1437
|
-
type:
|
|
1438
|
-
url:
|
|
1439
|
-
mediaType:
|
|
1462
|
+
var providerMetadataEntrySchema2 = z11.object({
|
|
1463
|
+
videos: z11.array(z11.unknown()).optional()
|
|
1464
|
+
}).catchall(z11.unknown());
|
|
1465
|
+
var gatewayVideoDataSchema = z11.union([
|
|
1466
|
+
z11.object({
|
|
1467
|
+
type: z11.literal("url"),
|
|
1468
|
+
url: z11.string(),
|
|
1469
|
+
mediaType: z11.string()
|
|
1440
1470
|
}),
|
|
1441
|
-
|
|
1442
|
-
type:
|
|
1443
|
-
data:
|
|
1444
|
-
mediaType:
|
|
1471
|
+
z11.object({
|
|
1472
|
+
type: z11.literal("base64"),
|
|
1473
|
+
data: z11.string(),
|
|
1474
|
+
mediaType: z11.string()
|
|
1445
1475
|
})
|
|
1446
1476
|
]);
|
|
1447
|
-
var gatewayVideoWarningSchema =
|
|
1448
|
-
|
|
1449
|
-
type:
|
|
1450
|
-
feature:
|
|
1451
|
-
details:
|
|
1477
|
+
var gatewayVideoWarningSchema = z11.discriminatedUnion("type", [
|
|
1478
|
+
z11.object({
|
|
1479
|
+
type: z11.literal("unsupported"),
|
|
1480
|
+
feature: z11.string(),
|
|
1481
|
+
details: z11.string().optional()
|
|
1452
1482
|
}),
|
|
1453
|
-
|
|
1454
|
-
type:
|
|
1455
|
-
feature:
|
|
1456
|
-
details:
|
|
1483
|
+
z11.object({
|
|
1484
|
+
type: z11.literal("compatibility"),
|
|
1485
|
+
feature: z11.string(),
|
|
1486
|
+
details: z11.string().optional()
|
|
1457
1487
|
}),
|
|
1458
|
-
|
|
1459
|
-
type:
|
|
1460
|
-
|
|
1488
|
+
z11.object({
|
|
1489
|
+
type: z11.literal("deprecated"),
|
|
1490
|
+
setting: z11.string(),
|
|
1491
|
+
message: z11.string()
|
|
1492
|
+
}),
|
|
1493
|
+
z11.object({
|
|
1494
|
+
type: z11.literal("other"),
|
|
1495
|
+
message: z11.string()
|
|
1461
1496
|
})
|
|
1462
1497
|
]);
|
|
1463
|
-
var gatewayVideoEventSchema =
|
|
1464
|
-
|
|
1465
|
-
type:
|
|
1466
|
-
videos:
|
|
1467
|
-
warnings:
|
|
1468
|
-
providerMetadata:
|
|
1498
|
+
var gatewayVideoEventSchema = z11.discriminatedUnion("type", [
|
|
1499
|
+
z11.object({
|
|
1500
|
+
type: z11.literal("result"),
|
|
1501
|
+
videos: z11.array(gatewayVideoDataSchema),
|
|
1502
|
+
warnings: z11.array(gatewayVideoWarningSchema).optional(),
|
|
1503
|
+
providerMetadata: z11.record(z11.string(), providerMetadataEntrySchema2).optional()
|
|
1469
1504
|
}),
|
|
1470
|
-
|
|
1471
|
-
type:
|
|
1472
|
-
message:
|
|
1473
|
-
errorType:
|
|
1474
|
-
statusCode:
|
|
1475
|
-
param:
|
|
1505
|
+
z11.object({
|
|
1506
|
+
type: z11.literal("error"),
|
|
1507
|
+
message: z11.string(),
|
|
1508
|
+
errorType: z11.string(),
|
|
1509
|
+
statusCode: z11.number(),
|
|
1510
|
+
param: z11.unknown().nullable()
|
|
1476
1511
|
})
|
|
1477
1512
|
]);
|
|
1478
1513
|
|
|
@@ -1481,12 +1516,12 @@ import {
|
|
|
1481
1516
|
combineHeaders as combineHeaders5,
|
|
1482
1517
|
createJsonErrorResponseHandler as createJsonErrorResponseHandler8,
|
|
1483
1518
|
createJsonResponseHandler as createJsonResponseHandler7,
|
|
1484
|
-
lazySchema as
|
|
1519
|
+
lazySchema as lazySchema9,
|
|
1485
1520
|
postJsonToApi as postJsonToApi5,
|
|
1486
1521
|
resolve as resolve8,
|
|
1487
|
-
zodSchema as
|
|
1522
|
+
zodSchema as zodSchema9
|
|
1488
1523
|
} from "@ai-sdk/provider-utils";
|
|
1489
|
-
import { z as
|
|
1524
|
+
import { z as z12 } from "zod/v4";
|
|
1490
1525
|
var GatewayRerankingModel = class {
|
|
1491
1526
|
constructor(modelId, config) {
|
|
1492
1527
|
this.modelId = modelId;
|
|
@@ -1529,7 +1564,7 @@ var GatewayRerankingModel = class {
|
|
|
1529
1564
|
gatewayRerankingResponseSchema
|
|
1530
1565
|
),
|
|
1531
1566
|
failedResponseHandler: createJsonErrorResponseHandler8({
|
|
1532
|
-
errorSchema:
|
|
1567
|
+
errorSchema: z12.any(),
|
|
1533
1568
|
errorToMessage: (data) => data
|
|
1534
1569
|
}),
|
|
1535
1570
|
...abortSignal && { abortSignal },
|
|
@@ -1555,33 +1590,33 @@ var GatewayRerankingModel = class {
|
|
|
1555
1590
|
};
|
|
1556
1591
|
}
|
|
1557
1592
|
};
|
|
1558
|
-
var gatewayRerankingWarningSchema =
|
|
1559
|
-
|
|
1560
|
-
type:
|
|
1561
|
-
feature:
|
|
1562
|
-
details:
|
|
1593
|
+
var gatewayRerankingWarningSchema = z12.discriminatedUnion("type", [
|
|
1594
|
+
z12.object({
|
|
1595
|
+
type: z12.literal("unsupported"),
|
|
1596
|
+
feature: z12.string(),
|
|
1597
|
+
details: z12.string().optional()
|
|
1563
1598
|
}),
|
|
1564
|
-
|
|
1565
|
-
type:
|
|
1566
|
-
feature:
|
|
1567
|
-
details:
|
|
1599
|
+
z12.object({
|
|
1600
|
+
type: z12.literal("compatibility"),
|
|
1601
|
+
feature: z12.string(),
|
|
1602
|
+
details: z12.string().optional()
|
|
1568
1603
|
}),
|
|
1569
|
-
|
|
1570
|
-
type:
|
|
1571
|
-
message:
|
|
1604
|
+
z12.object({
|
|
1605
|
+
type: z12.literal("other"),
|
|
1606
|
+
message: z12.string()
|
|
1572
1607
|
})
|
|
1573
1608
|
]);
|
|
1574
|
-
var gatewayRerankingResponseSchema =
|
|
1575
|
-
() =>
|
|
1576
|
-
|
|
1577
|
-
ranking:
|
|
1578
|
-
|
|
1579
|
-
index:
|
|
1580
|
-
relevanceScore:
|
|
1609
|
+
var gatewayRerankingResponseSchema = lazySchema9(
|
|
1610
|
+
() => zodSchema9(
|
|
1611
|
+
z12.object({
|
|
1612
|
+
ranking: z12.array(
|
|
1613
|
+
z12.object({
|
|
1614
|
+
index: z12.number(),
|
|
1615
|
+
relevanceScore: z12.number()
|
|
1581
1616
|
})
|
|
1582
1617
|
),
|
|
1583
|
-
warnings:
|
|
1584
|
-
providerMetadata:
|
|
1618
|
+
warnings: z12.array(gatewayRerankingWarningSchema).optional(),
|
|
1619
|
+
providerMetadata: z12.record(z12.string(), z12.record(z12.string(), z12.unknown())).optional()
|
|
1585
1620
|
})
|
|
1586
1621
|
)
|
|
1587
1622
|
);
|
|
@@ -1594,7 +1629,7 @@ import {
|
|
|
1594
1629
|
postJsonToApi as postJsonToApi6,
|
|
1595
1630
|
resolve as resolve9
|
|
1596
1631
|
} from "@ai-sdk/provider-utils";
|
|
1597
|
-
import { z as
|
|
1632
|
+
import { z as z13 } from "zod/v4";
|
|
1598
1633
|
var GatewaySpeechModel = class {
|
|
1599
1634
|
constructor(modelId, config) {
|
|
1600
1635
|
this.modelId = modelId;
|
|
@@ -1615,7 +1650,6 @@ var GatewaySpeechModel = class {
|
|
|
1615
1650
|
headers,
|
|
1616
1651
|
abortSignal
|
|
1617
1652
|
}) {
|
|
1618
|
-
var _a11;
|
|
1619
1653
|
const resolvedHeaders = await resolve9(this.config.headers());
|
|
1620
1654
|
try {
|
|
1621
1655
|
const {
|
|
@@ -1643,7 +1677,7 @@ var GatewaySpeechModel = class {
|
|
|
1643
1677
|
gatewaySpeechResponseSchema
|
|
1644
1678
|
),
|
|
1645
1679
|
failedResponseHandler: createJsonErrorResponseHandler9({
|
|
1646
|
-
errorSchema:
|
|
1680
|
+
errorSchema: z13.any(),
|
|
1647
1681
|
errorToMessage: (data) => data
|
|
1648
1682
|
}),
|
|
1649
1683
|
...abortSignal && { abortSignal },
|
|
@@ -1651,7 +1685,7 @@ var GatewaySpeechModel = class {
|
|
|
1651
1685
|
});
|
|
1652
1686
|
return {
|
|
1653
1687
|
audio: responseBody.audio,
|
|
1654
|
-
warnings: (
|
|
1688
|
+
warnings: mapGatewayWarnings(responseBody.warnings),
|
|
1655
1689
|
providerMetadata: responseBody.providerMetadata,
|
|
1656
1690
|
response: {
|
|
1657
1691
|
timestamp: /* @__PURE__ */ new Date(),
|
|
@@ -1677,27 +1711,32 @@ var GatewaySpeechModel = class {
|
|
|
1677
1711
|
};
|
|
1678
1712
|
}
|
|
1679
1713
|
};
|
|
1680
|
-
var providerMetadataEntrySchema3 =
|
|
1681
|
-
var gatewaySpeechWarningSchema =
|
|
1682
|
-
|
|
1683
|
-
type:
|
|
1684
|
-
feature:
|
|
1685
|
-
details:
|
|
1714
|
+
var providerMetadataEntrySchema3 = z13.object({}).catchall(z13.unknown());
|
|
1715
|
+
var gatewaySpeechWarningSchema = z13.discriminatedUnion("type", [
|
|
1716
|
+
z13.object({
|
|
1717
|
+
type: z13.literal("unsupported"),
|
|
1718
|
+
feature: z13.string(),
|
|
1719
|
+
details: z13.string().optional()
|
|
1686
1720
|
}),
|
|
1687
|
-
|
|
1688
|
-
type:
|
|
1689
|
-
feature:
|
|
1690
|
-
details:
|
|
1721
|
+
z13.object({
|
|
1722
|
+
type: z13.literal("compatibility"),
|
|
1723
|
+
feature: z13.string(),
|
|
1724
|
+
details: z13.string().optional()
|
|
1691
1725
|
}),
|
|
1692
|
-
|
|
1693
|
-
type:
|
|
1694
|
-
|
|
1726
|
+
z13.object({
|
|
1727
|
+
type: z13.literal("deprecated"),
|
|
1728
|
+
setting: z13.string(),
|
|
1729
|
+
message: z13.string()
|
|
1730
|
+
}),
|
|
1731
|
+
z13.object({
|
|
1732
|
+
type: z13.literal("other"),
|
|
1733
|
+
message: z13.string()
|
|
1695
1734
|
})
|
|
1696
1735
|
]);
|
|
1697
|
-
var gatewaySpeechResponseSchema =
|
|
1698
|
-
audio:
|
|
1699
|
-
warnings:
|
|
1700
|
-
providerMetadata:
|
|
1736
|
+
var gatewaySpeechResponseSchema = z13.object({
|
|
1737
|
+
audio: z13.string(),
|
|
1738
|
+
warnings: z13.array(gatewaySpeechWarningSchema).optional(),
|
|
1739
|
+
providerMetadata: z13.record(z13.string(), providerMetadataEntrySchema3).optional()
|
|
1701
1740
|
});
|
|
1702
1741
|
|
|
1703
1742
|
// src/gateway-transcription-model.ts
|
|
@@ -1709,7 +1748,7 @@ import {
|
|
|
1709
1748
|
postJsonToApi as postJsonToApi7,
|
|
1710
1749
|
resolve as resolve10
|
|
1711
1750
|
} from "@ai-sdk/provider-utils";
|
|
1712
|
-
import { z as
|
|
1751
|
+
import { z as z14 } from "zod/v4";
|
|
1713
1752
|
var GatewayTranscriptionModel = class {
|
|
1714
1753
|
constructor(modelId, config) {
|
|
1715
1754
|
this.modelId = modelId;
|
|
@@ -1726,7 +1765,7 @@ var GatewayTranscriptionModel = class {
|
|
|
1726
1765
|
headers,
|
|
1727
1766
|
abortSignal
|
|
1728
1767
|
}) {
|
|
1729
|
-
var _a11, _b11, _c
|
|
1768
|
+
var _a11, _b11, _c;
|
|
1730
1769
|
const resolvedHeaders = await resolve10(this.config.headers());
|
|
1731
1770
|
try {
|
|
1732
1771
|
const {
|
|
@@ -1750,7 +1789,7 @@ var GatewayTranscriptionModel = class {
|
|
|
1750
1789
|
gatewayTranscriptionResponseSchema
|
|
1751
1790
|
),
|
|
1752
1791
|
failedResponseHandler: createJsonErrorResponseHandler10({
|
|
1753
|
-
errorSchema:
|
|
1792
|
+
errorSchema: z14.any(),
|
|
1754
1793
|
errorToMessage: (data) => data
|
|
1755
1794
|
}),
|
|
1756
1795
|
...abortSignal && { abortSignal },
|
|
@@ -1761,7 +1800,7 @@ var GatewayTranscriptionModel = class {
|
|
|
1761
1800
|
segments: (_a11 = responseBody.segments) != null ? _a11 : [],
|
|
1762
1801
|
language: (_b11 = responseBody.language) != null ? _b11 : void 0,
|
|
1763
1802
|
durationInSeconds: (_c = responseBody.durationInSeconds) != null ? _c : void 0,
|
|
1764
|
-
warnings: (
|
|
1803
|
+
warnings: mapGatewayWarnings(responseBody.warnings),
|
|
1765
1804
|
providerMetadata: responseBody.providerMetadata,
|
|
1766
1805
|
response: {
|
|
1767
1806
|
timestamp: /* @__PURE__ */ new Date(),
|
|
@@ -1787,54 +1826,59 @@ var GatewayTranscriptionModel = class {
|
|
|
1787
1826
|
};
|
|
1788
1827
|
}
|
|
1789
1828
|
};
|
|
1790
|
-
var providerMetadataEntrySchema4 =
|
|
1791
|
-
var gatewayTranscriptionWarningSchema =
|
|
1792
|
-
|
|
1793
|
-
type:
|
|
1794
|
-
feature:
|
|
1795
|
-
details:
|
|
1829
|
+
var providerMetadataEntrySchema4 = z14.object({}).catchall(z14.unknown());
|
|
1830
|
+
var gatewayTranscriptionWarningSchema = z14.discriminatedUnion("type", [
|
|
1831
|
+
z14.object({
|
|
1832
|
+
type: z14.literal("unsupported"),
|
|
1833
|
+
feature: z14.string(),
|
|
1834
|
+
details: z14.string().optional()
|
|
1796
1835
|
}),
|
|
1797
|
-
|
|
1798
|
-
type:
|
|
1799
|
-
feature:
|
|
1800
|
-
details:
|
|
1836
|
+
z14.object({
|
|
1837
|
+
type: z14.literal("compatibility"),
|
|
1838
|
+
feature: z14.string(),
|
|
1839
|
+
details: z14.string().optional()
|
|
1801
1840
|
}),
|
|
1802
|
-
|
|
1803
|
-
type:
|
|
1804
|
-
|
|
1841
|
+
z14.object({
|
|
1842
|
+
type: z14.literal("deprecated"),
|
|
1843
|
+
setting: z14.string(),
|
|
1844
|
+
message: z14.string()
|
|
1845
|
+
}),
|
|
1846
|
+
z14.object({
|
|
1847
|
+
type: z14.literal("other"),
|
|
1848
|
+
message: z14.string()
|
|
1805
1849
|
})
|
|
1806
1850
|
]);
|
|
1807
|
-
var gatewayTranscriptionResponseSchema =
|
|
1808
|
-
text:
|
|
1809
|
-
segments:
|
|
1810
|
-
|
|
1811
|
-
text:
|
|
1812
|
-
startSecond:
|
|
1813
|
-
endSecond:
|
|
1851
|
+
var gatewayTranscriptionResponseSchema = z14.object({
|
|
1852
|
+
text: z14.string(),
|
|
1853
|
+
segments: z14.array(
|
|
1854
|
+
z14.object({
|
|
1855
|
+
text: z14.string(),
|
|
1856
|
+
startSecond: z14.number(),
|
|
1857
|
+
endSecond: z14.number()
|
|
1814
1858
|
})
|
|
1815
1859
|
).optional(),
|
|
1816
|
-
language:
|
|
1817
|
-
durationInSeconds:
|
|
1818
|
-
warnings:
|
|
1819
|
-
providerMetadata:
|
|
1860
|
+
language: z14.string().nullish(),
|
|
1861
|
+
durationInSeconds: z14.number().nullish(),
|
|
1862
|
+
warnings: z14.array(gatewayTranscriptionWarningSchema).optional(),
|
|
1863
|
+
providerMetadata: z14.record(z14.string(), providerMetadataEntrySchema4).optional()
|
|
1820
1864
|
});
|
|
1821
1865
|
|
|
1822
1866
|
// src/tool/exa-search.ts
|
|
1823
1867
|
import {
|
|
1824
1868
|
createProviderToolFactoryWithOutputSchema,
|
|
1825
|
-
lazySchema as
|
|
1826
|
-
zodSchema as
|
|
1869
|
+
lazySchema as lazySchema10,
|
|
1870
|
+
zodSchema as zodSchema10
|
|
1827
1871
|
} from "@ai-sdk/provider-utils";
|
|
1828
|
-
import { z as
|
|
1829
|
-
var exaSearchInputSchema =
|
|
1830
|
-
() =>
|
|
1831
|
-
|
|
1832
|
-
query:
|
|
1833
|
-
type:
|
|
1872
|
+
import { z as z15 } from "zod";
|
|
1873
|
+
var exaSearchInputSchema = lazySchema10(
|
|
1874
|
+
() => zodSchema10(
|
|
1875
|
+
z15.object({
|
|
1876
|
+
query: z15.string().describe("Natural-language web search query. This is required."),
|
|
1877
|
+
type: z15.enum(["auto", "fast", "instant"]).optional().describe(
|
|
1834
1878
|
"Search method. Use auto for the default balance of speed and quality."
|
|
1835
1879
|
),
|
|
1836
|
-
num_results:
|
|
1837
|
-
category:
|
|
1880
|
+
num_results: z15.number().optional().describe("Maximum number of results to return (1-100, default: 10)."),
|
|
1881
|
+
category: z15.enum([
|
|
1838
1882
|
"company",
|
|
1839
1883
|
"people",
|
|
1840
1884
|
"research paper",
|
|
@@ -1842,20 +1886,20 @@ var exaSearchInputSchema = lazySchema9(
|
|
|
1842
1886
|
"personal site",
|
|
1843
1887
|
"financial report"
|
|
1844
1888
|
]).optional().describe("Optional content category to focus results."),
|
|
1845
|
-
user_location:
|
|
1846
|
-
include_domains:
|
|
1847
|
-
exclude_domains:
|
|
1848
|
-
start_published_date:
|
|
1849
|
-
end_published_date:
|
|
1850
|
-
contents:
|
|
1851
|
-
text:
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
max_characters:
|
|
1855
|
-
include_html_tags:
|
|
1856
|
-
verbosity:
|
|
1857
|
-
include_sections:
|
|
1858
|
-
|
|
1889
|
+
user_location: z15.string().optional().describe("Two-letter ISO country code such as 'US'."),
|
|
1890
|
+
include_domains: z15.array(z15.string()).optional().describe("Only return results from these domains."),
|
|
1891
|
+
exclude_domains: z15.array(z15.string()).optional().describe("Exclude results from these domains."),
|
|
1892
|
+
start_published_date: z15.string().optional().describe("Only return links published after this ISO 8601 date."),
|
|
1893
|
+
end_published_date: z15.string().optional().describe("Only return links published before this ISO 8601 date."),
|
|
1894
|
+
contents: z15.object({
|
|
1895
|
+
text: z15.union([
|
|
1896
|
+
z15.boolean(),
|
|
1897
|
+
z15.object({
|
|
1898
|
+
max_characters: z15.number().optional(),
|
|
1899
|
+
include_html_tags: z15.boolean().optional(),
|
|
1900
|
+
verbosity: z15.enum(["compact", "standard", "full"]).optional(),
|
|
1901
|
+
include_sections: z15.array(
|
|
1902
|
+
z15.enum([
|
|
1859
1903
|
"header",
|
|
1860
1904
|
"navigation",
|
|
1861
1905
|
"banner",
|
|
@@ -1865,8 +1909,8 @@ var exaSearchInputSchema = lazySchema9(
|
|
|
1865
1909
|
"metadata"
|
|
1866
1910
|
])
|
|
1867
1911
|
).optional(),
|
|
1868
|
-
exclude_sections:
|
|
1869
|
-
|
|
1912
|
+
exclude_sections: z15.array(
|
|
1913
|
+
z15.enum([
|
|
1870
1914
|
"header",
|
|
1871
1915
|
"navigation",
|
|
1872
1916
|
"banner",
|
|
@@ -1878,59 +1922,59 @@ var exaSearchInputSchema = lazySchema9(
|
|
|
1878
1922
|
).optional()
|
|
1879
1923
|
})
|
|
1880
1924
|
]).optional(),
|
|
1881
|
-
highlights:
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
query:
|
|
1885
|
-
max_characters:
|
|
1925
|
+
highlights: z15.union([
|
|
1926
|
+
z15.boolean(),
|
|
1927
|
+
z15.object({
|
|
1928
|
+
query: z15.string().optional(),
|
|
1929
|
+
max_characters: z15.number().optional()
|
|
1886
1930
|
})
|
|
1887
1931
|
]).optional(),
|
|
1888
|
-
max_age_hours:
|
|
1889
|
-
livecrawl_timeout:
|
|
1890
|
-
subpages:
|
|
1891
|
-
subpage_target:
|
|
1892
|
-
extras:
|
|
1893
|
-
links:
|
|
1894
|
-
image_links:
|
|
1932
|
+
max_age_hours: z15.number().optional(),
|
|
1933
|
+
livecrawl_timeout: z15.number().optional(),
|
|
1934
|
+
subpages: z15.number().optional(),
|
|
1935
|
+
subpage_target: z15.union([z15.string(), z15.array(z15.string())]).optional(),
|
|
1936
|
+
extras: z15.object({
|
|
1937
|
+
links: z15.number().optional(),
|
|
1938
|
+
image_links: z15.number().optional()
|
|
1895
1939
|
}).optional()
|
|
1896
1940
|
}).optional().describe("Controls extracted page content and freshness.")
|
|
1897
1941
|
})
|
|
1898
1942
|
)
|
|
1899
1943
|
);
|
|
1900
|
-
var exaSearchOutputSchema =
|
|
1901
|
-
() =>
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
requestId:
|
|
1905
|
-
searchType:
|
|
1906
|
-
resolvedSearchType:
|
|
1907
|
-
results:
|
|
1908
|
-
|
|
1909
|
-
title:
|
|
1910
|
-
url:
|
|
1911
|
-
id:
|
|
1912
|
-
publishedDate:
|
|
1913
|
-
author:
|
|
1914
|
-
image:
|
|
1915
|
-
favicon:
|
|
1916
|
-
text:
|
|
1917
|
-
highlights:
|
|
1918
|
-
highlightScores:
|
|
1919
|
-
summary:
|
|
1920
|
-
subpages:
|
|
1921
|
-
extras:
|
|
1922
|
-
links:
|
|
1923
|
-
imageLinks:
|
|
1944
|
+
var exaSearchOutputSchema = lazySchema10(
|
|
1945
|
+
() => zodSchema10(
|
|
1946
|
+
z15.union([
|
|
1947
|
+
z15.object({
|
|
1948
|
+
requestId: z15.string(),
|
|
1949
|
+
searchType: z15.string().optional(),
|
|
1950
|
+
resolvedSearchType: z15.string().optional(),
|
|
1951
|
+
results: z15.array(
|
|
1952
|
+
z15.object({
|
|
1953
|
+
title: z15.string(),
|
|
1954
|
+
url: z15.string(),
|
|
1955
|
+
id: z15.string(),
|
|
1956
|
+
publishedDate: z15.string().nullable().optional(),
|
|
1957
|
+
author: z15.string().nullable().optional(),
|
|
1958
|
+
image: z15.string().nullable().optional(),
|
|
1959
|
+
favicon: z15.string().nullable().optional(),
|
|
1960
|
+
text: z15.string().optional(),
|
|
1961
|
+
highlights: z15.array(z15.string()).optional(),
|
|
1962
|
+
highlightScores: z15.array(z15.number()).optional(),
|
|
1963
|
+
summary: z15.string().optional(),
|
|
1964
|
+
subpages: z15.array(z15.any()).optional(),
|
|
1965
|
+
extras: z15.object({
|
|
1966
|
+
links: z15.array(z15.string()).optional(),
|
|
1967
|
+
imageLinks: z15.array(z15.string()).optional()
|
|
1924
1968
|
}).optional()
|
|
1925
1969
|
})
|
|
1926
1970
|
),
|
|
1927
|
-
costDollars:
|
|
1928
|
-
total:
|
|
1929
|
-
search:
|
|
1971
|
+
costDollars: z15.object({
|
|
1972
|
+
total: z15.number().optional(),
|
|
1973
|
+
search: z15.record(z15.number()).optional()
|
|
1930
1974
|
}).optional()
|
|
1931
1975
|
}),
|
|
1932
|
-
|
|
1933
|
-
error:
|
|
1976
|
+
z15.object({
|
|
1977
|
+
error: z15.enum([
|
|
1934
1978
|
"api_error",
|
|
1935
1979
|
"rate_limit",
|
|
1936
1980
|
"timeout",
|
|
@@ -1939,8 +1983,8 @@ var exaSearchOutputSchema = lazySchema9(
|
|
|
1939
1983
|
"execution_error",
|
|
1940
1984
|
"unknown"
|
|
1941
1985
|
]),
|
|
1942
|
-
statusCode:
|
|
1943
|
-
message:
|
|
1986
|
+
statusCode: z15.number().optional(),
|
|
1987
|
+
message: z15.string()
|
|
1944
1988
|
})
|
|
1945
1989
|
])
|
|
1946
1990
|
)
|
|
@@ -1955,69 +1999,69 @@ var exaSearch = (config = {}) => exaSearchToolFactory(config);
|
|
|
1955
1999
|
// src/tool/parallel-search.ts
|
|
1956
2000
|
import {
|
|
1957
2001
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
|
|
1958
|
-
lazySchema as
|
|
1959
|
-
zodSchema as
|
|
2002
|
+
lazySchema as lazySchema11,
|
|
2003
|
+
zodSchema as zodSchema11
|
|
1960
2004
|
} from "@ai-sdk/provider-utils";
|
|
1961
|
-
import { z as
|
|
1962
|
-
var parallelSearchInputSchema =
|
|
1963
|
-
() =>
|
|
1964
|
-
|
|
1965
|
-
objective:
|
|
2005
|
+
import { z as z16 } from "zod";
|
|
2006
|
+
var parallelSearchInputSchema = lazySchema11(
|
|
2007
|
+
() => zodSchema11(
|
|
2008
|
+
z16.object({
|
|
2009
|
+
objective: z16.string().describe(
|
|
1966
2010
|
"Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."
|
|
1967
2011
|
),
|
|
1968
|
-
search_queries:
|
|
2012
|
+
search_queries: z16.array(z16.string()).optional().describe(
|
|
1969
2013
|
"Optional search queries to supplement the objective. Maximum 200 characters per query."
|
|
1970
2014
|
),
|
|
1971
|
-
mode:
|
|
2015
|
+
mode: z16.enum(["one-shot", "agentic"]).optional().describe(
|
|
1972
2016
|
'Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'
|
|
1973
2017
|
),
|
|
1974
|
-
max_results:
|
|
2018
|
+
max_results: z16.number().optional().describe(
|
|
1975
2019
|
"Maximum number of results to return (1-20). Defaults to 10 if not specified."
|
|
1976
2020
|
),
|
|
1977
|
-
source_policy:
|
|
1978
|
-
include_domains:
|
|
2021
|
+
source_policy: z16.object({
|
|
2022
|
+
include_domains: z16.array(z16.string()).optional().describe(
|
|
1979
2023
|
"Limit results to these domains. Use plain domain names only \u2014 e.g. example.com or sub.example.gov, or a bare extension like .edu. Do not include a scheme, path, or port (e.g. not https://example.com/page)."
|
|
1980
2024
|
),
|
|
1981
|
-
exclude_domains:
|
|
2025
|
+
exclude_domains: z16.array(z16.string()).optional().describe(
|
|
1982
2026
|
"Exclude results from these domains. Use plain domain names only \u2014 e.g. example.com or sub.example.gov, or a bare extension like .edu. Do not include a scheme, path, or port (e.g. not https://example.com/page)."
|
|
1983
2027
|
),
|
|
1984
|
-
after_date:
|
|
2028
|
+
after_date: z16.string().optional().describe(
|
|
1985
2029
|
"Only include results published after this date. Use an ISO 8601 calendar date formatted YYYY-MM-DD (e.g. 2025-01-01); do not include a time."
|
|
1986
2030
|
)
|
|
1987
2031
|
}).optional().describe(
|
|
1988
2032
|
"Source policy for controlling which domains to include/exclude and freshness."
|
|
1989
2033
|
),
|
|
1990
|
-
excerpts:
|
|
1991
|
-
max_chars_per_result:
|
|
1992
|
-
max_chars_total:
|
|
2034
|
+
excerpts: z16.object({
|
|
2035
|
+
max_chars_per_result: z16.number().optional().describe("Maximum characters per result."),
|
|
2036
|
+
max_chars_total: z16.number().optional().describe("Maximum total characters across all results.")
|
|
1993
2037
|
}).optional().describe("Excerpt configuration for controlling result length."),
|
|
1994
|
-
fetch_policy:
|
|
1995
|
-
max_age_seconds:
|
|
2038
|
+
fetch_policy: z16.object({
|
|
2039
|
+
max_age_seconds: z16.number().optional().describe(
|
|
1996
2040
|
"Maximum age in seconds for cached content. Set to 0 to always fetch fresh content."
|
|
1997
2041
|
)
|
|
1998
2042
|
}).optional().describe("Fetch policy for controlling content freshness.")
|
|
1999
2043
|
})
|
|
2000
2044
|
)
|
|
2001
2045
|
);
|
|
2002
|
-
var parallelSearchOutputSchema =
|
|
2003
|
-
() =>
|
|
2004
|
-
|
|
2046
|
+
var parallelSearchOutputSchema = lazySchema11(
|
|
2047
|
+
() => zodSchema11(
|
|
2048
|
+
z16.union([
|
|
2005
2049
|
// Success response
|
|
2006
|
-
|
|
2007
|
-
searchId:
|
|
2008
|
-
results:
|
|
2009
|
-
|
|
2010
|
-
url:
|
|
2011
|
-
title:
|
|
2012
|
-
excerpt:
|
|
2013
|
-
publishDate:
|
|
2014
|
-
relevanceScore:
|
|
2050
|
+
z16.object({
|
|
2051
|
+
searchId: z16.string(),
|
|
2052
|
+
results: z16.array(
|
|
2053
|
+
z16.object({
|
|
2054
|
+
url: z16.string(),
|
|
2055
|
+
title: z16.string(),
|
|
2056
|
+
excerpt: z16.string(),
|
|
2057
|
+
publishDate: z16.string().nullable().optional(),
|
|
2058
|
+
relevanceScore: z16.number().optional()
|
|
2015
2059
|
})
|
|
2016
2060
|
)
|
|
2017
2061
|
}),
|
|
2018
2062
|
// Error response
|
|
2019
|
-
|
|
2020
|
-
error:
|
|
2063
|
+
z16.object({
|
|
2064
|
+
error: z16.enum([
|
|
2021
2065
|
"api_error",
|
|
2022
2066
|
"rate_limit",
|
|
2023
2067
|
"timeout",
|
|
@@ -2025,8 +2069,8 @@ var parallelSearchOutputSchema = lazySchema10(
|
|
|
2025
2069
|
"configuration_error",
|
|
2026
2070
|
"unknown"
|
|
2027
2071
|
]),
|
|
2028
|
-
statusCode:
|
|
2029
|
-
message:
|
|
2072
|
+
statusCode: z16.number().optional(),
|
|
2073
|
+
message: z16.string()
|
|
2030
2074
|
})
|
|
2031
2075
|
])
|
|
2032
2076
|
)
|
|
@@ -2041,79 +2085,79 @@ var parallelSearch = (config = {}) => parallelSearchToolFactory(config);
|
|
|
2041
2085
|
// src/tool/perplexity-search.ts
|
|
2042
2086
|
import {
|
|
2043
2087
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
|
|
2044
|
-
lazySchema as
|
|
2045
|
-
zodSchema as
|
|
2088
|
+
lazySchema as lazySchema12,
|
|
2089
|
+
zodSchema as zodSchema12
|
|
2046
2090
|
} from "@ai-sdk/provider-utils";
|
|
2047
|
-
import { z as
|
|
2048
|
-
var perplexitySearchInputSchema =
|
|
2049
|
-
() =>
|
|
2050
|
-
|
|
2051
|
-
query:
|
|
2091
|
+
import { z as z17 } from "zod";
|
|
2092
|
+
var perplexitySearchInputSchema = lazySchema12(
|
|
2093
|
+
() => zodSchema12(
|
|
2094
|
+
z17.object({
|
|
2095
|
+
query: z17.union([z17.string(), z17.array(z17.string())]).describe(
|
|
2052
2096
|
"Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."
|
|
2053
2097
|
),
|
|
2054
|
-
max_results:
|
|
2098
|
+
max_results: z17.number().optional().describe(
|
|
2055
2099
|
"Maximum number of search results to return (1-20, default: 10)"
|
|
2056
2100
|
),
|
|
2057
|
-
max_tokens_per_page:
|
|
2101
|
+
max_tokens_per_page: z17.number().optional().describe(
|
|
2058
2102
|
"Maximum number of tokens to extract per search result page (256-2048, default: 2048)"
|
|
2059
2103
|
),
|
|
2060
|
-
max_tokens:
|
|
2104
|
+
max_tokens: z17.number().optional().describe(
|
|
2061
2105
|
"Maximum total tokens across all search results (default: 25000, max: 1000000)"
|
|
2062
2106
|
),
|
|
2063
|
-
country:
|
|
2107
|
+
country: z17.string().optional().describe(
|
|
2064
2108
|
"Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"
|
|
2065
2109
|
),
|
|
2066
|
-
search_domain_filter:
|
|
2110
|
+
search_domain_filter: z17.array(z17.string()).optional().describe(
|
|
2067
2111
|
"List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"
|
|
2068
2112
|
),
|
|
2069
|
-
search_language_filter:
|
|
2113
|
+
search_language_filter: z17.array(z17.string()).optional().describe(
|
|
2070
2114
|
"List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"
|
|
2071
2115
|
),
|
|
2072
|
-
search_after_date:
|
|
2116
|
+
search_after_date: z17.string().optional().describe(
|
|
2073
2117
|
"Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."
|
|
2074
2118
|
),
|
|
2075
|
-
search_before_date:
|
|
2119
|
+
search_before_date: z17.string().optional().describe(
|
|
2076
2120
|
"Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."
|
|
2077
2121
|
),
|
|
2078
|
-
last_updated_after_filter:
|
|
2122
|
+
last_updated_after_filter: z17.string().optional().describe(
|
|
2079
2123
|
"Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."
|
|
2080
2124
|
),
|
|
2081
|
-
last_updated_before_filter:
|
|
2125
|
+
last_updated_before_filter: z17.string().optional().describe(
|
|
2082
2126
|
"Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."
|
|
2083
2127
|
),
|
|
2084
|
-
search_recency_filter:
|
|
2128
|
+
search_recency_filter: z17.enum(["day", "week", "month", "year"]).optional().describe(
|
|
2085
2129
|
"Filter results by relative time period. Cannot be used with search_after_date or search_before_date."
|
|
2086
2130
|
)
|
|
2087
2131
|
})
|
|
2088
2132
|
)
|
|
2089
2133
|
);
|
|
2090
|
-
var perplexitySearchOutputSchema =
|
|
2091
|
-
() =>
|
|
2092
|
-
|
|
2134
|
+
var perplexitySearchOutputSchema = lazySchema12(
|
|
2135
|
+
() => zodSchema12(
|
|
2136
|
+
z17.union([
|
|
2093
2137
|
// Success response
|
|
2094
|
-
|
|
2095
|
-
results:
|
|
2096
|
-
|
|
2097
|
-
title:
|
|
2098
|
-
url:
|
|
2099
|
-
snippet:
|
|
2100
|
-
date:
|
|
2101
|
-
lastUpdated:
|
|
2138
|
+
z17.object({
|
|
2139
|
+
results: z17.array(
|
|
2140
|
+
z17.object({
|
|
2141
|
+
title: z17.string(),
|
|
2142
|
+
url: z17.string(),
|
|
2143
|
+
snippet: z17.string(),
|
|
2144
|
+
date: z17.string().optional(),
|
|
2145
|
+
lastUpdated: z17.string().optional()
|
|
2102
2146
|
})
|
|
2103
2147
|
),
|
|
2104
|
-
id:
|
|
2148
|
+
id: z17.string()
|
|
2105
2149
|
}),
|
|
2106
2150
|
// Error response
|
|
2107
|
-
|
|
2108
|
-
error:
|
|
2151
|
+
z17.object({
|
|
2152
|
+
error: z17.enum([
|
|
2109
2153
|
"api_error",
|
|
2110
2154
|
"rate_limit",
|
|
2111
2155
|
"timeout",
|
|
2112
2156
|
"invalid_input",
|
|
2113
2157
|
"unknown"
|
|
2114
2158
|
]),
|
|
2115
|
-
statusCode:
|
|
2116
|
-
message:
|
|
2159
|
+
statusCode: z17.number().optional(),
|
|
2160
|
+
message: z17.string()
|
|
2117
2161
|
})
|
|
2118
2162
|
])
|
|
2119
2163
|
)
|
|
@@ -2163,7 +2207,7 @@ async function getVercelRequestId() {
|
|
|
2163
2207
|
}
|
|
2164
2208
|
|
|
2165
2209
|
// src/version.ts
|
|
2166
|
-
var VERSION = true ? "3.0.
|
|
2210
|
+
var VERSION = true ? "3.0.146" : "0.0.0-test";
|
|
2167
2211
|
|
|
2168
2212
|
// src/gateway-provider.ts
|
|
2169
2213
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|