@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.
@@ -97,6 +97,23 @@ export interface TakoSearchConfig {
97
97
  };
98
98
  /** Maximum related search suggestions to include (1-20). */
99
99
  includeRelated?: number;
100
+ /**
101
+ * Serve per-unit-priced data, such as web traffic and SEO. Each such card adds
102
+ * a charge, capped by maxVariableCostUsd. On by default; set false to opt out,
103
+ * and those cards come back as placeholders.
104
+ */
105
+ variableCost?: boolean;
106
+ /**
107
+ * Most one call can be charged in variable cost, in USD. Defaults to 0.25;
108
+ * null removes the cap. Cards that don't fit come back as placeholders with
109
+ * reason 'over_cap'. Can't be combined with variableCost: false.
110
+ */
111
+ maxVariableCostUsd?: number | null;
112
+ /**
113
+ * Extra Tako request fields in snake_case, deep-merged into the body last.
114
+ * Can't set fields this tool models; Tako rejects unknown keys (api_error).
115
+ */
116
+ extraBody?: Record<string, unknown>;
100
117
  }
101
118
 
102
119
  export interface TakoSearchInput {
@@ -168,11 +185,22 @@ export interface TakoResultContent {
168
185
  expires_at?: string | null;
169
186
  total_rows?: number | null;
170
187
  truncated?: boolean;
188
+ /** Distinct records per premium class (e.g. company_record) among delivered rows. */
189
+ premium_rows?: Record<string, number> | null;
190
+ /** Column header → 0-based delivered-row positions whose premium value was withheld. */
191
+ redacted_cells?: Record<string, number[]> | null;
192
+ /** Full set size when the card lists only a capped slice of it. */
193
+ total_matching?: number | null;
171
194
  export_pricing?: {
172
195
  baseline_usd: number;
173
- free_rows: number;
196
+ /** @deprecated Always 0, and Tako will stop sending it. */
197
+ free_rows?: number;
174
198
  max_rows_ceiling: number;
175
199
  row_cpm_usd: number;
200
+ /** USD per 1,000 premium records by class, added to row_cpm_usd when premium. */
201
+ premium_row_cpm_usd?: Record<string, number> | null;
202
+ /** Upper bound on this card's variable-cost charge; set only for per-unit-priced sources. */
203
+ variable_cost_max_usd?: number | null;
176
204
  } | null;
177
205
  manifest?: Array<{
178
206
  dtype?: 'boolean' | 'date' | 'datetime' | 'number' | 'string' | null;
@@ -205,6 +233,8 @@ export interface TakoCard {
205
233
  source_indexes?: Array<'data' | 'web'> | null;
206
234
  card_type?: string | null;
207
235
  relevance?: 'High' | 'Low' | 'Medium' | null;
236
+ /** Relevance to the query, 1.0-5.0. Null unless the account is entitled. */
237
+ relevance_score?: number | null;
208
238
  content?: TakoResultContent | null;
209
239
  exportable?: boolean;
210
240
  nodes?: Array<{
@@ -222,6 +252,14 @@ export interface TakoCard {
222
252
  data_as_of?: string | null;
223
253
  last_updated?: string | null;
224
254
  } | null;
255
+ /**
256
+ * Set when Tako withholds the card's data: variable cost off or not served
257
+ * (`not_served`), or over maxVariableCostUsd (`over_cap`).
258
+ */
259
+ placeholder?: {
260
+ withheld_source: string;
261
+ reason?: 'not_served' | 'over_cap' | null;
262
+ } | null;
225
263
  }
226
264
 
227
265
  export interface TakoWebResult {
@@ -245,6 +283,10 @@ export interface TakoSearchResponse {
245
283
  data?: {
246
284
  cost_usd: number;
247
285
  datasets: number;
286
+ data_points?: number | null;
287
+ } | null;
288
+ variable_cost?: {
289
+ cost_usd: number;
248
290
  } | null;
249
291
  } | null;
250
292
  related?: Array<Record<string, unknown>> | null;
@@ -256,179 +298,168 @@ export type TakoSearchOutput = TakoSearchError | TakoSearchResponse;
256
298
 
257
299
  const takoDataSourceInputSchema = () =>
258
300
  z.object({
259
- count: z
260
- .number()
261
- .optional()
262
- .describe(
263
- 'Maximum number of data results to return (1-20). When include_contents is true, each additional result adds its own data surcharge.',
264
- ),
265
- include_contents: z
266
- .boolean()
267
- .optional()
268
- .describe(
269
- 'Inline rows for each data result. This adds a data surcharge based on row count and dataset source. To estimate cost, search with include_contents disabled and inspect cards.content.export_pricing. This applies to every returned card; limit sources.data.count and sources.data.max_rows to control cost.',
270
- ),
271
- mode: z
272
- .enum(['inline', 'url'])
273
- .optional()
274
- .describe(
275
- 'Requested data delivery mode. Search card data is always inline.',
276
- ),
277
- content_format: z
278
- .enum(['card_json', 'csv', 'json_compact', 'json_records'])
279
- .optional()
280
- .describe('Serialization for inlined card data.'),
281
- max_rows: z
282
- .number()
283
- .optional()
284
- .describe(
285
- 'Maximum rows to inline per result. Omit to use the allowance in cards.content.export_pricing. A data surcharge applies per 1,000 exported rows; lower values reduce cost.',
286
- ),
287
- node_ids: z
288
- .array(z.string())
289
- .optional()
290
- .describe('Data Graph node IDs to prioritize. Maximum 20.'),
291
- strict: z
292
- .boolean()
293
- .optional()
294
- .describe(
295
- 'Only return cards matching node_ids. Requires a non-empty node_ids.',
296
- ),
301
+ count: z.describe(
302
+ z.optional(z.number()),
303
+ 'Maximum number of data results to return (1-20). When include_contents is true, each additional result adds its own data surcharge.',
304
+ ),
305
+ include_contents: z.describe(
306
+ z.optional(z.boolean()),
307
+ 'Inline rows for each data result. This adds a data surcharge based on row count and dataset source. To estimate cost, search with include_contents disabled and inspect cards.content.export_pricing. This applies to every returned card; limit sources.data.count and sources.data.max_rows to control cost.',
308
+ ),
309
+ mode: z.describe(
310
+ z.optional(z.enum(['inline', 'url'])),
311
+ 'Requested data delivery mode. Search card data is always inline.',
312
+ ),
313
+ content_format: z.describe(
314
+ z.optional(z.enum(['card_json', 'csv', 'json_compact', 'json_records'])),
315
+ 'Serialization for inlined card data.',
316
+ ),
317
+ max_rows: z.describe(
318
+ z.optional(z.number()),
319
+ 'Maximum rows to inline per result. Omit to use the allowance in cards.content.export_pricing. A data surcharge applies per 1,000 exported rows; lower values reduce cost.',
320
+ ),
321
+ node_ids: z.describe(
322
+ z.optional(z.array(z.string())),
323
+ 'Data Graph node IDs to prioritize. Maximum 20.',
324
+ ),
325
+ strict: z.describe(
326
+ z.optional(z.boolean()),
327
+ 'Only return cards matching node_ids. Requires a non-empty node_ids.',
328
+ ),
297
329
  });
298
330
 
299
331
  const takoWebSourceInputSchema = () =>
300
332
  z.object({
301
- count: z
302
- .number()
303
- .optional()
304
- .describe('Maximum number of web results to return (1-20).'),
305
- include_contents: z
306
- .boolean()
307
- .optional()
308
- .describe('Inline extracted web page text. This can add a data charge.'),
309
- category: z
310
- .enum(['finance', 'news', 'sports'])
311
- .optional()
312
- .describe('Optional web-result category filter.'),
313
- include_domains: z
314
- .array(z.string())
315
- .optional()
316
- .describe('Only return results from these bare domains.'),
317
- exclude_domains: z
318
- .array(z.string())
319
- .optional()
320
- .describe('Exclude results from these bare domains.'),
321
- snippet_max_chars: z
322
- .number()
323
- .optional()
324
- .describe('Maximum characters in each web-result snippet.'),
325
- highlights: z
326
- .boolean()
327
- .optional()
328
- .describe(
329
- 'Include highlighted passages in web results. Defaults to true in AI Gateway.',
330
- ),
331
- article_content_max_chars: z
332
- .number()
333
- .optional()
334
- .describe(
335
- 'Maximum extracted characters per web page when including contents.',
336
- ),
337
- published_after: z
338
- .string()
339
- .optional()
340
- .describe(
341
- 'Keep results published on or after this ISO date (YYYY-MM-DD).',
342
- ),
343
- published_before: z
344
- .string()
345
- .optional()
346
- .describe(
347
- 'Keep results published on or before this ISO date (YYYY-MM-DD).',
348
- ),
333
+ count: z.describe(
334
+ z.optional(z.number()),
335
+ 'Maximum number of web results to return (1-20).',
336
+ ),
337
+ include_contents: z.describe(
338
+ z.optional(z.boolean()),
339
+ 'Inline extracted web page text. This can add a data charge.',
340
+ ),
341
+ category: z.describe(
342
+ z.optional(z.enum(['finance', 'news', 'sports'])),
343
+ 'Optional web-result category filter.',
344
+ ),
345
+ include_domains: z.describe(
346
+ z.optional(z.array(z.string())),
347
+ 'Only return results from these bare domains.',
348
+ ),
349
+ exclude_domains: z.describe(
350
+ z.optional(z.array(z.string())),
351
+ 'Exclude results from these bare domains.',
352
+ ),
353
+ snippet_max_chars: z.describe(
354
+ z.optional(z.number()),
355
+ 'Maximum characters in each web-result snippet.',
356
+ ),
357
+ highlights: z.describe(
358
+ z.optional(z.boolean()),
359
+ 'Include highlighted passages in web results. Defaults to true in AI Gateway.',
360
+ ),
361
+ article_content_max_chars: z.describe(
362
+ z.optional(z.number()),
363
+ 'Maximum extracted characters per web page when including contents.',
364
+ ),
365
+ published_after: z.describe(
366
+ z.optional(z.string()),
367
+ 'Keep results published on or after this ISO date (YYYY-MM-DD).',
368
+ ),
369
+ published_before: z.describe(
370
+ z.optional(z.string()),
371
+ 'Keep results published on or before this ISO date (YYYY-MM-DD).',
372
+ ),
349
373
  });
350
374
 
351
375
  const takoSearchInputSchema = lazySchema(() =>
352
376
  zodSchema(
353
377
  z.object({
354
- query: z
355
- .string()
356
- .describe(
357
- 'Natural-language search query. Include the entity, metric, and time period. Quote a phrase to force it to one entity, for example "Tesla":PRODUCT price.',
358
- ),
359
- effort: z
360
- .enum(['deep', 'fast', 'instant'])
361
- .optional()
362
- .describe(
363
- 'Search effort. fast is the balanced default, instant favors cached results and low latency, and deep broadens retrieval with reranking at higher cost and latency.',
378
+ query: z.describe(
379
+ z.string(),
380
+ 'Natural-language search query. Include the entity, metric, and time period. Quote a phrase to force it to one entity, for example "Tesla":PRODUCT price.',
381
+ ),
382
+ effort: z.describe(
383
+ z.optional(z.enum(['deep', 'fast', 'instant'])),
384
+ 'Search effort. fast is the balanced default, instant favors cached results and low latency, and deep broadens retrieval with reranking at higher cost and latency.',
385
+ ),
386
+ sources: z.describe(
387
+ z.optional(
388
+ z.object({
389
+ data: z.optional(takoDataSourceInputSchema()),
390
+ web: z.optional(takoWebSourceInputSchema()),
391
+ }),
364
392
  ),
365
- sources: z
366
- .object({
367
- data: takoDataSourceInputSchema().optional(),
368
- web: takoWebSourceInputSchema().optional(),
369
- })
370
- .optional()
371
- .describe(
372
- 'Sources to search. Omit to search both curated data and the web. When provided, only keys present are searched.',
393
+ 'Sources to search. Omit to search both curated data and the web. When provided, only keys present are searched.',
394
+ ),
395
+ location: z.describe(
396
+ z.optional(
397
+ z.object({
398
+ latitude: z.describe(z.number(), 'Latitude between -90 and 90.'),
399
+ longitude: z.describe(
400
+ z.number(),
401
+ 'Longitude between -180 and 180.',
402
+ ),
403
+ }),
373
404
  ),
374
- location: z
375
- .object({
376
- latitude: z.number().describe('Latitude between -90 and 90.'),
377
- longitude: z.number().describe('Longitude between -180 and 180.'),
378
- })
379
- .optional()
380
- .describe('End-user coordinates for localized results.'),
381
- country_code: z
382
- .string()
383
- .optional()
384
- .describe("Two-letter ISO 3166-1 country code, such as 'US'."),
385
- locale: z.string().optional().describe("BCP-47 locale, such as 'en-US'."),
386
- timezone: z
387
- .string()
388
- .optional()
389
- .describe("IANA timezone, such as 'America/New_York'."),
390
- output_settings: z
391
- .object({
392
- image_dark_mode: z
393
- .boolean()
394
- .optional()
395
- .describe('Render card preview images in dark mode.'),
396
- force_refresh: z
397
- .boolean()
398
- .optional()
399
- .describe(
405
+ 'End-user coordinates for localized results.',
406
+ ),
407
+ country_code: z.describe(
408
+ z.optional(z.string()),
409
+ "Two-letter ISO 3166-1 country code, such as 'US'.",
410
+ ),
411
+ locale: z.describe(
412
+ z.optional(z.string()),
413
+ "BCP-47 locale, such as 'en-US'.",
414
+ ),
415
+ timezone: z.describe(
416
+ z.optional(z.string()),
417
+ "IANA timezone, such as 'America/New_York'.",
418
+ ),
419
+ output_settings: z.describe(
420
+ z.optional(
421
+ z.object({
422
+ image_dark_mode: z.describe(
423
+ z.optional(z.boolean()),
424
+ 'Render card preview images in dark mode.',
425
+ ),
426
+ force_refresh: z.describe(
427
+ z.optional(z.boolean()),
400
428
  'Instant-effort only. Request a refreshed instant result.',
401
429
  ),
402
- })
403
- .optional()
404
- .describe('Controls card rendering in the search response.'),
405
- include_related: z
406
- .number()
407
- .optional()
408
- .describe('Maximum related search suggestions to include (1-20).'),
430
+ }),
431
+ ),
432
+ 'Controls card rendering in the search response.',
433
+ ),
434
+ include_related: z.describe(
435
+ z.optional(z.number()),
436
+ 'Maximum related search suggestions to include (1-20).',
437
+ ),
409
438
  }),
410
439
  ),
411
440
  );
412
441
 
413
442
  const takoDatasetCellSchema = () =>
414
- z.union([z.boolean(), z.number(), z.string()]).nullable();
443
+ z.nullable(z.union([z.boolean(), z.number(), z.string()]));
415
444
 
416
- const takoResultContentSchema = () =>
417
- z
418
- .object({
419
- content_format: z
420
- .enum(['card_json', 'csv', 'json_compact', 'json_records'])
421
- .nullish(),
422
- cost: z.number().optional(),
423
- data: z.string().nullish(),
424
- records: z.array(z.record(z.string(), takoDatasetCellSchema())).nullish(),
425
- dataset: z
426
- .object({
445
+ export const takoResultContentSchema = () =>
446
+ z.catchall(
447
+ z.object({
448
+ content_format: z.nullish(
449
+ z.enum(['card_json', 'csv', 'json_compact', 'json_records']),
450
+ ),
451
+ cost: z.optional(z.number()),
452
+ data: z.nullish(z.string()),
453
+ records: z.nullish(
454
+ z.array(z.record(z.string(), takoDatasetCellSchema())),
455
+ ),
456
+ dataset: z.nullish(
457
+ z.object({
427
458
  columns: z.array(
428
459
  z.object({
429
460
  name: z.string(),
430
461
  type: z.enum(['boolean', 'date', 'datetime', 'number', 'string']),
431
- unit: z.string().nullish(),
462
+ unit: z.nullish(z.string()),
432
463
  }),
433
464
  ),
434
465
  rows: z.array(z.array(takoDatasetCellSchema())),
@@ -438,131 +469,168 @@ const takoResultContentSchema = () =>
438
469
  sources: z.array(
439
470
  z.object({
440
471
  name: z.string(),
441
- index: z.enum(['data', 'web']).optional(),
472
+ index: z.optional(z.enum(['data', 'web'])),
442
473
  }),
443
474
  ),
444
- provenance: z.enum(['query', 'web_extraction']).optional(),
445
- })
446
- .nullish(),
447
- card_data: z.object({}).passthrough().nullish(),
448
- card_data_schema: z.object({}).passthrough().nullish(),
449
- url: z.string().nullish(),
450
- expires_at: z.string().nullish(),
451
- total_rows: z.number().nullish(),
452
- truncated: z.boolean().optional(),
453
- export_pricing: z
454
- .object({
455
- baseline_usd: z.number(),
456
- free_rows: z.number(),
457
- max_rows_ceiling: z.number(),
458
- row_cpm_usd: z.number(),
459
- })
460
- .nullish(),
461
- manifest: z
462
- .array(
475
+ provenance: z.optional(z.enum(['query', 'web_extraction'])),
476
+ }),
477
+ ),
478
+ card_data: z.nullish(z.catchall(z.object({}), z.unknown())),
479
+ card_data_schema: z.nullish(z.catchall(z.object({}), z.unknown())),
480
+ url: z.nullish(z.string()),
481
+ expires_at: z.nullish(z.string()),
482
+ total_rows: z.nullish(z.number()),
483
+ truncated: z.optional(z.boolean()),
484
+ premium_rows: z.nullish(z.record(z.string(), z.number())),
485
+ redacted_cells: z.nullish(z.record(z.string(), z.array(z.number()))),
486
+ total_matching: z.nullish(z.number()),
487
+ export_pricing: z.nullish(
488
+ z.catchall(
489
+ z.object({
490
+ baseline_usd: z.number(),
491
+ free_rows: z.optional(z.number()),
492
+ max_rows_ceiling: z.number(),
493
+ row_cpm_usd: z.number(),
494
+ premium_row_cpm_usd: z.nullish(z.record(z.string(), z.number())),
495
+ variable_cost_max_usd: z.nullish(z.number()),
496
+ }),
497
+ z.unknown(),
498
+ ),
499
+ ),
500
+ manifest: z.nullish(
501
+ z.array(
463
502
  z.object({
464
- dtype: z
465
- .enum(['boolean', 'date', 'datetime', 'number', 'string'])
466
- .nullish(),
467
- entity: z.string().nullish(),
468
- metric: z.string().nullish(),
469
- name: z.string().nullish(),
470
- unit: z.string().nullish(),
503
+ dtype: z.nullish(
504
+ z.enum(['boolean', 'date', 'datetime', 'number', 'string']),
505
+ ),
506
+ entity: z.nullish(z.string()),
507
+ metric: z.nullish(z.string()),
508
+ name: z.nullish(z.string()),
509
+ unit: z.nullish(z.string()),
471
510
  }),
472
- )
473
- .nullish(),
474
- })
475
- .passthrough();
511
+ ),
512
+ ),
513
+ }),
514
+ z.unknown(),
515
+ );
476
516
 
477
517
  const takoCardSchema = () =>
478
- z
479
- .object({
480
- card_id: z.string().nullish(),
481
- title: z.string().nullish(),
482
- description: z.string().nullish(),
483
- semantic_description: z.string().nullish(),
484
- webpage_url: z.string().nullish(),
485
- image_url: z.string().nullish(),
486
- embed_url: z.string().nullish(),
487
- sources: z
488
- .array(
518
+ z.catchall(
519
+ z.object({
520
+ card_id: z.nullish(z.string()),
521
+ title: z.nullish(z.string()),
522
+ description: z.nullish(z.string()),
523
+ semantic_description: z.nullish(z.string()),
524
+ webpage_url: z.nullish(z.string()),
525
+ image_url: z.nullish(z.string()),
526
+ embed_url: z.nullish(z.string()),
527
+ sources: z.nullish(
528
+ z.array(
489
529
  z.object({
490
- source_name: z.string().nullish(),
491
- source_description: z.string().nullish(),
530
+ source_name: z.nullish(z.string()),
531
+ source_description: z.nullish(z.string()),
492
532
  source_index: z.enum(['data', 'web']),
493
- source_text: z.string().nullish(),
494
- url: z.string().nullish(),
533
+ source_text: z.nullish(z.string()),
534
+ url: z.nullish(z.string()),
495
535
  }),
496
- )
497
- .nullish(),
498
- methodologies: z
499
- .array(
536
+ ),
537
+ ),
538
+ methodologies: z.nullish(
539
+ z.array(
500
540
  z.object({
501
- methodology_name: z.string().nullable(),
502
- methodology_description: z.string().nullable(),
541
+ methodology_name: z.nullable(z.string()),
542
+ methodology_description: z.nullable(z.string()),
503
543
  }),
504
- )
505
- .nullish(),
506
- source_indexes: z.array(z.enum(['data', 'web'])).nullish(),
507
- card_type: z.string().nullish(),
508
- relevance: z.enum(['High', 'Low', 'Medium']).nullish(),
509
- content: takoResultContentSchema().nullish(),
510
- exportable: z.boolean().optional(),
511
- nodes: z
512
- .array(
544
+ ),
545
+ ),
546
+ source_indexes: z.nullish(z.array(z.enum(['data', 'web']))),
547
+ card_type: z.nullish(z.string()),
548
+ relevance: z.nullish(z.enum(['High', 'Low', 'Medium'])),
549
+ relevance_score: z.nullish(z.number()),
550
+ content: z.nullish(takoResultContentSchema()),
551
+ exportable: z.optional(z.boolean()),
552
+ nodes: z.nullish(
553
+ z.array(
513
554
  z.object({
514
555
  id: z.string(),
515
556
  type: z.enum(['entity', 'metric']),
516
557
  name: z.string(),
517
- description: z.string().nullish(),
558
+ description: z.nullish(z.string()),
559
+ }),
560
+ ),
561
+ ),
562
+ metric_definitions: z.nullish(
563
+ z.array(z.object({ name: z.string(), definition: z.string() })),
564
+ ),
565
+ data_freshness: z.nullish(
566
+ z.object({
567
+ coverage_end: z.nullish(z.string()),
568
+ data_as_of: z.nullish(z.string()),
569
+ last_updated: z.nullish(z.string()),
570
+ }),
571
+ ),
572
+ placeholder: z.nullish(
573
+ z.catchall(
574
+ z.object({
575
+ withheld_source: z.string(),
576
+ reason: z.nullish(z.enum(['not_served', 'over_cap'])),
518
577
  }),
519
- )
520
- .nullish(),
521
- metric_definitions: z
522
- .array(z.object({ name: z.string(), definition: z.string() }))
523
- .nullish(),
524
- data_freshness: z
525
- .object({
526
- coverage_end: z.string().nullish(),
527
- data_as_of: z.string().nullish(),
528
- last_updated: z.string().nullish(),
529
- })
530
- .nullish(),
531
- })
532
- .passthrough();
578
+ z.unknown(),
579
+ ),
580
+ ),
581
+ }),
582
+ z.unknown(),
583
+ );
533
584
 
534
585
  const takoWebResultSchema = () =>
535
- z
536
- .object({
586
+ z.catchall(
587
+ z.object({
537
588
  title: z.string(),
538
589
  url: z.string(),
539
- snippet: z.string().nullish(),
540
- source_name: z.string().nullish(),
541
- publish_date: z.string().nullish(),
542
- content: takoResultContentSchema().nullish(),
543
- })
544
- .passthrough();
590
+ snippet: z.nullish(z.string()),
591
+ source_name: z.nullish(z.string()),
592
+ publish_date: z.nullish(z.string()),
593
+ content: z.nullish(takoResultContentSchema()),
594
+ }),
595
+ z.unknown(),
596
+ );
545
597
 
546
598
  const takoSearchOutputSchema = lazySchema(() =>
547
599
  zodSchema(
548
600
  z.union([
549
- z
550
- .object({
601
+ z.catchall(
602
+ z.object({
551
603
  request_id: z.string(),
552
- cards: z.array(takoCardSchema()).optional(),
553
- web_results: z.array(takoWebResultSchema()).optional(),
554
- usage: z
555
- .object({
556
- total_cost_usd: z.number(),
557
- compute: z.object({ cost_usd: z.number() }).nullish(),
558
- data: z
559
- .object({ cost_usd: z.number(), datasets: z.number() })
560
- .nullish(),
561
- })
562
- .nullish(),
563
- related: z.array(z.object({}).passthrough()).nullish(),
564
- })
565
- .passthrough(),
604
+ cards: z.optional(z.array(takoCardSchema())),
605
+ web_results: z.optional(z.array(takoWebResultSchema())),
606
+ usage: z.nullish(
607
+ z.catchall(
608
+ z.object({
609
+ total_cost_usd: z.number(),
610
+ compute: z.nullish(
611
+ z.catchall(z.object({ cost_usd: z.number() }), z.unknown()),
612
+ ),
613
+ data: z.nullish(
614
+ z.catchall(
615
+ z.object({
616
+ cost_usd: z.number(),
617
+ datasets: z.number(),
618
+ data_points: z.nullish(z.number()),
619
+ }),
620
+ z.unknown(),
621
+ ),
622
+ ),
623
+ variable_cost: z.nullish(
624
+ z.catchall(z.object({ cost_usd: z.number() }), z.unknown()),
625
+ ),
626
+ }),
627
+ z.unknown(),
628
+ ),
629
+ ),
630
+ related: z.nullish(z.array(z.catchall(z.object({}), z.unknown()))),
631
+ }),
632
+ z.unknown(),
633
+ ),
566
634
  gatewayToolErrorSchema(),
567
635
  ]),
568
636
  ),