@ai-sdk/gateway 3.0.218 → 3.0.220
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 +23 -0
- package/dist/index.d.mts +83 -32
- package/dist/index.d.ts +83 -32
- package/dist/index.js +138 -91
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +186 -131
- package/dist/index.mjs.map +1 -1
- package/docs/00-ai-gateway.mdx +30 -11
- package/package.json +2 -2
- package/src/gateway-embedding-model.ts +18 -17
- package/src/gateway-image-model.ts +49 -40
- package/src/gateway-language-model-settings.ts +3 -1
- package/src/gateway-reranking-model-settings.ts +2 -0
- package/src/gateway-reranking-model.ts +18 -17
- package/src/gateway-speech-model-settings.ts +1 -0
- package/src/gateway-speech-model.ts +36 -29
- package/src/gateway-transcription-model-settings.ts +2 -0
- package/src/gateway-transcription-model.ts +47 -40
- package/src/gateway-video-model.ts +64 -55
- package/src/tool/browserbase-fetch.ts +3 -3
- package/src/tool/parallel-search.ts +158 -46
- package/src/tool/tako-search.ts +220 -214
package/dist/index.js
CHANGED
|
@@ -1112,7 +1112,7 @@ var GatewayEmbeddingModel = class {
|
|
|
1112
1112
|
};
|
|
1113
1113
|
}
|
|
1114
1114
|
};
|
|
1115
|
-
var gatewayEmbeddingWarningSchema = import_v49.z.discriminatedUnion("type", [
|
|
1115
|
+
var gatewayEmbeddingWarningSchema = () => import_v49.z.discriminatedUnion("type", [
|
|
1116
1116
|
import_v49.z.object({
|
|
1117
1117
|
type: import_v49.z.literal("unsupported"),
|
|
1118
1118
|
feature: import_v49.z.string(),
|
|
@@ -1133,7 +1133,7 @@ var gatewayEmbeddingResponseSchema = (0, import_provider_utils10.lazySchema)(
|
|
|
1133
1133
|
import_v49.z.object({
|
|
1134
1134
|
embeddings: import_v49.z.array(import_v49.z.array(import_v49.z.number())),
|
|
1135
1135
|
usage: import_v49.z.object({ tokens: import_v49.z.number() }).nullish(),
|
|
1136
|
-
warnings: import_v49.z.array(gatewayEmbeddingWarningSchema).optional(),
|
|
1136
|
+
warnings: import_v49.z.array(gatewayEmbeddingWarningSchema()).optional(),
|
|
1137
1137
|
providerMetadata: import_v49.z.record(import_v49.z.string(), import_v49.z.record(import_v49.z.string(), import_v49.z.unknown())).optional()
|
|
1138
1138
|
})
|
|
1139
1139
|
)
|
|
@@ -1258,10 +1258,10 @@ function maybeEncodeImageFile(file) {
|
|
|
1258
1258
|
}
|
|
1259
1259
|
return file;
|
|
1260
1260
|
}
|
|
1261
|
-
var providerMetadataEntrySchema = import_v410.z.object({
|
|
1261
|
+
var providerMetadataEntrySchema = () => import_v410.z.object({
|
|
1262
1262
|
images: import_v410.z.array(import_v410.z.unknown()).optional()
|
|
1263
1263
|
}).catchall(import_v410.z.unknown());
|
|
1264
|
-
var gatewayImageWarningSchema = import_v410.z.discriminatedUnion("type", [
|
|
1264
|
+
var gatewayImageWarningSchema = () => import_v410.z.discriminatedUnion("type", [
|
|
1265
1265
|
import_v410.z.object({
|
|
1266
1266
|
type: import_v410.z.literal("unsupported"),
|
|
1267
1267
|
feature: import_v410.z.string(),
|
|
@@ -1282,19 +1282,23 @@ var gatewayImageWarningSchema = import_v410.z.discriminatedUnion("type", [
|
|
|
1282
1282
|
message: import_v410.z.string()
|
|
1283
1283
|
})
|
|
1284
1284
|
]);
|
|
1285
|
-
var gatewayImageUsageSchema = import_v410.z.object({
|
|
1285
|
+
var gatewayImageUsageSchema = () => import_v410.z.object({
|
|
1286
1286
|
inputTokens: import_v410.z.number().nullish(),
|
|
1287
1287
|
outputTokens: import_v410.z.number().nullish(),
|
|
1288
1288
|
totalTokens: import_v410.z.number().nullish()
|
|
1289
1289
|
});
|
|
1290
|
-
var gatewayImageResponseSchema =
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1290
|
+
var gatewayImageResponseSchema = (0, import_provider_utils11.lazySchema)(
|
|
1291
|
+
() => (0, import_provider_utils11.zodSchema)(
|
|
1292
|
+
import_v410.z.object({
|
|
1293
|
+
images: import_v410.z.array(import_v410.z.string()),
|
|
1294
|
+
// Always base64 strings over the wire
|
|
1295
|
+
isRetryable: import_v410.z.boolean().optional(),
|
|
1296
|
+
warnings: import_v410.z.array(gatewayImageWarningSchema()).optional(),
|
|
1297
|
+
providerMetadata: import_v410.z.record(import_v410.z.string(), providerMetadataEntrySchema()).optional(),
|
|
1298
|
+
usage: gatewayImageUsageSchema().optional()
|
|
1299
|
+
})
|
|
1300
|
+
)
|
|
1301
|
+
);
|
|
1298
1302
|
|
|
1299
1303
|
// src/gateway-video-model.ts
|
|
1300
1304
|
var import_provider2 = require("@ai-sdk/provider");
|
|
@@ -1468,10 +1472,10 @@ function maybeEncodeVideoFile(file) {
|
|
|
1468
1472
|
}
|
|
1469
1473
|
return file;
|
|
1470
1474
|
}
|
|
1471
|
-
var providerMetadataEntrySchema2 = import_v411.z.object({
|
|
1475
|
+
var providerMetadataEntrySchema2 = () => import_v411.z.object({
|
|
1472
1476
|
videos: import_v411.z.array(import_v411.z.unknown()).optional()
|
|
1473
1477
|
}).catchall(import_v411.z.unknown());
|
|
1474
|
-
var gatewayVideoDataSchema = import_v411.z.union([
|
|
1478
|
+
var gatewayVideoDataSchema = () => import_v411.z.union([
|
|
1475
1479
|
import_v411.z.object({
|
|
1476
1480
|
type: import_v411.z.literal("url"),
|
|
1477
1481
|
url: import_v411.z.string(),
|
|
@@ -1483,7 +1487,7 @@ var gatewayVideoDataSchema = import_v411.z.union([
|
|
|
1483
1487
|
mediaType: import_v411.z.string()
|
|
1484
1488
|
})
|
|
1485
1489
|
]);
|
|
1486
|
-
var gatewayVideoWarningSchema = import_v411.z.discriminatedUnion("type", [
|
|
1490
|
+
var gatewayVideoWarningSchema = () => import_v411.z.discriminatedUnion("type", [
|
|
1487
1491
|
import_v411.z.object({
|
|
1488
1492
|
type: import_v411.z.literal("unsupported"),
|
|
1489
1493
|
feature: import_v411.z.string(),
|
|
@@ -1504,21 +1508,25 @@ var gatewayVideoWarningSchema = import_v411.z.discriminatedUnion("type", [
|
|
|
1504
1508
|
message: import_v411.z.string()
|
|
1505
1509
|
})
|
|
1506
1510
|
]);
|
|
1507
|
-
var gatewayVideoEventSchema =
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1511
|
+
var gatewayVideoEventSchema = (0, import_provider_utils12.lazySchema)(
|
|
1512
|
+
() => (0, import_provider_utils12.zodSchema)(
|
|
1513
|
+
import_v411.z.discriminatedUnion("type", [
|
|
1514
|
+
import_v411.z.object({
|
|
1515
|
+
type: import_v411.z.literal("result"),
|
|
1516
|
+
videos: import_v411.z.array(gatewayVideoDataSchema()),
|
|
1517
|
+
warnings: import_v411.z.array(gatewayVideoWarningSchema()).optional(),
|
|
1518
|
+
providerMetadata: import_v411.z.record(import_v411.z.string(), providerMetadataEntrySchema2()).optional()
|
|
1519
|
+
}),
|
|
1520
|
+
import_v411.z.object({
|
|
1521
|
+
type: import_v411.z.literal("error"),
|
|
1522
|
+
message: import_v411.z.string(),
|
|
1523
|
+
errorType: import_v411.z.string(),
|
|
1524
|
+
statusCode: import_v411.z.number(),
|
|
1525
|
+
param: import_v411.z.unknown().nullable()
|
|
1526
|
+
})
|
|
1527
|
+
])
|
|
1528
|
+
)
|
|
1529
|
+
);
|
|
1522
1530
|
|
|
1523
1531
|
// src/gateway-reranking-model.ts
|
|
1524
1532
|
var import_provider_utils13 = require("@ai-sdk/provider-utils");
|
|
@@ -1594,7 +1602,7 @@ var GatewayRerankingModel = class {
|
|
|
1594
1602
|
};
|
|
1595
1603
|
}
|
|
1596
1604
|
};
|
|
1597
|
-
var gatewayRerankingWarningSchema = import_v412.z.discriminatedUnion("type", [
|
|
1605
|
+
var gatewayRerankingWarningSchema = () => import_v412.z.discriminatedUnion("type", [
|
|
1598
1606
|
import_v412.z.object({
|
|
1599
1607
|
type: import_v412.z.literal("unsupported"),
|
|
1600
1608
|
feature: import_v412.z.string(),
|
|
@@ -1619,7 +1627,7 @@ var gatewayRerankingResponseSchema = (0, import_provider_utils13.lazySchema)(
|
|
|
1619
1627
|
relevanceScore: import_v412.z.number()
|
|
1620
1628
|
})
|
|
1621
1629
|
),
|
|
1622
|
-
warnings: import_v412.z.array(gatewayRerankingWarningSchema).optional(),
|
|
1630
|
+
warnings: import_v412.z.array(gatewayRerankingWarningSchema()).optional(),
|
|
1623
1631
|
providerMetadata: import_v412.z.record(import_v412.z.string(), import_v412.z.record(import_v412.z.string(), import_v412.z.unknown())).optional()
|
|
1624
1632
|
})
|
|
1625
1633
|
)
|
|
@@ -1712,8 +1720,8 @@ var GatewaySpeechModel = class {
|
|
|
1712
1720
|
};
|
|
1713
1721
|
}
|
|
1714
1722
|
};
|
|
1715
|
-
var providerMetadataEntrySchema3 = import_v413.z.object({}).catchall(import_v413.z.unknown());
|
|
1716
|
-
var gatewaySpeechWarningSchema = import_v413.z.discriminatedUnion("type", [
|
|
1723
|
+
var providerMetadataEntrySchema3 = () => import_v413.z.object({}).catchall(import_v413.z.unknown());
|
|
1724
|
+
var gatewaySpeechWarningSchema = () => import_v413.z.discriminatedUnion("type", [
|
|
1717
1725
|
import_v413.z.object({
|
|
1718
1726
|
type: import_v413.z.literal("unsupported"),
|
|
1719
1727
|
feature: import_v413.z.string(),
|
|
@@ -1734,11 +1742,15 @@ var gatewaySpeechWarningSchema = import_v413.z.discriminatedUnion("type", [
|
|
|
1734
1742
|
message: import_v413.z.string()
|
|
1735
1743
|
})
|
|
1736
1744
|
]);
|
|
1737
|
-
var gatewaySpeechResponseSchema =
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1745
|
+
var gatewaySpeechResponseSchema = (0, import_provider_utils14.lazySchema)(
|
|
1746
|
+
() => (0, import_provider_utils14.zodSchema)(
|
|
1747
|
+
import_v413.z.object({
|
|
1748
|
+
audio: import_v413.z.string(),
|
|
1749
|
+
warnings: import_v413.z.array(gatewaySpeechWarningSchema()).optional(),
|
|
1750
|
+
providerMetadata: import_v413.z.record(import_v413.z.string(), providerMetadataEntrySchema3()).optional()
|
|
1751
|
+
})
|
|
1752
|
+
)
|
|
1753
|
+
);
|
|
1742
1754
|
|
|
1743
1755
|
// src/gateway-transcription-model.ts
|
|
1744
1756
|
var import_provider_utils15 = require("@ai-sdk/provider-utils");
|
|
@@ -1823,8 +1835,8 @@ var GatewayTranscriptionModel = class {
|
|
|
1823
1835
|
};
|
|
1824
1836
|
}
|
|
1825
1837
|
};
|
|
1826
|
-
var providerMetadataEntrySchema4 = import_v414.z.object({}).catchall(import_v414.z.unknown());
|
|
1827
|
-
var gatewayTranscriptionWarningSchema = import_v414.z.discriminatedUnion("type", [
|
|
1838
|
+
var providerMetadataEntrySchema4 = () => import_v414.z.object({}).catchall(import_v414.z.unknown());
|
|
1839
|
+
var gatewayTranscriptionWarningSchema = () => import_v414.z.discriminatedUnion("type", [
|
|
1828
1840
|
import_v414.z.object({
|
|
1829
1841
|
type: import_v414.z.literal("unsupported"),
|
|
1830
1842
|
feature: import_v414.z.string(),
|
|
@@ -1845,25 +1857,29 @@ var gatewayTranscriptionWarningSchema = import_v414.z.discriminatedUnion("type",
|
|
|
1845
1857
|
message: import_v414.z.string()
|
|
1846
1858
|
})
|
|
1847
1859
|
]);
|
|
1848
|
-
var gatewayTranscriptionResponseSchema =
|
|
1849
|
-
|
|
1850
|
-
segments: import_v414.z.array(
|
|
1860
|
+
var gatewayTranscriptionResponseSchema = (0, import_provider_utils15.lazySchema)(
|
|
1861
|
+
() => (0, import_provider_utils15.zodSchema)(
|
|
1851
1862
|
import_v414.z.object({
|
|
1852
1863
|
text: import_v414.z.string(),
|
|
1853
|
-
|
|
1854
|
-
|
|
1864
|
+
segments: import_v414.z.array(
|
|
1865
|
+
import_v414.z.object({
|
|
1866
|
+
text: import_v414.z.string(),
|
|
1867
|
+
startSecond: import_v414.z.number(),
|
|
1868
|
+
endSecond: import_v414.z.number()
|
|
1869
|
+
})
|
|
1870
|
+
).optional(),
|
|
1871
|
+
language: import_v414.z.string().nullish(),
|
|
1872
|
+
durationInSeconds: import_v414.z.number().nullish(),
|
|
1873
|
+
warnings: import_v414.z.array(gatewayTranscriptionWarningSchema()).optional(),
|
|
1874
|
+
providerMetadata: import_v414.z.record(import_v414.z.string(), providerMetadataEntrySchema4()).optional()
|
|
1855
1875
|
})
|
|
1856
|
-
)
|
|
1857
|
-
|
|
1858
|
-
durationInSeconds: import_v414.z.number().nullish(),
|
|
1859
|
-
warnings: import_v414.z.array(gatewayTranscriptionWarningSchema).optional(),
|
|
1860
|
-
providerMetadata: import_v414.z.record(import_v414.z.string(), providerMetadataEntrySchema4).optional()
|
|
1861
|
-
});
|
|
1876
|
+
)
|
|
1877
|
+
);
|
|
1862
1878
|
|
|
1863
1879
|
// src/tool/browserbase-fetch.ts
|
|
1864
1880
|
var import_provider_utils16 = require("@ai-sdk/provider-utils");
|
|
1865
1881
|
var import_zod = require("zod");
|
|
1866
|
-
var jsonObjectSchema = import_zod.z.record(import_zod.z.string(), import_zod.z.unknown());
|
|
1882
|
+
var jsonObjectSchema = () => import_zod.z.record(import_zod.z.string(), import_zod.z.unknown());
|
|
1867
1883
|
var browserbaseFetchInputSchema = (0, import_provider_utils16.lazySchema)(
|
|
1868
1884
|
() => (0, import_provider_utils16.zodSchema)(
|
|
1869
1885
|
import_zod.z.object({
|
|
@@ -1878,7 +1894,7 @@ var browserbaseFetchInputSchema = (0, import_provider_utils16.lazySchema)(
|
|
|
1878
1894
|
format: import_zod.z.enum(["raw", "json", "markdown"]).optional().describe(
|
|
1879
1895
|
"Output format. raw returns the response body unchanged, markdown returns page content as Markdown, and json returns structured content using schema."
|
|
1880
1896
|
),
|
|
1881
|
-
schema: jsonObjectSchema.optional().describe(
|
|
1897
|
+
schema: jsonObjectSchema().optional().describe(
|
|
1882
1898
|
"JSON Schema for structured extraction. Only use with format set to json."
|
|
1883
1899
|
)
|
|
1884
1900
|
})
|
|
@@ -1889,7 +1905,7 @@ var browserbaseFetchOutputSchema = (0, import_provider_utils16.lazySchema)(
|
|
|
1889
1905
|
import_zod.z.union([
|
|
1890
1906
|
import_zod.z.object({
|
|
1891
1907
|
id: import_zod.z.string(),
|
|
1892
|
-
content: import_zod.z.union([import_zod.z.string(), jsonObjectSchema]),
|
|
1908
|
+
content: import_zod.z.union([import_zod.z.string(), jsonObjectSchema()]),
|
|
1893
1909
|
contentType: import_zod.z.string(),
|
|
1894
1910
|
encoding: import_zod.z.string(),
|
|
1895
1911
|
headers: import_zod.z.record(import_zod.z.string(), import_zod.z.string()),
|
|
@@ -2102,6 +2118,14 @@ var exaSearch = (config = {}) => exaSearchToolFactory(config);
|
|
|
2102
2118
|
// src/tool/parallel-search.ts
|
|
2103
2119
|
var import_provider_utils19 = require("@ai-sdk/provider-utils");
|
|
2104
2120
|
var import_zod4 = require("zod");
|
|
2121
|
+
var parallelSearchModes = [
|
|
2122
|
+
"turbo",
|
|
2123
|
+
"fast",
|
|
2124
|
+
"basic",
|
|
2125
|
+
"advanced",
|
|
2126
|
+
"one-shot",
|
|
2127
|
+
"agentic"
|
|
2128
|
+
];
|
|
2105
2129
|
var parallelSearchInputSchema = (0, import_provider_utils19.lazySchema)(
|
|
2106
2130
|
() => (0, import_provider_utils19.zodSchema)(
|
|
2107
2131
|
import_zod4.z.object({
|
|
@@ -2109,64 +2133,85 @@ var parallelSearchInputSchema = (0, import_provider_utils19.lazySchema)(
|
|
|
2109
2133
|
"Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."
|
|
2110
2134
|
),
|
|
2111
2135
|
search_queries: import_zod4.z.array(import_zod4.z.string()).optional().describe(
|
|
2112
|
-
"
|
|
2136
|
+
"Provide 2-3 concise keyword queries, 3-6 words each (max 5, 200 chars each). Strongly recommended; the search runs on these queries."
|
|
2113
2137
|
),
|
|
2114
|
-
mode: import_zod4.z.enum(
|
|
2115
|
-
'
|
|
2138
|
+
mode: import_zod4.z.enum(parallelSearchModes).optional().describe(
|
|
2139
|
+
'Search mode: "turbo" and "fast" return quickly with shorter excerpts, "basic" is balanced (default), "advanced" is the most thorough. "turbo" supports English and Japanese only. "one-shot" and "agentic" are deprecated aliases of "basic" and "advanced".'
|
|
2116
2140
|
),
|
|
2117
2141
|
max_results: import_zod4.z.number().optional().describe(
|
|
2118
2142
|
"Maximum number of results to return (1-20). Defaults to 10 if not specified."
|
|
2119
2143
|
),
|
|
2120
2144
|
source_policy: import_zod4.z.object({
|
|
2121
2145
|
include_domains: import_zod4.z.array(import_zod4.z.string()).optional().describe(
|
|
2122
|
-
"
|
|
2146
|
+
"Domains or domain/path prefixes to restrict results to, without scheme or port. Example: ['wikipedia.org', 'docs.python.org/3']."
|
|
2123
2147
|
),
|
|
2124
2148
|
exclude_domains: import_zod4.z.array(import_zod4.z.string()).optional().describe(
|
|
2125
|
-
"
|
|
2149
|
+
"Domains or domain/path prefixes to exclude, without scheme or port. Example: ['reddit.com']."
|
|
2126
2150
|
),
|
|
2127
2151
|
after_date: import_zod4.z.string().optional().describe(
|
|
2128
|
-
"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."
|
|
2152
|
+
"Only include results published on or after this date. Use an ISO 8601 calendar date formatted YYYY-MM-DD (e.g. 2025-01-01); do not include a time."
|
|
2129
2153
|
)
|
|
2130
2154
|
}).optional().describe(
|
|
2131
2155
|
"Source policy for controlling which domains to include/exclude and freshness."
|
|
2132
2156
|
),
|
|
2133
2157
|
excerpts: import_zod4.z.object({
|
|
2134
2158
|
max_chars_per_result: import_zod4.z.number().optional().describe("Maximum characters per result."),
|
|
2135
|
-
max_chars_total: import_zod4.z.number().optional().describe("
|
|
2159
|
+
max_chars_total: import_zod4.z.number().optional().describe("Deprecated: use the top-level max_chars_total.")
|
|
2136
2160
|
}).optional().describe("Excerpt configuration for controlling result length."),
|
|
2161
|
+
max_chars_total: import_zod4.z.number().optional().describe("Maximum total characters across all result excerpts."),
|
|
2137
2162
|
fetch_policy: import_zod4.z.object({
|
|
2138
2163
|
max_age_seconds: import_zod4.z.number().optional().describe(
|
|
2139
|
-
"Maximum age
|
|
2164
|
+
"Maximum age of cached content in seconds before a live fetch, minimum 600."
|
|
2165
|
+
),
|
|
2166
|
+
timeout_seconds: import_zod4.z.number().optional().describe(
|
|
2167
|
+
"Timeout in seconds for a live fetch when content is not cached. Capped by the gateway tool timeout."
|
|
2168
|
+
),
|
|
2169
|
+
disable_cache_fallback: import_zod4.z.boolean().optional().describe(
|
|
2170
|
+
"Return an error instead of older cached content when a live fetch fails."
|
|
2140
2171
|
)
|
|
2141
|
-
}).optional().describe("Fetch policy for controlling content freshness.")
|
|
2172
|
+
}).optional().describe("Fetch policy for controlling content freshness."),
|
|
2173
|
+
location: import_zod4.z.string().optional().describe(
|
|
2174
|
+
'ISO 3166-1 alpha-2 country code to localize results, e.g. "us".'
|
|
2175
|
+
)
|
|
2142
2176
|
})
|
|
2143
2177
|
)
|
|
2144
2178
|
);
|
|
2145
2179
|
var parallelSearchOutputSchema = (0, import_provider_utils19.lazySchema)(
|
|
2146
2180
|
() => (0, import_provider_utils19.zodSchema)(
|
|
2147
2181
|
import_zod4.z.union([
|
|
2148
|
-
// Success response
|
|
2182
|
+
// Success response (Parallel's response, passed through by the gateway)
|
|
2149
2183
|
import_zod4.z.object({
|
|
2150
|
-
|
|
2184
|
+
search_id: import_zod4.z.string(),
|
|
2151
2185
|
results: import_zod4.z.array(
|
|
2152
2186
|
import_zod4.z.object({
|
|
2153
2187
|
url: import_zod4.z.string(),
|
|
2154
|
-
title: import_zod4.z.string(),
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
relevanceScore: import_zod4.z.number().optional()
|
|
2188
|
+
title: import_zod4.z.string().nullable().optional(),
|
|
2189
|
+
publish_date: import_zod4.z.string().nullable().optional(),
|
|
2190
|
+
excerpts: import_zod4.z.array(import_zod4.z.string())
|
|
2158
2191
|
})
|
|
2159
|
-
)
|
|
2192
|
+
),
|
|
2193
|
+
warnings: import_zod4.z.array(
|
|
2194
|
+
import_zod4.z.object({
|
|
2195
|
+
type: import_zod4.z.string(),
|
|
2196
|
+
message: import_zod4.z.string(),
|
|
2197
|
+
detail: import_zod4.z.record(import_zod4.z.string(), import_zod4.z.unknown()).nullable().optional()
|
|
2198
|
+
})
|
|
2199
|
+
).nullable().optional(),
|
|
2200
|
+
usage: import_zod4.z.array(import_zod4.z.object({ name: import_zod4.z.string(), count: import_zod4.z.number().optional() })).nullable().optional(),
|
|
2201
|
+
session_id: import_zod4.z.string().optional()
|
|
2160
2202
|
}),
|
|
2161
2203
|
// Error response
|
|
2162
2204
|
import_zod4.z.object({
|
|
2163
2205
|
error: import_zod4.z.enum([
|
|
2164
2206
|
"api_error",
|
|
2207
|
+
"configuration_error",
|
|
2208
|
+
"execution_error",
|
|
2209
|
+
"gateway_rate_limit",
|
|
2210
|
+
"invalid_input",
|
|
2165
2211
|
"rate_limit",
|
|
2166
2212
|
"timeout",
|
|
2167
|
-
"
|
|
2168
|
-
"
|
|
2169
|
-
"unknown"
|
|
2213
|
+
"unknown",
|
|
2214
|
+
"unknown_tool"
|
|
2170
2215
|
]),
|
|
2171
2216
|
statusCode: import_zod4.z.number().optional(),
|
|
2172
2217
|
message: import_zod4.z.string()
|
|
@@ -2267,7 +2312,7 @@ var perplexitySearch = (config = {}) => perplexitySearchToolFactory(config);
|
|
|
2267
2312
|
// src/tool/tako-search.ts
|
|
2268
2313
|
var import_provider_utils21 = require("@ai-sdk/provider-utils");
|
|
2269
2314
|
var import_zod6 = require("zod");
|
|
2270
|
-
var takoDataSourceInputSchema = import_zod6.z.object({
|
|
2315
|
+
var takoDataSourceInputSchema = () => import_zod6.z.object({
|
|
2271
2316
|
count: import_zod6.z.number().optional().describe(
|
|
2272
2317
|
"Maximum number of data results to return (1-20). When include_contents is true, each additional result adds its own data surcharge."
|
|
2273
2318
|
),
|
|
@@ -2286,7 +2331,7 @@ var takoDataSourceInputSchema = import_zod6.z.object({
|
|
|
2286
2331
|
"Only return cards matching node_ids. Requires a non-empty node_ids."
|
|
2287
2332
|
)
|
|
2288
2333
|
});
|
|
2289
|
-
var takoWebSourceInputSchema = import_zod6.z.object({
|
|
2334
|
+
var takoWebSourceInputSchema = () => import_zod6.z.object({
|
|
2290
2335
|
count: import_zod6.z.number().optional().describe("Maximum number of web results to return (1-20)."),
|
|
2291
2336
|
include_contents: import_zod6.z.boolean().optional().describe("Inline extracted web page text. This can add a data charge."),
|
|
2292
2337
|
category: import_zod6.z.enum(["finance", "news", "sports"]).optional().describe("Optional web-result category filter."),
|
|
@@ -2299,7 +2344,9 @@ var takoWebSourceInputSchema = import_zod6.z.object({
|
|
|
2299
2344
|
article_content_max_chars: import_zod6.z.number().optional().describe(
|
|
2300
2345
|
"Maximum extracted characters per web page when including contents."
|
|
2301
2346
|
),
|
|
2302
|
-
published_after: import_zod6.z.string().optional().describe(
|
|
2347
|
+
published_after: import_zod6.z.string().optional().describe(
|
|
2348
|
+
"Keep results published on or after this ISO date (YYYY-MM-DD)."
|
|
2349
|
+
),
|
|
2303
2350
|
published_before: import_zod6.z.string().optional().describe(
|
|
2304
2351
|
"Keep results published on or before this ISO date (YYYY-MM-DD)."
|
|
2305
2352
|
)
|
|
@@ -2314,8 +2361,8 @@ var takoSearchInputSchema = (0, import_provider_utils21.lazySchema)(
|
|
|
2314
2361
|
"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."
|
|
2315
2362
|
),
|
|
2316
2363
|
sources: import_zod6.z.object({
|
|
2317
|
-
data: takoDataSourceInputSchema.optional(),
|
|
2318
|
-
web: takoWebSourceInputSchema.optional()
|
|
2364
|
+
data: takoDataSourceInputSchema().optional(),
|
|
2365
|
+
web: takoWebSourceInputSchema().optional()
|
|
2319
2366
|
}).optional().describe(
|
|
2320
2367
|
"Sources to search. Omit to search both curated data and the web. When provided, only keys present are searched."
|
|
2321
2368
|
),
|
|
@@ -2336,12 +2383,12 @@ var takoSearchInputSchema = (0, import_provider_utils21.lazySchema)(
|
|
|
2336
2383
|
})
|
|
2337
2384
|
)
|
|
2338
2385
|
);
|
|
2339
|
-
var takoDatasetCellSchema = import_zod6.z.union([import_zod6.z.boolean(), import_zod6.z.number(), import_zod6.z.string()]).nullable();
|
|
2340
|
-
var takoResultContentSchema = import_zod6.z.object({
|
|
2386
|
+
var takoDatasetCellSchema = () => import_zod6.z.union([import_zod6.z.boolean(), import_zod6.z.number(), import_zod6.z.string()]).nullable();
|
|
2387
|
+
var takoResultContentSchema = () => import_zod6.z.object({
|
|
2341
2388
|
content_format: import_zod6.z.enum(["card_json", "csv", "json_compact", "json_records"]).nullish(),
|
|
2342
2389
|
cost: import_zod6.z.number().optional(),
|
|
2343
2390
|
data: import_zod6.z.string().nullish(),
|
|
2344
|
-
records: import_zod6.z.array(import_zod6.z.record(import_zod6.z.string(), takoDatasetCellSchema)).nullish(),
|
|
2391
|
+
records: import_zod6.z.array(import_zod6.z.record(import_zod6.z.string(), takoDatasetCellSchema())).nullish(),
|
|
2345
2392
|
dataset: import_zod6.z.object({
|
|
2346
2393
|
columns: import_zod6.z.array(
|
|
2347
2394
|
import_zod6.z.object({
|
|
@@ -2350,7 +2397,7 @@ var takoResultContentSchema = import_zod6.z.object({
|
|
|
2350
2397
|
unit: import_zod6.z.string().nullish()
|
|
2351
2398
|
})
|
|
2352
2399
|
),
|
|
2353
|
-
rows: import_zod6.z.array(import_zod6.z.array(takoDatasetCellSchema)),
|
|
2400
|
+
rows: import_zod6.z.array(import_zod6.z.array(takoDatasetCellSchema())),
|
|
2354
2401
|
total_rows: import_zod6.z.number(),
|
|
2355
2402
|
truncated: import_zod6.z.boolean(),
|
|
2356
2403
|
ref: import_zod6.z.string(),
|
|
@@ -2384,7 +2431,7 @@ var takoResultContentSchema = import_zod6.z.object({
|
|
|
2384
2431
|
})
|
|
2385
2432
|
).nullish()
|
|
2386
2433
|
}).passthrough();
|
|
2387
|
-
var takoCardSchema = import_zod6.z.object({
|
|
2434
|
+
var takoCardSchema = () => import_zod6.z.object({
|
|
2388
2435
|
card_id: import_zod6.z.string().nullish(),
|
|
2389
2436
|
title: import_zod6.z.string().nullish(),
|
|
2390
2437
|
description: import_zod6.z.string().nullish(),
|
|
@@ -2410,7 +2457,7 @@ var takoCardSchema = import_zod6.z.object({
|
|
|
2410
2457
|
source_indexes: import_zod6.z.array(import_zod6.z.enum(["data", "web"])).nullish(),
|
|
2411
2458
|
card_type: import_zod6.z.string().nullish(),
|
|
2412
2459
|
relevance: import_zod6.z.enum(["High", "Low", "Medium"]).nullish(),
|
|
2413
|
-
content: takoResultContentSchema.nullish(),
|
|
2460
|
+
content: takoResultContentSchema().nullish(),
|
|
2414
2461
|
exportable: import_zod6.z.boolean().optional(),
|
|
2415
2462
|
nodes: import_zod6.z.array(
|
|
2416
2463
|
import_zod6.z.object({
|
|
@@ -2427,21 +2474,21 @@ var takoCardSchema = import_zod6.z.object({
|
|
|
2427
2474
|
last_updated: import_zod6.z.string().nullish()
|
|
2428
2475
|
}).nullish()
|
|
2429
2476
|
}).passthrough();
|
|
2430
|
-
var takoWebResultSchema = import_zod6.z.object({
|
|
2477
|
+
var takoWebResultSchema = () => import_zod6.z.object({
|
|
2431
2478
|
title: import_zod6.z.string(),
|
|
2432
2479
|
url: import_zod6.z.string(),
|
|
2433
2480
|
snippet: import_zod6.z.string().nullish(),
|
|
2434
2481
|
source_name: import_zod6.z.string().nullish(),
|
|
2435
2482
|
publish_date: import_zod6.z.string().nullish(),
|
|
2436
|
-
content: takoResultContentSchema.nullish()
|
|
2483
|
+
content: takoResultContentSchema().nullish()
|
|
2437
2484
|
}).passthrough();
|
|
2438
2485
|
var takoSearchOutputSchema = (0, import_provider_utils21.lazySchema)(
|
|
2439
2486
|
() => (0, import_provider_utils21.zodSchema)(
|
|
2440
2487
|
import_zod6.z.union([
|
|
2441
2488
|
import_zod6.z.object({
|
|
2442
2489
|
request_id: import_zod6.z.string(),
|
|
2443
|
-
cards: import_zod6.z.array(takoCardSchema).optional(),
|
|
2444
|
-
web_results: import_zod6.z.array(takoWebResultSchema).optional(),
|
|
2490
|
+
cards: import_zod6.z.array(takoCardSchema()).optional(),
|
|
2491
|
+
web_results: import_zod6.z.array(takoWebResultSchema()).optional(),
|
|
2445
2492
|
usage: import_zod6.z.object({
|
|
2446
2493
|
total_cost_usd: import_zod6.z.number(),
|
|
2447
2494
|
compute: import_zod6.z.object({ cost_usd: import_zod6.z.number() }).nullish(),
|
|
@@ -2533,7 +2580,7 @@ async function getVercelRequestId() {
|
|
|
2533
2580
|
}
|
|
2534
2581
|
|
|
2535
2582
|
// src/version.ts
|
|
2536
|
-
var VERSION = true ? "3.0.
|
|
2583
|
+
var VERSION = true ? "3.0.220" : "0.0.0-test";
|
|
2537
2584
|
|
|
2538
2585
|
// src/gateway-provider.ts
|
|
2539
2586
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|