@ai-sdk/gateway 4.0.139 → 4.0.142
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 +33 -0
- package/dist/index.d.ts +45 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +456 -416
- package/dist/index.js.map +1 -1
- package/docs/00-ai-gateway.mdx +38 -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 +1 -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 +6 -0
- 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 +319 -251
- package/src/zod.ts +47 -5
|
@@ -159,88 +159,65 @@ export type PerplexitySearchOutput =
|
|
|
159
159
|
const perplexitySearchInputSchema = lazySchema(() =>
|
|
160
160
|
zodSchema(
|
|
161
161
|
z.object({
|
|
162
|
-
query: z
|
|
163
|
-
.union([z.string(), z.array(z.string())])
|
|
164
|
-
.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
),
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
.
|
|
184
|
-
.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
),
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
.optional()
|
|
199
|
-
.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
),
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
.
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
.
|
|
219
|
-
.
|
|
220
|
-
|
|
221
|
-
"Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter.",
|
|
222
|
-
),
|
|
223
|
-
|
|
224
|
-
last_updated_after_filter: z
|
|
225
|
-
.string()
|
|
226
|
-
.optional()
|
|
227
|
-
.describe(
|
|
228
|
-
"Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter.",
|
|
229
|
-
),
|
|
230
|
-
|
|
231
|
-
last_updated_before_filter: z
|
|
232
|
-
.string()
|
|
233
|
-
.optional()
|
|
234
|
-
.describe(
|
|
235
|
-
"Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter.",
|
|
236
|
-
),
|
|
237
|
-
|
|
238
|
-
search_recency_filter: z
|
|
239
|
-
.enum(['day', 'week', 'month', 'year'])
|
|
240
|
-
.optional()
|
|
241
|
-
.describe(
|
|
242
|
-
'Filter results by relative time period. Cannot be used with search_after_date or search_before_date.',
|
|
243
|
-
),
|
|
162
|
+
query: z.describe(
|
|
163
|
+
z.union([z.string(), z.array(z.string())]),
|
|
164
|
+
'Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries.',
|
|
165
|
+
),
|
|
166
|
+
|
|
167
|
+
max_results: z.describe(
|
|
168
|
+
z.optional(z.number()),
|
|
169
|
+
'Maximum number of search results to return (1-20, default: 10)',
|
|
170
|
+
),
|
|
171
|
+
|
|
172
|
+
max_tokens_per_page: z.describe(
|
|
173
|
+
z.optional(z.number()),
|
|
174
|
+
'Maximum number of tokens to extract per search result page (256-2048, default: 2048)',
|
|
175
|
+
),
|
|
176
|
+
|
|
177
|
+
max_tokens: z.describe(
|
|
178
|
+
z.optional(z.number()),
|
|
179
|
+
'Maximum total tokens across all search results (default: 25000, max: 1000000)',
|
|
180
|
+
),
|
|
181
|
+
|
|
182
|
+
country: z.describe(
|
|
183
|
+
z.optional(z.string()),
|
|
184
|
+
"Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')",
|
|
185
|
+
),
|
|
186
|
+
|
|
187
|
+
search_domain_filter: z.describe(
|
|
188
|
+
z.optional(z.array(z.string())),
|
|
189
|
+
"List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']",
|
|
190
|
+
),
|
|
191
|
+
|
|
192
|
+
search_language_filter: z.describe(
|
|
193
|
+
z.optional(z.array(z.string())),
|
|
194
|
+
"List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']",
|
|
195
|
+
),
|
|
196
|
+
|
|
197
|
+
search_after_date: z.describe(
|
|
198
|
+
z.optional(z.string()),
|
|
199
|
+
"Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter.",
|
|
200
|
+
),
|
|
201
|
+
|
|
202
|
+
search_before_date: z.describe(
|
|
203
|
+
z.optional(z.string()),
|
|
204
|
+
"Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter.",
|
|
205
|
+
),
|
|
206
|
+
|
|
207
|
+
last_updated_after_filter: z.describe(
|
|
208
|
+
z.optional(z.string()),
|
|
209
|
+
"Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter.",
|
|
210
|
+
),
|
|
211
|
+
|
|
212
|
+
last_updated_before_filter: z.describe(
|
|
213
|
+
z.optional(z.string()),
|
|
214
|
+
"Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter.",
|
|
215
|
+
),
|
|
216
|
+
|
|
217
|
+
search_recency_filter: z.describe(
|
|
218
|
+
z.optional(z.enum(['day', 'week', 'month', 'year'])),
|
|
219
|
+
'Filter results by relative time period. Cannot be used with search_after_date or search_before_date.',
|
|
220
|
+
),
|
|
244
221
|
}),
|
|
245
222
|
),
|
|
246
223
|
);
|
|
@@ -255,8 +232,8 @@ const perplexitySearchOutputSchema = lazySchema(() =>
|
|
|
255
232
|
title: z.string(),
|
|
256
233
|
url: z.string(),
|
|
257
234
|
snippet: z.string(),
|
|
258
|
-
date: z.
|
|
259
|
-
lastUpdated: z.
|
|
235
|
+
date: z.optional(z.string()),
|
|
236
|
+
lastUpdated: z.optional(z.string()),
|
|
260
237
|
}),
|
|
261
238
|
),
|
|
262
239
|
id: z.string(),
|
|
@@ -270,7 +247,7 @@ const perplexitySearchOutputSchema = lazySchema(() =>
|
|
|
270
247
|
'invalid_input',
|
|
271
248
|
'unknown',
|
|
272
249
|
]),
|
|
273
|
-
statusCode: z.
|
|
250
|
+
statusCode: z.optional(z.number()),
|
|
274
251
|
message: z.string(),
|
|
275
252
|
}),
|
|
276
253
|
]),
|