@ai-sdk/gateway 3.0.137 → 3.0.138
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 +10 -0
- package/dist/index.d.mts +135 -0
- package/dist/index.d.ts +135 -0
- package/dist/index.js +214 -75
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +212 -69
- package/dist/index.mjs.map +1 -1
- package/docs/00-ai-gateway.mdx +87 -0
- package/package.json +3 -3
- package/src/gateway-tools.ts +10 -0
- package/src/gateway-video-model.ts +2 -0
- package/src/tool/exa-search.ts +352 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @ai-sdk/gateway
|
|
2
2
|
|
|
3
|
+
## 3.0.138
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fb601aa: feat (provider/gateway): add Exa search tool support
|
|
8
|
+
- f19334d: feat (video): add first-class `generateAudio` call option
|
|
9
|
+
- Updated dependencies [f19334d]
|
|
10
|
+
- @ai-sdk/provider@3.0.12
|
|
11
|
+
- @ai-sdk/provider-utils@4.0.32
|
|
12
|
+
|
|
3
13
|
## 3.0.137
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -436,10 +436,145 @@ interface ParallelSearchInput {
|
|
|
436
436
|
type ParallelSearchOutput = ParallelSearchResponse | ParallelSearchError;
|
|
437
437
|
declare const parallelSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<ParallelSearchInput, ParallelSearchOutput, ParallelSearchConfig>;
|
|
438
438
|
|
|
439
|
+
type ExaSearchType = 'auto' | 'fast' | 'instant';
|
|
440
|
+
type ExaSearchCategory = 'company' | 'people' | 'research paper' | 'news' | 'personal site' | 'financial report';
|
|
441
|
+
type ExaTextSection = 'header' | 'navigation' | 'banner' | 'body' | 'sidebar' | 'footer' | 'metadata';
|
|
442
|
+
interface ExaSearchTextConfig {
|
|
443
|
+
maxCharacters?: number;
|
|
444
|
+
includeHtmlTags?: boolean;
|
|
445
|
+
verbosity?: 'compact' | 'standard' | 'full';
|
|
446
|
+
includeSections?: ExaTextSection[];
|
|
447
|
+
excludeSections?: ExaTextSection[];
|
|
448
|
+
}
|
|
449
|
+
interface ExaSearchHighlightsConfig {
|
|
450
|
+
query?: string;
|
|
451
|
+
maxCharacters?: number;
|
|
452
|
+
}
|
|
453
|
+
interface ExaSearchExtrasConfig {
|
|
454
|
+
links?: number;
|
|
455
|
+
imageLinks?: number;
|
|
456
|
+
}
|
|
457
|
+
interface ExaSearchContentsConfig {
|
|
458
|
+
text?: boolean | ExaSearchTextConfig;
|
|
459
|
+
highlights?: boolean | ExaSearchHighlightsConfig;
|
|
460
|
+
maxAgeHours?: number;
|
|
461
|
+
livecrawlTimeout?: number;
|
|
462
|
+
subpages?: number;
|
|
463
|
+
subpageTarget?: string | string[];
|
|
464
|
+
extras?: ExaSearchExtrasConfig;
|
|
465
|
+
}
|
|
466
|
+
interface ExaSearchConfig {
|
|
467
|
+
/**
|
|
468
|
+
* Default search method. Exa defaults to auto when omitted.
|
|
469
|
+
*/
|
|
470
|
+
type?: ExaSearchType;
|
|
471
|
+
/**
|
|
472
|
+
* Default maximum number of results to return (1-100, default: 10).
|
|
473
|
+
*/
|
|
474
|
+
numResults?: number;
|
|
475
|
+
/**
|
|
476
|
+
* Default category filter for result types.
|
|
477
|
+
*/
|
|
478
|
+
category?: ExaSearchCategory;
|
|
479
|
+
/**
|
|
480
|
+
* Default two-letter ISO country code for location-aware search.
|
|
481
|
+
*/
|
|
482
|
+
userLocation?: string;
|
|
483
|
+
/**
|
|
484
|
+
* Default domains to include or exclude.
|
|
485
|
+
*/
|
|
486
|
+
includeDomains?: string[];
|
|
487
|
+
excludeDomains?: string[];
|
|
488
|
+
/**
|
|
489
|
+
* Default published date filters in ISO 8601 format.
|
|
490
|
+
*/
|
|
491
|
+
startPublishedDate?: string;
|
|
492
|
+
endPublishedDate?: string;
|
|
493
|
+
/**
|
|
494
|
+
* Default content extraction controls.
|
|
495
|
+
*/
|
|
496
|
+
contents?: ExaSearchContentsConfig;
|
|
497
|
+
}
|
|
498
|
+
interface ExaSearchResult {
|
|
499
|
+
title: string;
|
|
500
|
+
url: string;
|
|
501
|
+
id: string;
|
|
502
|
+
publishedDate?: string | null;
|
|
503
|
+
author?: string | null;
|
|
504
|
+
image?: string | null;
|
|
505
|
+
favicon?: string | null;
|
|
506
|
+
text?: string;
|
|
507
|
+
highlights?: string[];
|
|
508
|
+
highlightScores?: number[];
|
|
509
|
+
summary?: string;
|
|
510
|
+
subpages?: ExaSearchResult[];
|
|
511
|
+
extras?: {
|
|
512
|
+
links?: string[];
|
|
513
|
+
imageLinks?: string[];
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
interface ExaSearchResponse {
|
|
517
|
+
requestId: string;
|
|
518
|
+
searchType?: string;
|
|
519
|
+
resolvedSearchType?: string;
|
|
520
|
+
results: ExaSearchResult[];
|
|
521
|
+
costDollars?: {
|
|
522
|
+
total?: number;
|
|
523
|
+
search?: Record<string, number>;
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
interface ExaSearchError {
|
|
527
|
+
error: 'api_error' | 'rate_limit' | 'timeout' | 'invalid_input' | 'configuration_error' | 'execution_error' | 'unknown';
|
|
528
|
+
statusCode?: number;
|
|
529
|
+
message: string;
|
|
530
|
+
}
|
|
531
|
+
interface ExaSearchInput {
|
|
532
|
+
query: string;
|
|
533
|
+
type?: ExaSearchType;
|
|
534
|
+
num_results?: number;
|
|
535
|
+
category?: ExaSearchCategory;
|
|
536
|
+
user_location?: string;
|
|
537
|
+
include_domains?: string[];
|
|
538
|
+
exclude_domains?: string[];
|
|
539
|
+
start_published_date?: string;
|
|
540
|
+
end_published_date?: string;
|
|
541
|
+
contents?: {
|
|
542
|
+
text?: boolean | {
|
|
543
|
+
max_characters?: number;
|
|
544
|
+
include_html_tags?: boolean;
|
|
545
|
+
verbosity?: 'compact' | 'standard' | 'full';
|
|
546
|
+
include_sections?: ExaTextSection[];
|
|
547
|
+
exclude_sections?: ExaTextSection[];
|
|
548
|
+
};
|
|
549
|
+
highlights?: boolean | {
|
|
550
|
+
query?: string;
|
|
551
|
+
max_characters?: number;
|
|
552
|
+
};
|
|
553
|
+
max_age_hours?: number;
|
|
554
|
+
livecrawl_timeout?: number;
|
|
555
|
+
subpages?: number;
|
|
556
|
+
subpage_target?: string | string[];
|
|
557
|
+
extras?: {
|
|
558
|
+
links?: number;
|
|
559
|
+
image_links?: number;
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
type ExaSearchOutput = ExaSearchResponse | ExaSearchError;
|
|
564
|
+
declare const exaSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<ExaSearchInput, ExaSearchOutput, ExaSearchConfig>;
|
|
565
|
+
|
|
439
566
|
/**
|
|
440
567
|
* Gateway-specific provider-defined tools.
|
|
441
568
|
*/
|
|
442
569
|
declare const gatewayTools: {
|
|
570
|
+
/**
|
|
571
|
+
* Search the web using Exa for current information and token-efficient
|
|
572
|
+
* excerpts optimized for agent workflows.
|
|
573
|
+
*
|
|
574
|
+
* Supports search type, category, domain, date, location, and content
|
|
575
|
+
* extraction controls.
|
|
576
|
+
*/
|
|
577
|
+
exaSearch: (config?: ExaSearchConfig) => ReturnType<typeof exaSearchToolFactory>;
|
|
443
578
|
/**
|
|
444
579
|
* Search the web using Parallel AI's Search API for LLM-optimized excerpts.
|
|
445
580
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -436,10 +436,145 @@ interface ParallelSearchInput {
|
|
|
436
436
|
type ParallelSearchOutput = ParallelSearchResponse | ParallelSearchError;
|
|
437
437
|
declare const parallelSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<ParallelSearchInput, ParallelSearchOutput, ParallelSearchConfig>;
|
|
438
438
|
|
|
439
|
+
type ExaSearchType = 'auto' | 'fast' | 'instant';
|
|
440
|
+
type ExaSearchCategory = 'company' | 'people' | 'research paper' | 'news' | 'personal site' | 'financial report';
|
|
441
|
+
type ExaTextSection = 'header' | 'navigation' | 'banner' | 'body' | 'sidebar' | 'footer' | 'metadata';
|
|
442
|
+
interface ExaSearchTextConfig {
|
|
443
|
+
maxCharacters?: number;
|
|
444
|
+
includeHtmlTags?: boolean;
|
|
445
|
+
verbosity?: 'compact' | 'standard' | 'full';
|
|
446
|
+
includeSections?: ExaTextSection[];
|
|
447
|
+
excludeSections?: ExaTextSection[];
|
|
448
|
+
}
|
|
449
|
+
interface ExaSearchHighlightsConfig {
|
|
450
|
+
query?: string;
|
|
451
|
+
maxCharacters?: number;
|
|
452
|
+
}
|
|
453
|
+
interface ExaSearchExtrasConfig {
|
|
454
|
+
links?: number;
|
|
455
|
+
imageLinks?: number;
|
|
456
|
+
}
|
|
457
|
+
interface ExaSearchContentsConfig {
|
|
458
|
+
text?: boolean | ExaSearchTextConfig;
|
|
459
|
+
highlights?: boolean | ExaSearchHighlightsConfig;
|
|
460
|
+
maxAgeHours?: number;
|
|
461
|
+
livecrawlTimeout?: number;
|
|
462
|
+
subpages?: number;
|
|
463
|
+
subpageTarget?: string | string[];
|
|
464
|
+
extras?: ExaSearchExtrasConfig;
|
|
465
|
+
}
|
|
466
|
+
interface ExaSearchConfig {
|
|
467
|
+
/**
|
|
468
|
+
* Default search method. Exa defaults to auto when omitted.
|
|
469
|
+
*/
|
|
470
|
+
type?: ExaSearchType;
|
|
471
|
+
/**
|
|
472
|
+
* Default maximum number of results to return (1-100, default: 10).
|
|
473
|
+
*/
|
|
474
|
+
numResults?: number;
|
|
475
|
+
/**
|
|
476
|
+
* Default category filter for result types.
|
|
477
|
+
*/
|
|
478
|
+
category?: ExaSearchCategory;
|
|
479
|
+
/**
|
|
480
|
+
* Default two-letter ISO country code for location-aware search.
|
|
481
|
+
*/
|
|
482
|
+
userLocation?: string;
|
|
483
|
+
/**
|
|
484
|
+
* Default domains to include or exclude.
|
|
485
|
+
*/
|
|
486
|
+
includeDomains?: string[];
|
|
487
|
+
excludeDomains?: string[];
|
|
488
|
+
/**
|
|
489
|
+
* Default published date filters in ISO 8601 format.
|
|
490
|
+
*/
|
|
491
|
+
startPublishedDate?: string;
|
|
492
|
+
endPublishedDate?: string;
|
|
493
|
+
/**
|
|
494
|
+
* Default content extraction controls.
|
|
495
|
+
*/
|
|
496
|
+
contents?: ExaSearchContentsConfig;
|
|
497
|
+
}
|
|
498
|
+
interface ExaSearchResult {
|
|
499
|
+
title: string;
|
|
500
|
+
url: string;
|
|
501
|
+
id: string;
|
|
502
|
+
publishedDate?: string | null;
|
|
503
|
+
author?: string | null;
|
|
504
|
+
image?: string | null;
|
|
505
|
+
favicon?: string | null;
|
|
506
|
+
text?: string;
|
|
507
|
+
highlights?: string[];
|
|
508
|
+
highlightScores?: number[];
|
|
509
|
+
summary?: string;
|
|
510
|
+
subpages?: ExaSearchResult[];
|
|
511
|
+
extras?: {
|
|
512
|
+
links?: string[];
|
|
513
|
+
imageLinks?: string[];
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
interface ExaSearchResponse {
|
|
517
|
+
requestId: string;
|
|
518
|
+
searchType?: string;
|
|
519
|
+
resolvedSearchType?: string;
|
|
520
|
+
results: ExaSearchResult[];
|
|
521
|
+
costDollars?: {
|
|
522
|
+
total?: number;
|
|
523
|
+
search?: Record<string, number>;
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
interface ExaSearchError {
|
|
527
|
+
error: 'api_error' | 'rate_limit' | 'timeout' | 'invalid_input' | 'configuration_error' | 'execution_error' | 'unknown';
|
|
528
|
+
statusCode?: number;
|
|
529
|
+
message: string;
|
|
530
|
+
}
|
|
531
|
+
interface ExaSearchInput {
|
|
532
|
+
query: string;
|
|
533
|
+
type?: ExaSearchType;
|
|
534
|
+
num_results?: number;
|
|
535
|
+
category?: ExaSearchCategory;
|
|
536
|
+
user_location?: string;
|
|
537
|
+
include_domains?: string[];
|
|
538
|
+
exclude_domains?: string[];
|
|
539
|
+
start_published_date?: string;
|
|
540
|
+
end_published_date?: string;
|
|
541
|
+
contents?: {
|
|
542
|
+
text?: boolean | {
|
|
543
|
+
max_characters?: number;
|
|
544
|
+
include_html_tags?: boolean;
|
|
545
|
+
verbosity?: 'compact' | 'standard' | 'full';
|
|
546
|
+
include_sections?: ExaTextSection[];
|
|
547
|
+
exclude_sections?: ExaTextSection[];
|
|
548
|
+
};
|
|
549
|
+
highlights?: boolean | {
|
|
550
|
+
query?: string;
|
|
551
|
+
max_characters?: number;
|
|
552
|
+
};
|
|
553
|
+
max_age_hours?: number;
|
|
554
|
+
livecrawl_timeout?: number;
|
|
555
|
+
subpages?: number;
|
|
556
|
+
subpage_target?: string | string[];
|
|
557
|
+
extras?: {
|
|
558
|
+
links?: number;
|
|
559
|
+
image_links?: number;
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
type ExaSearchOutput = ExaSearchResponse | ExaSearchError;
|
|
564
|
+
declare const exaSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<ExaSearchInput, ExaSearchOutput, ExaSearchConfig>;
|
|
565
|
+
|
|
439
566
|
/**
|
|
440
567
|
* Gateway-specific provider-defined tools.
|
|
441
568
|
*/
|
|
442
569
|
declare const gatewayTools: {
|
|
570
|
+
/**
|
|
571
|
+
* Search the web using Exa for current information and token-efficient
|
|
572
|
+
* excerpts optimized for agent workflows.
|
|
573
|
+
*
|
|
574
|
+
* Supports search type, category, domain, date, location, and content
|
|
575
|
+
* extraction controls.
|
|
576
|
+
*/
|
|
577
|
+
exaSearch: (config?: ExaSearchConfig) => ReturnType<typeof exaSearchToolFactory>;
|
|
443
578
|
/**
|
|
444
579
|
* Search the web using Parallel AI's Search API for LLM-optimized excerpts.
|
|
445
580
|
*
|