@ai-sdk/gateway 4.0.141 → 4.0.143
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 +17 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +453 -424
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/errors/create-gateway-error.ts +4 -4
- package/src/gateway-batch.ts +29 -27
- package/src/gateway-decision-model-settings.ts +3 -0
- package/src/gateway-decision-model.ts +21 -21
- package/src/gateway-embedding-model.ts +7 -7
- package/src/gateway-fetch-metadata.ts +33 -29
- package/src/gateway-generation-info.ts +13 -11
- package/src/gateway-image-model.ts +17 -16
- package/src/gateway-language-model-settings.ts +3 -1
- package/src/gateway-provider-options.ts +72 -50
- package/src/gateway-provider.ts +1 -1
- package/src/gateway-reranking-model.ts +6 -6
- package/src/gateway-speech-model.ts +8 -8
- package/src/gateway-spend-report.ts +19 -18
- package/src/gateway-transcription-model.ts +18 -18
- package/src/gateway-video-model.ts +31 -30
- package/src/tool/browserbase-fetch.ts +22 -29
- package/src/tool/browserbase-search.ts +15 -17
- package/src/tool/deepseek-fetch.ts +10 -10
- package/src/tool/deepseek-search.ts +36 -37
- package/src/tool/exa-search.ts +132 -125
- package/src/tool/gateway-tool-error.ts +8 -7
- package/src/tool/parallel-search.ts +93 -104
- package/src/tool/perplexity-search.ts +62 -85
- package/src/tool/tako-search.ts +277 -275
- package/src/zod.ts +47 -5
|
@@ -108,12 +108,12 @@ const gatewayRerankingWarningSchema = () =>
|
|
|
108
108
|
z.object({
|
|
109
109
|
type: z.literal('unsupported'),
|
|
110
110
|
feature: z.string(),
|
|
111
|
-
details: z.
|
|
111
|
+
details: z.optional(z.string()),
|
|
112
112
|
}),
|
|
113
113
|
z.object({
|
|
114
114
|
type: z.literal('compatibility'),
|
|
115
115
|
feature: z.string(),
|
|
116
|
-
details: z.
|
|
116
|
+
details: z.optional(z.string()),
|
|
117
117
|
}),
|
|
118
118
|
z.object({
|
|
119
119
|
type: z.literal('deprecated'),
|
|
@@ -135,10 +135,10 @@ const gatewayRerankingResponseSchema = lazySchema(() =>
|
|
|
135
135
|
relevanceScore: z.number(),
|
|
136
136
|
}),
|
|
137
137
|
),
|
|
138
|
-
warnings: z.array(gatewayRerankingWarningSchema())
|
|
139
|
-
providerMetadata: z
|
|
140
|
-
.record(z.string(), z.record(z.string(), z.unknown()))
|
|
141
|
-
|
|
138
|
+
warnings: z.optional(z.array(gatewayRerankingWarningSchema())),
|
|
139
|
+
providerMetadata: z.optional(
|
|
140
|
+
z.record(z.string(), z.record(z.string(), z.unknown())),
|
|
141
|
+
),
|
|
142
142
|
}),
|
|
143
143
|
),
|
|
144
144
|
);
|
|
@@ -420,19 +420,19 @@ function createGatewaySpeechStream({
|
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
422
|
|
|
423
|
-
const providerMetadataEntrySchema = () => z.object({})
|
|
423
|
+
const providerMetadataEntrySchema = () => z.catchall(z.object({}), z.unknown());
|
|
424
424
|
|
|
425
425
|
const gatewaySpeechWarningSchema = () =>
|
|
426
426
|
z.discriminatedUnion('type', [
|
|
427
427
|
z.object({
|
|
428
428
|
type: z.literal('unsupported'),
|
|
429
429
|
feature: z.string(),
|
|
430
|
-
details: z.
|
|
430
|
+
details: z.optional(z.string()),
|
|
431
431
|
}),
|
|
432
432
|
z.object({
|
|
433
433
|
type: z.literal('compatibility'),
|
|
434
434
|
feature: z.string(),
|
|
435
|
-
details: z.
|
|
435
|
+
details: z.optional(z.string()),
|
|
436
436
|
}),
|
|
437
437
|
z.object({
|
|
438
438
|
type: z.literal('deprecated'),
|
|
@@ -449,11 +449,11 @@ const gatewaySpeechResponseSchema = lazySchema(() =>
|
|
|
449
449
|
zodSchema(
|
|
450
450
|
z.object({
|
|
451
451
|
audio: z.string(),
|
|
452
|
-
warnings: z.array(gatewaySpeechWarningSchema())
|
|
453
|
-
usage: z.record(z.string(), z.json())
|
|
454
|
-
providerMetadata: z
|
|
455
|
-
.record(z.string(), providerMetadataEntrySchema())
|
|
456
|
-
|
|
452
|
+
warnings: z.optional(z.array(gatewaySpeechWarningSchema())),
|
|
453
|
+
usage: z.optional(z.record(z.string(), z.json())),
|
|
454
|
+
providerMetadata: z.optional(
|
|
455
|
+
z.record(z.string(), providerMetadataEntrySchema()),
|
|
456
|
+
),
|
|
457
457
|
}),
|
|
458
458
|
),
|
|
459
459
|
);
|
|
@@ -132,25 +132,25 @@ const gatewaySpendReportResponseSchema = lazySchema(() =>
|
|
|
132
132
|
zodSchema(
|
|
133
133
|
z.object({
|
|
134
134
|
results: z.array(
|
|
135
|
-
z
|
|
136
|
-
.object({
|
|
137
|
-
day: z.
|
|
138
|
-
hour: z.
|
|
139
|
-
user: z.
|
|
140
|
-
model: z.
|
|
141
|
-
tag: z.
|
|
142
|
-
provider: z.
|
|
143
|
-
credential_type: z.enum(['byok', 'system'])
|
|
135
|
+
z.pipe(
|
|
136
|
+
z.object({
|
|
137
|
+
day: z.optional(z.string()),
|
|
138
|
+
hour: z.optional(z.string()),
|
|
139
|
+
user: z.optional(z.string()),
|
|
140
|
+
model: z.optional(z.string()),
|
|
141
|
+
tag: z.optional(z.string()),
|
|
142
|
+
provider: z.optional(z.string()),
|
|
143
|
+
credential_type: z.optional(z.enum(['byok', 'system'])),
|
|
144
144
|
total_cost: z.number(),
|
|
145
|
-
market_cost: z.
|
|
146
|
-
input_tokens: z.
|
|
147
|
-
output_tokens: z.
|
|
148
|
-
cached_input_tokens: z.
|
|
149
|
-
cache_creation_input_tokens: z.
|
|
150
|
-
reasoning_tokens: z.
|
|
151
|
-
request_count: z.
|
|
152
|
-
})
|
|
153
|
-
.transform(
|
|
145
|
+
market_cost: z.optional(z.number()),
|
|
146
|
+
input_tokens: z.optional(z.number()),
|
|
147
|
+
output_tokens: z.optional(z.number()),
|
|
148
|
+
cached_input_tokens: z.optional(z.number()),
|
|
149
|
+
cache_creation_input_tokens: z.optional(z.number()),
|
|
150
|
+
reasoning_tokens: z.optional(z.number()),
|
|
151
|
+
request_count: z.optional(z.number()),
|
|
152
|
+
}),
|
|
153
|
+
z.transform(
|
|
154
154
|
({
|
|
155
155
|
credential_type,
|
|
156
156
|
total_cost,
|
|
@@ -189,6 +189,7 @@ const gatewaySpendReportResponseSchema = lazySchema(() =>
|
|
|
189
189
|
: {}),
|
|
190
190
|
}),
|
|
191
191
|
),
|
|
192
|
+
),
|
|
192
193
|
),
|
|
193
194
|
}),
|
|
194
195
|
),
|
|
@@ -469,19 +469,19 @@ function createGatewayTranscriptionStream({
|
|
|
469
469
|
});
|
|
470
470
|
}
|
|
471
471
|
|
|
472
|
-
const providerMetadataEntrySchema = () => z.object({})
|
|
472
|
+
const providerMetadataEntrySchema = () => z.catchall(z.object({}), z.unknown());
|
|
473
473
|
|
|
474
474
|
const gatewayTranscriptionWarningSchema = () =>
|
|
475
475
|
z.discriminatedUnion('type', [
|
|
476
476
|
z.object({
|
|
477
477
|
type: z.literal('unsupported'),
|
|
478
478
|
feature: z.string(),
|
|
479
|
-
details: z.
|
|
479
|
+
details: z.optional(z.string()),
|
|
480
480
|
}),
|
|
481
481
|
z.object({
|
|
482
482
|
type: z.literal('compatibility'),
|
|
483
483
|
feature: z.string(),
|
|
484
|
-
details: z.
|
|
484
|
+
details: z.optional(z.string()),
|
|
485
485
|
}),
|
|
486
486
|
z.object({
|
|
487
487
|
type: z.literal('deprecated'),
|
|
@@ -498,31 +498,31 @@ const gatewayTranscriptionResponseSchema = lazySchema(() =>
|
|
|
498
498
|
zodSchema(
|
|
499
499
|
z.object({
|
|
500
500
|
text: z.string(),
|
|
501
|
-
segments: z
|
|
502
|
-
.array(
|
|
501
|
+
segments: z.optional(
|
|
502
|
+
z.array(
|
|
503
503
|
z.object({
|
|
504
504
|
text: z.string(),
|
|
505
505
|
startSecond: z.number(),
|
|
506
506
|
endSecond: z.number(),
|
|
507
507
|
}),
|
|
508
|
-
)
|
|
509
|
-
|
|
510
|
-
words: z
|
|
511
|
-
.array(
|
|
508
|
+
),
|
|
509
|
+
),
|
|
510
|
+
words: z.nullish(
|
|
511
|
+
z.array(
|
|
512
512
|
z.object({
|
|
513
513
|
text: z.string(),
|
|
514
514
|
startSecond: z.number(),
|
|
515
515
|
endSecond: z.number(),
|
|
516
516
|
}),
|
|
517
|
-
)
|
|
518
|
-
|
|
519
|
-
language: z.
|
|
520
|
-
durationInSeconds: z.
|
|
521
|
-
warnings: z.array(gatewayTranscriptionWarningSchema())
|
|
522
|
-
usage: z.record(z.string(), z.json())
|
|
523
|
-
providerMetadata: z
|
|
524
|
-
.record(z.string(), providerMetadataEntrySchema())
|
|
525
|
-
|
|
517
|
+
),
|
|
518
|
+
),
|
|
519
|
+
language: z.nullish(z.string()),
|
|
520
|
+
durationInSeconds: z.nullish(z.number()),
|
|
521
|
+
warnings: z.optional(z.array(gatewayTranscriptionWarningSchema())),
|
|
522
|
+
usage: z.optional(z.record(z.string(), z.json())),
|
|
523
|
+
providerMetadata: z.optional(
|
|
524
|
+
z.record(z.string(), providerMetadataEntrySchema()),
|
|
525
|
+
),
|
|
526
526
|
}),
|
|
527
527
|
),
|
|
528
528
|
);
|
|
@@ -403,11 +403,12 @@ function maybeEncodeVideoFile(file: VideoModelV4File) {
|
|
|
403
403
|
}
|
|
404
404
|
|
|
405
405
|
const providerMetadataEntrySchema = () =>
|
|
406
|
-
z
|
|
407
|
-
.object({
|
|
408
|
-
videos: z.array(z.unknown())
|
|
409
|
-
})
|
|
410
|
-
|
|
406
|
+
z.catchall(
|
|
407
|
+
z.object({
|
|
408
|
+
videos: z.optional(z.array(z.unknown())),
|
|
409
|
+
}),
|
|
410
|
+
z.unknown(),
|
|
411
|
+
);
|
|
411
412
|
|
|
412
413
|
const gatewayVideoDataSchema = () =>
|
|
413
414
|
z.union([
|
|
@@ -432,12 +433,12 @@ const gatewayVideoWarningSchema = () =>
|
|
|
432
433
|
z.object({
|
|
433
434
|
type: z.literal('unsupported'),
|
|
434
435
|
feature: z.string(),
|
|
435
|
-
details: z.
|
|
436
|
+
details: z.optional(z.string()),
|
|
436
437
|
}),
|
|
437
438
|
z.object({
|
|
438
439
|
type: z.literal('compatibility'),
|
|
439
440
|
feature: z.string(),
|
|
440
|
-
details: z.
|
|
441
|
+
details: z.optional(z.string()),
|
|
441
442
|
}),
|
|
442
443
|
z.object({
|
|
443
444
|
type: z.literal('deprecated'),
|
|
@@ -456,17 +457,17 @@ const gatewayVideoEventSchema = lazySchema(() =>
|
|
|
456
457
|
z.object({
|
|
457
458
|
type: z.literal('result'),
|
|
458
459
|
videos: z.array(gatewayVideoDataSchema()),
|
|
459
|
-
warnings: z.array(gatewayVideoWarningSchema())
|
|
460
|
-
providerMetadata: z
|
|
461
|
-
.record(z.string(), providerMetadataEntrySchema())
|
|
462
|
-
|
|
460
|
+
warnings: z.optional(z.array(gatewayVideoWarningSchema())),
|
|
461
|
+
providerMetadata: z.optional(
|
|
462
|
+
z.record(z.string(), providerMetadataEntrySchema()),
|
|
463
|
+
),
|
|
463
464
|
}),
|
|
464
465
|
z.object({
|
|
465
466
|
type: z.literal('error'),
|
|
466
467
|
message: z.string(),
|
|
467
468
|
errorType: z.string(),
|
|
468
469
|
statusCode: z.number(),
|
|
469
|
-
param: z.
|
|
470
|
+
param: z.nullable(z.unknown()),
|
|
470
471
|
}),
|
|
471
472
|
]),
|
|
472
473
|
),
|
|
@@ -476,10 +477,10 @@ const gatewayVideoStartResponseSchema = lazySchema(() =>
|
|
|
476
477
|
zodSchema(
|
|
477
478
|
z.object({
|
|
478
479
|
operation: z.unknown(),
|
|
479
|
-
warnings: z.array(gatewayVideoWarningSchema())
|
|
480
|
-
providerMetadata: z
|
|
481
|
-
.record(z.string(), providerMetadataEntrySchema())
|
|
482
|
-
|
|
480
|
+
warnings: z.nullish(z.array(gatewayVideoWarningSchema())),
|
|
481
|
+
providerMetadata: z.nullish(
|
|
482
|
+
z.record(z.string(), providerMetadataEntrySchema()),
|
|
483
|
+
),
|
|
483
484
|
}),
|
|
484
485
|
),
|
|
485
486
|
);
|
|
@@ -489,31 +490,31 @@ const gatewayVideoStatusResponseSchema = lazySchema(() =>
|
|
|
489
490
|
z.discriminatedUnion('status', [
|
|
490
491
|
z.object({
|
|
491
492
|
status: z.literal('pending'),
|
|
492
|
-
warnings: z.array(gatewayVideoWarningSchema())
|
|
493
|
-
providerMetadata: z
|
|
494
|
-
.record(z.string(), providerMetadataEntrySchema())
|
|
495
|
-
|
|
493
|
+
warnings: z.nullish(z.array(gatewayVideoWarningSchema())),
|
|
494
|
+
providerMetadata: z.nullish(
|
|
495
|
+
z.record(z.string(), providerMetadataEntrySchema()),
|
|
496
|
+
),
|
|
496
497
|
}),
|
|
497
498
|
z.object({
|
|
498
499
|
status: z.literal('completed'),
|
|
499
500
|
videos: z.array(gatewayVideoDataSchema()),
|
|
500
|
-
warnings: z.array(gatewayVideoWarningSchema())
|
|
501
|
-
providerMetadata: z
|
|
502
|
-
.record(z.string(), providerMetadataEntrySchema())
|
|
503
|
-
|
|
501
|
+
warnings: z.nullish(z.array(gatewayVideoWarningSchema())),
|
|
502
|
+
providerMetadata: z.nullish(
|
|
503
|
+
z.record(z.string(), providerMetadataEntrySchema()),
|
|
504
|
+
),
|
|
504
505
|
}),
|
|
505
506
|
z.object({
|
|
506
507
|
status: z.literal('error'),
|
|
507
508
|
error: z.string(),
|
|
508
|
-
providerMetadata: z
|
|
509
|
-
.record(z.string(), providerMetadataEntrySchema())
|
|
510
|
-
|
|
509
|
+
providerMetadata: z.nullish(
|
|
510
|
+
z.record(z.string(), providerMetadataEntrySchema()),
|
|
511
|
+
),
|
|
511
512
|
}),
|
|
512
513
|
z.object({
|
|
513
514
|
status: z.literal('cancelled'),
|
|
514
|
-
providerMetadata: z
|
|
515
|
-
.record(z.string(), providerMetadataEntrySchema())
|
|
516
|
-
|
|
515
|
+
providerMetadata: z.nullish(
|
|
516
|
+
z.record(z.string(), providerMetadataEntrySchema()),
|
|
517
|
+
),
|
|
517
518
|
}),
|
|
518
519
|
]),
|
|
519
520
|
),
|
|
@@ -81,34 +81,27 @@ const jsonObjectSchema = () => z.record(z.string(), z.unknown());
|
|
|
81
81
|
const browserbaseFetchInputSchema = lazySchema(() =>
|
|
82
82
|
zodSchema(
|
|
83
83
|
z.object({
|
|
84
|
-
url: z.
|
|
85
|
-
allow_redirects: z
|
|
86
|
-
.boolean()
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
allow_insecure_ssl: z
|
|
90
|
-
.boolean()
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
.
|
|
103
|
-
.
|
|
104
|
-
|
|
105
|
-
'Output format. raw returns the response body unchanged, markdown returns page content as Markdown, and json returns structured content using schema.',
|
|
106
|
-
),
|
|
107
|
-
schema: jsonObjectSchema()
|
|
108
|
-
.optional()
|
|
109
|
-
.describe(
|
|
110
|
-
'JSON Schema for structured extraction. Only use with format set to json.',
|
|
111
|
-
),
|
|
84
|
+
url: z.describe(z.url(), 'URL of the page to fetch.'),
|
|
85
|
+
allow_redirects: z.describe(
|
|
86
|
+
z.optional(z.boolean()),
|
|
87
|
+
'Whether to follow HTTP redirects (default: false).',
|
|
88
|
+
),
|
|
89
|
+
allow_insecure_ssl: z.describe(
|
|
90
|
+
z.optional(z.boolean()),
|
|
91
|
+
'Whether to bypass TLS certificate verification (default: false). Only use for trusted hosts.',
|
|
92
|
+
),
|
|
93
|
+
proxies: z.describe(
|
|
94
|
+
z.optional(z.boolean()),
|
|
95
|
+
'Whether to route the request through Browserbase proxies (default: false).',
|
|
96
|
+
),
|
|
97
|
+
format: z.describe(
|
|
98
|
+
z.optional(z.enum(['raw', 'json', 'markdown'])),
|
|
99
|
+
'Output format. raw returns the response body unchanged, markdown returns page content as Markdown, and json returns structured content using schema.',
|
|
100
|
+
),
|
|
101
|
+
schema: z.describe(
|
|
102
|
+
z.optional(jsonObjectSchema()),
|
|
103
|
+
'JSON Schema for structured extraction. Only use with format set to json.',
|
|
104
|
+
),
|
|
112
105
|
}),
|
|
113
106
|
),
|
|
114
107
|
);
|
|
@@ -134,7 +127,7 @@ const browserbaseFetchOutputSchema = lazySchema(() =>
|
|
|
134
127
|
'timeout',
|
|
135
128
|
'unknown',
|
|
136
129
|
]),
|
|
137
|
-
statusCode: z.
|
|
130
|
+
statusCode: z.optional(z.number()),
|
|
138
131
|
message: z.string(),
|
|
139
132
|
}),
|
|
140
133
|
]),
|
|
@@ -70,18 +70,16 @@ export type BrowserbaseSearchOutput =
|
|
|
70
70
|
const browserbaseSearchInputSchema = lazySchema(() =>
|
|
71
71
|
zodSchema(
|
|
72
72
|
z.object({
|
|
73
|
-
query: z
|
|
74
|
-
.string()
|
|
75
|
-
.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
.optional()
|
|
84
|
-
.describe('Maximum number of results to return (1-25, default: 10).'),
|
|
73
|
+
query: z.describe(
|
|
74
|
+
z.string().check(z.minLength(1)).check(z.maxLength(200)),
|
|
75
|
+
'Web search query. Must be between 1 and 200 characters.',
|
|
76
|
+
),
|
|
77
|
+
num_results: z.describe(
|
|
78
|
+
z.optional(
|
|
79
|
+
z.number().check(z.int()).check(z.minimum(1)).check(z.maximum(25)),
|
|
80
|
+
),
|
|
81
|
+
'Maximum number of results to return (1-25, default: 10).',
|
|
82
|
+
),
|
|
85
83
|
}),
|
|
86
84
|
),
|
|
87
85
|
);
|
|
@@ -97,10 +95,10 @@ const browserbaseSearchOutputSchema = lazySchema(() =>
|
|
|
97
95
|
id: z.string(),
|
|
98
96
|
title: z.string(),
|
|
99
97
|
url: z.string(),
|
|
100
|
-
author: z.
|
|
101
|
-
favicon: z.
|
|
102
|
-
image: z.
|
|
103
|
-
publishedDate: z.
|
|
98
|
+
author: z.optional(z.string()),
|
|
99
|
+
favicon: z.optional(z.string()),
|
|
100
|
+
image: z.optional(z.string()),
|
|
101
|
+
publishedDate: z.optional(z.string()),
|
|
104
102
|
}),
|
|
105
103
|
),
|
|
106
104
|
}),
|
|
@@ -114,7 +112,7 @@ const browserbaseSearchOutputSchema = lazySchema(() =>
|
|
|
114
112
|
'timeout',
|
|
115
113
|
'unknown',
|
|
116
114
|
]),
|
|
117
|
-
statusCode: z.
|
|
115
|
+
statusCode: z.optional(z.number()),
|
|
118
116
|
message: z.string(),
|
|
119
117
|
}),
|
|
120
118
|
]),
|
|
@@ -29,11 +29,10 @@ export type DeepSeekFetchOutput = DeepSeekFetchResponse | GatewayToolError;
|
|
|
29
29
|
const deepseekFetchInputSchema = lazySchema(() =>
|
|
30
30
|
zodSchema(
|
|
31
31
|
z.object({
|
|
32
|
-
url: z
|
|
33
|
-
.string()
|
|
34
|
-
.
|
|
35
|
-
|
|
36
|
-
),
|
|
32
|
+
url: z.describe(
|
|
33
|
+
z.string(),
|
|
34
|
+
'URL to fetch, at most 8192 characters; HTTP(S) only, without a username or password.',
|
|
35
|
+
),
|
|
37
36
|
}),
|
|
38
37
|
),
|
|
39
38
|
);
|
|
@@ -41,12 +40,13 @@ const deepseekFetchInputSchema = lazySchema(() =>
|
|
|
41
40
|
const deepseekFetchOutputSchema = lazySchema(() =>
|
|
42
41
|
zodSchema(
|
|
43
42
|
z.union([
|
|
44
|
-
z
|
|
45
|
-
.object({
|
|
46
|
-
title: z.
|
|
43
|
+
z.catchall(
|
|
44
|
+
z.object({
|
|
45
|
+
title: z.nullish(z.string()),
|
|
47
46
|
content: z.string(),
|
|
48
|
-
})
|
|
49
|
-
.
|
|
47
|
+
}),
|
|
48
|
+
z.unknown(),
|
|
49
|
+
),
|
|
50
50
|
gatewayToolErrorSchema(),
|
|
51
51
|
]),
|
|
52
52
|
),
|
|
@@ -51,25 +51,22 @@ export type DeepSeekSearchOutput = DeepSeekSearchResponse | GatewayToolError;
|
|
|
51
51
|
const deepseekSearchInputSchema = lazySchema(() =>
|
|
52
52
|
zodSchema(
|
|
53
53
|
z.object({
|
|
54
|
-
query: z
|
|
55
|
-
.string()
|
|
56
|
-
.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
.nullable()
|
|
71
|
-
.optional()
|
|
72
|
-
.describe('Original user question, 1 to 128 Unicode characters.'),
|
|
54
|
+
query: z.describe(
|
|
55
|
+
z.string(),
|
|
56
|
+
'Web search query, 1 to 128 Unicode characters. Supports site:, -site:, lang:, after:, before:, and quoted phrases.',
|
|
57
|
+
),
|
|
58
|
+
count: z.describe(
|
|
59
|
+
z.optional(z.number().check(z.int())),
|
|
60
|
+
'Number of results, 1 to 50 (default: 10).',
|
|
61
|
+
),
|
|
62
|
+
need_content: z.describe(
|
|
63
|
+
z.optional(z.boolean()),
|
|
64
|
+
'Include available page content (default: false).',
|
|
65
|
+
),
|
|
66
|
+
ori_question: z.describe(
|
|
67
|
+
z.optional(z.nullable(z.string())),
|
|
68
|
+
'Original user question, 1 to 128 Unicode characters.',
|
|
69
|
+
),
|
|
73
70
|
}),
|
|
74
71
|
),
|
|
75
72
|
);
|
|
@@ -77,26 +74,28 @@ const deepseekSearchInputSchema = lazySchema(() =>
|
|
|
77
74
|
const deepseekSearchOutputSchema = lazySchema(() =>
|
|
78
75
|
zodSchema(
|
|
79
76
|
z.union([
|
|
80
|
-
z
|
|
81
|
-
.object({
|
|
77
|
+
z.catchall(
|
|
78
|
+
z.object({
|
|
82
79
|
results: z.array(
|
|
83
|
-
z
|
|
84
|
-
.object({
|
|
85
|
-
authority: z.
|
|
86
|
-
content: z.
|
|
87
|
-
date: z.
|
|
88
|
-
rerank_score: z.
|
|
89
|
-
site_icon: z.
|
|
90
|
-
site_name: z.
|
|
91
|
-
snippet: z.
|
|
92
|
-
summary: z.
|
|
93
|
-
title: z.
|
|
94
|
-
url: z.
|
|
95
|
-
})
|
|
96
|
-
.
|
|
80
|
+
z.catchall(
|
|
81
|
+
z.object({
|
|
82
|
+
authority: z.nullish(z.number()),
|
|
83
|
+
content: z.nullish(z.string()),
|
|
84
|
+
date: z.nullish(z.string()),
|
|
85
|
+
rerank_score: z.nullish(z.number()),
|
|
86
|
+
site_icon: z.nullish(z.string()),
|
|
87
|
+
site_name: z.nullish(z.string()),
|
|
88
|
+
snippet: z.nullish(z.string()),
|
|
89
|
+
summary: z.nullish(z.string()),
|
|
90
|
+
title: z.nullish(z.string()),
|
|
91
|
+
url: z.nullish(z.string()),
|
|
92
|
+
}),
|
|
93
|
+
z.unknown(),
|
|
94
|
+
),
|
|
97
95
|
),
|
|
98
|
-
})
|
|
99
|
-
.
|
|
96
|
+
}),
|
|
97
|
+
z.unknown(),
|
|
98
|
+
),
|
|
100
99
|
gatewayToolErrorSchema(),
|
|
101
100
|
]),
|
|
102
101
|
),
|