@ai-sdk/gateway 3.0.200 → 3.0.202
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 +13 -0
- package/dist/index.d.mts +124 -4
- package/dist/index.d.ts +124 -4
- package/dist/index.js +401 -277
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +407 -275
- package/dist/index.mjs.map +1 -1
- package/docs/00-ai-gateway.mdx +129 -2
- package/package.json +1 -1
- package/src/gateway-image-model-settings.ts +1 -0
- package/src/gateway-language-model-settings.ts +2 -1
- package/src/gateway-provider-options.ts +8 -1
- package/src/gateway-speech-model-settings.ts +2 -0
- package/src/gateway-tools.ts +18 -0
- package/src/tool/browserbase-fetch.ts +158 -0
- package/src/tool/browserbase-search.ts +138 -0
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(index_exports);
|
|
37
37
|
|
|
38
38
|
// src/gateway-provider.ts
|
|
39
|
-
var
|
|
39
|
+
var import_provider_utils22 = require("@ai-sdk/provider-utils");
|
|
40
40
|
|
|
41
41
|
// src/errors/as-gateway-error.ts
|
|
42
42
|
var import_provider = require("@ai-sdk/provider");
|
|
@@ -1860,18 +1860,128 @@ var gatewayTranscriptionResponseSchema = import_v414.z.object({
|
|
|
1860
1860
|
providerMetadata: import_v414.z.record(import_v414.z.string(), providerMetadataEntrySchema4).optional()
|
|
1861
1861
|
});
|
|
1862
1862
|
|
|
1863
|
-
// src/tool/
|
|
1863
|
+
// src/tool/browserbase-fetch.ts
|
|
1864
1864
|
var import_provider_utils16 = require("@ai-sdk/provider-utils");
|
|
1865
1865
|
var import_zod = require("zod");
|
|
1866
|
-
var
|
|
1866
|
+
var jsonObjectSchema = import_zod.z.record(import_zod.z.string(), import_zod.z.unknown());
|
|
1867
|
+
var browserbaseFetchInputSchema = (0, import_provider_utils16.lazySchema)(
|
|
1867
1868
|
() => (0, import_provider_utils16.zodSchema)(
|
|
1868
1869
|
import_zod.z.object({
|
|
1869
|
-
|
|
1870
|
-
|
|
1870
|
+
url: import_zod.z.string().url().describe("URL of the page to fetch."),
|
|
1871
|
+
allow_redirects: import_zod.z.boolean().optional().describe("Whether to follow HTTP redirects (default: false)."),
|
|
1872
|
+
allow_insecure_ssl: import_zod.z.boolean().optional().describe(
|
|
1873
|
+
"Whether to bypass TLS certificate verification (default: false). Only use for trusted hosts."
|
|
1874
|
+
),
|
|
1875
|
+
proxies: import_zod.z.boolean().optional().describe(
|
|
1876
|
+
"Whether to route the request through Browserbase proxies (default: false)."
|
|
1877
|
+
),
|
|
1878
|
+
format: import_zod.z.enum(["raw", "json", "markdown"]).optional().describe(
|
|
1879
|
+
"Output format. raw returns the response body unchanged, markdown returns page content as Markdown, and json returns structured content using schema."
|
|
1880
|
+
),
|
|
1881
|
+
schema: jsonObjectSchema.optional().describe(
|
|
1882
|
+
"JSON Schema for structured extraction. Only use with format set to json."
|
|
1883
|
+
)
|
|
1884
|
+
})
|
|
1885
|
+
)
|
|
1886
|
+
);
|
|
1887
|
+
var browserbaseFetchOutputSchema = (0, import_provider_utils16.lazySchema)(
|
|
1888
|
+
() => (0, import_provider_utils16.zodSchema)(
|
|
1889
|
+
import_zod.z.union([
|
|
1890
|
+
import_zod.z.object({
|
|
1891
|
+
id: import_zod.z.string(),
|
|
1892
|
+
content: import_zod.z.union([import_zod.z.string(), jsonObjectSchema]),
|
|
1893
|
+
contentType: import_zod.z.string(),
|
|
1894
|
+
encoding: import_zod.z.string(),
|
|
1895
|
+
headers: import_zod.z.record(import_zod.z.string(), import_zod.z.string()),
|
|
1896
|
+
statusCode: import_zod.z.number()
|
|
1897
|
+
}),
|
|
1898
|
+
import_zod.z.object({
|
|
1899
|
+
error: import_zod.z.enum([
|
|
1900
|
+
"api_error",
|
|
1901
|
+
"configuration_error",
|
|
1902
|
+
"execution_error",
|
|
1903
|
+
"invalid_input",
|
|
1904
|
+
"rate_limit",
|
|
1905
|
+
"timeout",
|
|
1906
|
+
"unknown"
|
|
1907
|
+
]),
|
|
1908
|
+
statusCode: import_zod.z.number().optional(),
|
|
1909
|
+
message: import_zod.z.string()
|
|
1910
|
+
})
|
|
1911
|
+
])
|
|
1912
|
+
)
|
|
1913
|
+
);
|
|
1914
|
+
var browserbaseFetchToolFactory = (0, import_provider_utils16.createProviderToolFactoryWithOutputSchema)({
|
|
1915
|
+
id: "gateway.browserbase_fetch",
|
|
1916
|
+
inputSchema: browserbaseFetchInputSchema,
|
|
1917
|
+
outputSchema: browserbaseFetchOutputSchema
|
|
1918
|
+
});
|
|
1919
|
+
var browserbaseFetch = (config = {}) => browserbaseFetchToolFactory(config);
|
|
1920
|
+
|
|
1921
|
+
// src/tool/browserbase-search.ts
|
|
1922
|
+
var import_provider_utils17 = require("@ai-sdk/provider-utils");
|
|
1923
|
+
var import_zod2 = require("zod");
|
|
1924
|
+
var browserbaseSearchInputSchema = (0, import_provider_utils17.lazySchema)(
|
|
1925
|
+
() => (0, import_provider_utils17.zodSchema)(
|
|
1926
|
+
import_zod2.z.object({
|
|
1927
|
+
query: import_zod2.z.string().min(1).max(200).describe("Web search query. Must be between 1 and 200 characters."),
|
|
1928
|
+
num_results: import_zod2.z.number().int().min(1).max(25).optional().describe("Maximum number of results to return (1-25, default: 10).")
|
|
1929
|
+
})
|
|
1930
|
+
)
|
|
1931
|
+
);
|
|
1932
|
+
var browserbaseSearchOutputSchema = (0, import_provider_utils17.lazySchema)(
|
|
1933
|
+
() => (0, import_provider_utils17.zodSchema)(
|
|
1934
|
+
import_zod2.z.union([
|
|
1935
|
+
import_zod2.z.object({
|
|
1936
|
+
query: import_zod2.z.string(),
|
|
1937
|
+
requestId: import_zod2.z.string(),
|
|
1938
|
+
results: import_zod2.z.array(
|
|
1939
|
+
import_zod2.z.object({
|
|
1940
|
+
id: import_zod2.z.string(),
|
|
1941
|
+
title: import_zod2.z.string(),
|
|
1942
|
+
url: import_zod2.z.string(),
|
|
1943
|
+
author: import_zod2.z.string().optional(),
|
|
1944
|
+
favicon: import_zod2.z.string().optional(),
|
|
1945
|
+
image: import_zod2.z.string().optional(),
|
|
1946
|
+
publishedDate: import_zod2.z.string().optional()
|
|
1947
|
+
})
|
|
1948
|
+
)
|
|
1949
|
+
}),
|
|
1950
|
+
import_zod2.z.object({
|
|
1951
|
+
error: import_zod2.z.enum([
|
|
1952
|
+
"api_error",
|
|
1953
|
+
"configuration_error",
|
|
1954
|
+
"execution_error",
|
|
1955
|
+
"invalid_input",
|
|
1956
|
+
"rate_limit",
|
|
1957
|
+
"timeout",
|
|
1958
|
+
"unknown"
|
|
1959
|
+
]),
|
|
1960
|
+
statusCode: import_zod2.z.number().optional(),
|
|
1961
|
+
message: import_zod2.z.string()
|
|
1962
|
+
})
|
|
1963
|
+
])
|
|
1964
|
+
)
|
|
1965
|
+
);
|
|
1966
|
+
var browserbaseSearchToolFactory = (0, import_provider_utils17.createProviderToolFactoryWithOutputSchema)({
|
|
1967
|
+
id: "gateway.browserbase_search",
|
|
1968
|
+
inputSchema: browserbaseSearchInputSchema,
|
|
1969
|
+
outputSchema: browserbaseSearchOutputSchema
|
|
1970
|
+
});
|
|
1971
|
+
var browserbaseSearch = (config = {}) => browserbaseSearchToolFactory(config);
|
|
1972
|
+
|
|
1973
|
+
// src/tool/exa-search.ts
|
|
1974
|
+
var import_provider_utils18 = require("@ai-sdk/provider-utils");
|
|
1975
|
+
var import_zod3 = require("zod");
|
|
1976
|
+
var exaSearchInputSchema = (0, import_provider_utils18.lazySchema)(
|
|
1977
|
+
() => (0, import_provider_utils18.zodSchema)(
|
|
1978
|
+
import_zod3.z.object({
|
|
1979
|
+
query: import_zod3.z.string().describe("Natural-language web search query. This is required."),
|
|
1980
|
+
type: import_zod3.z.enum(["auto", "fast", "instant"]).optional().describe(
|
|
1871
1981
|
"Search method. Use auto for the default balance of speed and quality."
|
|
1872
1982
|
),
|
|
1873
|
-
num_results:
|
|
1874
|
-
category:
|
|
1983
|
+
num_results: import_zod3.z.number().optional().describe("Maximum number of results to return (1-100, default: 10)."),
|
|
1984
|
+
category: import_zod3.z.enum([
|
|
1875
1985
|
"company",
|
|
1876
1986
|
"people",
|
|
1877
1987
|
"research paper",
|
|
@@ -1879,20 +1989,20 @@ var exaSearchInputSchema = (0, import_provider_utils16.lazySchema)(
|
|
|
1879
1989
|
"personal site",
|
|
1880
1990
|
"financial report"
|
|
1881
1991
|
]).optional().describe("Optional content category to focus results."),
|
|
1882
|
-
user_location:
|
|
1883
|
-
include_domains:
|
|
1884
|
-
exclude_domains:
|
|
1885
|
-
start_published_date:
|
|
1886
|
-
end_published_date:
|
|
1887
|
-
contents:
|
|
1888
|
-
text:
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
max_characters:
|
|
1892
|
-
include_html_tags:
|
|
1893
|
-
verbosity:
|
|
1894
|
-
include_sections:
|
|
1895
|
-
|
|
1992
|
+
user_location: import_zod3.z.string().optional().describe("Two-letter ISO country code such as 'US'."),
|
|
1993
|
+
include_domains: import_zod3.z.array(import_zod3.z.string()).optional().describe("Only return results from these domains."),
|
|
1994
|
+
exclude_domains: import_zod3.z.array(import_zod3.z.string()).optional().describe("Exclude results from these domains."),
|
|
1995
|
+
start_published_date: import_zod3.z.string().optional().describe("Only return links published after this ISO 8601 date."),
|
|
1996
|
+
end_published_date: import_zod3.z.string().optional().describe("Only return links published before this ISO 8601 date."),
|
|
1997
|
+
contents: import_zod3.z.object({
|
|
1998
|
+
text: import_zod3.z.union([
|
|
1999
|
+
import_zod3.z.boolean(),
|
|
2000
|
+
import_zod3.z.object({
|
|
2001
|
+
max_characters: import_zod3.z.number().optional(),
|
|
2002
|
+
include_html_tags: import_zod3.z.boolean().optional(),
|
|
2003
|
+
verbosity: import_zod3.z.enum(["compact", "standard", "full"]).optional(),
|
|
2004
|
+
include_sections: import_zod3.z.array(
|
|
2005
|
+
import_zod3.z.enum([
|
|
1896
2006
|
"header",
|
|
1897
2007
|
"navigation",
|
|
1898
2008
|
"banner",
|
|
@@ -1902,8 +2012,8 @@ var exaSearchInputSchema = (0, import_provider_utils16.lazySchema)(
|
|
|
1902
2012
|
"metadata"
|
|
1903
2013
|
])
|
|
1904
2014
|
).optional(),
|
|
1905
|
-
exclude_sections:
|
|
1906
|
-
|
|
2015
|
+
exclude_sections: import_zod3.z.array(
|
|
2016
|
+
import_zod3.z.enum([
|
|
1907
2017
|
"header",
|
|
1908
2018
|
"navigation",
|
|
1909
2019
|
"banner",
|
|
@@ -1915,59 +2025,59 @@ var exaSearchInputSchema = (0, import_provider_utils16.lazySchema)(
|
|
|
1915
2025
|
).optional()
|
|
1916
2026
|
})
|
|
1917
2027
|
]).optional(),
|
|
1918
|
-
highlights:
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
query:
|
|
1922
|
-
max_characters:
|
|
2028
|
+
highlights: import_zod3.z.union([
|
|
2029
|
+
import_zod3.z.boolean(),
|
|
2030
|
+
import_zod3.z.object({
|
|
2031
|
+
query: import_zod3.z.string().optional(),
|
|
2032
|
+
max_characters: import_zod3.z.number().optional()
|
|
1923
2033
|
})
|
|
1924
2034
|
]).optional(),
|
|
1925
|
-
max_age_hours:
|
|
1926
|
-
livecrawl_timeout:
|
|
1927
|
-
subpages:
|
|
1928
|
-
subpage_target:
|
|
1929
|
-
extras:
|
|
1930
|
-
links:
|
|
1931
|
-
image_links:
|
|
2035
|
+
max_age_hours: import_zod3.z.number().optional(),
|
|
2036
|
+
livecrawl_timeout: import_zod3.z.number().optional(),
|
|
2037
|
+
subpages: import_zod3.z.number().optional(),
|
|
2038
|
+
subpage_target: import_zod3.z.union([import_zod3.z.string(), import_zod3.z.array(import_zod3.z.string())]).optional(),
|
|
2039
|
+
extras: import_zod3.z.object({
|
|
2040
|
+
links: import_zod3.z.number().optional(),
|
|
2041
|
+
image_links: import_zod3.z.number().optional()
|
|
1932
2042
|
}).optional()
|
|
1933
2043
|
}).optional().describe("Controls extracted page content and freshness.")
|
|
1934
2044
|
})
|
|
1935
2045
|
)
|
|
1936
2046
|
);
|
|
1937
|
-
var exaSearchOutputSchema = (0,
|
|
1938
|
-
() => (0,
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
requestId:
|
|
1942
|
-
searchType:
|
|
1943
|
-
resolvedSearchType:
|
|
1944
|
-
results:
|
|
1945
|
-
|
|
1946
|
-
title:
|
|
1947
|
-
url:
|
|
1948
|
-
id:
|
|
1949
|
-
publishedDate:
|
|
1950
|
-
author:
|
|
1951
|
-
image:
|
|
1952
|
-
favicon:
|
|
1953
|
-
text:
|
|
1954
|
-
highlights:
|
|
1955
|
-
highlightScores:
|
|
1956
|
-
summary:
|
|
1957
|
-
subpages:
|
|
1958
|
-
extras:
|
|
1959
|
-
links:
|
|
1960
|
-
imageLinks:
|
|
2047
|
+
var exaSearchOutputSchema = (0, import_provider_utils18.lazySchema)(
|
|
2048
|
+
() => (0, import_provider_utils18.zodSchema)(
|
|
2049
|
+
import_zod3.z.union([
|
|
2050
|
+
import_zod3.z.object({
|
|
2051
|
+
requestId: import_zod3.z.string(),
|
|
2052
|
+
searchType: import_zod3.z.string().optional(),
|
|
2053
|
+
resolvedSearchType: import_zod3.z.string().optional(),
|
|
2054
|
+
results: import_zod3.z.array(
|
|
2055
|
+
import_zod3.z.object({
|
|
2056
|
+
title: import_zod3.z.string(),
|
|
2057
|
+
url: import_zod3.z.string(),
|
|
2058
|
+
id: import_zod3.z.string(),
|
|
2059
|
+
publishedDate: import_zod3.z.string().nullable().optional(),
|
|
2060
|
+
author: import_zod3.z.string().nullable().optional(),
|
|
2061
|
+
image: import_zod3.z.string().nullable().optional(),
|
|
2062
|
+
favicon: import_zod3.z.string().nullable().optional(),
|
|
2063
|
+
text: import_zod3.z.string().optional(),
|
|
2064
|
+
highlights: import_zod3.z.array(import_zod3.z.string()).optional(),
|
|
2065
|
+
highlightScores: import_zod3.z.array(import_zod3.z.number()).optional(),
|
|
2066
|
+
summary: import_zod3.z.string().optional(),
|
|
2067
|
+
subpages: import_zod3.z.array(import_zod3.z.any()).optional(),
|
|
2068
|
+
extras: import_zod3.z.object({
|
|
2069
|
+
links: import_zod3.z.array(import_zod3.z.string()).optional(),
|
|
2070
|
+
imageLinks: import_zod3.z.array(import_zod3.z.string()).optional()
|
|
1961
2071
|
}).optional()
|
|
1962
2072
|
})
|
|
1963
2073
|
),
|
|
1964
|
-
costDollars:
|
|
1965
|
-
total:
|
|
1966
|
-
search:
|
|
2074
|
+
costDollars: import_zod3.z.object({
|
|
2075
|
+
total: import_zod3.z.number().optional(),
|
|
2076
|
+
search: import_zod3.z.record(import_zod3.z.number()).optional()
|
|
1967
2077
|
}).optional()
|
|
1968
2078
|
}),
|
|
1969
|
-
|
|
1970
|
-
error:
|
|
2079
|
+
import_zod3.z.object({
|
|
2080
|
+
error: import_zod3.z.enum([
|
|
1971
2081
|
"api_error",
|
|
1972
2082
|
"rate_limit",
|
|
1973
2083
|
"timeout",
|
|
@@ -1976,13 +2086,13 @@ var exaSearchOutputSchema = (0, import_provider_utils16.lazySchema)(
|
|
|
1976
2086
|
"execution_error",
|
|
1977
2087
|
"unknown"
|
|
1978
2088
|
]),
|
|
1979
|
-
statusCode:
|
|
1980
|
-
message:
|
|
2089
|
+
statusCode: import_zod3.z.number().optional(),
|
|
2090
|
+
message: import_zod3.z.string()
|
|
1981
2091
|
})
|
|
1982
2092
|
])
|
|
1983
2093
|
)
|
|
1984
2094
|
);
|
|
1985
|
-
var exaSearchToolFactory = (0,
|
|
2095
|
+
var exaSearchToolFactory = (0, import_provider_utils18.createProviderToolFactoryWithOutputSchema)({
|
|
1986
2096
|
id: "gateway.exa_search",
|
|
1987
2097
|
inputSchema: exaSearchInputSchema,
|
|
1988
2098
|
outputSchema: exaSearchOutputSchema
|
|
@@ -1990,67 +2100,67 @@ var exaSearchToolFactory = (0, import_provider_utils16.createProviderToolFactory
|
|
|
1990
2100
|
var exaSearch = (config = {}) => exaSearchToolFactory(config);
|
|
1991
2101
|
|
|
1992
2102
|
// src/tool/parallel-search.ts
|
|
1993
|
-
var
|
|
1994
|
-
var
|
|
1995
|
-
var parallelSearchInputSchema = (0,
|
|
1996
|
-
() => (0,
|
|
1997
|
-
|
|
1998
|
-
objective:
|
|
2103
|
+
var import_provider_utils19 = require("@ai-sdk/provider-utils");
|
|
2104
|
+
var import_zod4 = require("zod");
|
|
2105
|
+
var parallelSearchInputSchema = (0, import_provider_utils19.lazySchema)(
|
|
2106
|
+
() => (0, import_provider_utils19.zodSchema)(
|
|
2107
|
+
import_zod4.z.object({
|
|
2108
|
+
objective: import_zod4.z.string().describe(
|
|
1999
2109
|
"Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."
|
|
2000
2110
|
),
|
|
2001
|
-
search_queries:
|
|
2111
|
+
search_queries: import_zod4.z.array(import_zod4.z.string()).optional().describe(
|
|
2002
2112
|
"Optional search queries to supplement the objective. Maximum 200 characters per query."
|
|
2003
2113
|
),
|
|
2004
|
-
mode:
|
|
2114
|
+
mode: import_zod4.z.enum(["one-shot", "agentic"]).optional().describe(
|
|
2005
2115
|
'Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'
|
|
2006
2116
|
),
|
|
2007
|
-
max_results:
|
|
2117
|
+
max_results: import_zod4.z.number().optional().describe(
|
|
2008
2118
|
"Maximum number of results to return (1-20). Defaults to 10 if not specified."
|
|
2009
2119
|
),
|
|
2010
|
-
source_policy:
|
|
2011
|
-
include_domains:
|
|
2120
|
+
source_policy: import_zod4.z.object({
|
|
2121
|
+
include_domains: import_zod4.z.array(import_zod4.z.string()).optional().describe(
|
|
2012
2122
|
"Limit results to these domains. Use plain domain names only \u2014 e.g. example.com or sub.example.gov, or a bare extension like .edu. Do not include a scheme, path, or port (e.g. not https://example.com/page)."
|
|
2013
2123
|
),
|
|
2014
|
-
exclude_domains:
|
|
2124
|
+
exclude_domains: import_zod4.z.array(import_zod4.z.string()).optional().describe(
|
|
2015
2125
|
"Exclude results from these domains. Use plain domain names only \u2014 e.g. example.com or sub.example.gov, or a bare extension like .edu. Do not include a scheme, path, or port (e.g. not https://example.com/page)."
|
|
2016
2126
|
),
|
|
2017
|
-
after_date:
|
|
2127
|
+
after_date: import_zod4.z.string().optional().describe(
|
|
2018
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."
|
|
2019
2129
|
)
|
|
2020
2130
|
}).optional().describe(
|
|
2021
2131
|
"Source policy for controlling which domains to include/exclude and freshness."
|
|
2022
2132
|
),
|
|
2023
|
-
excerpts:
|
|
2024
|
-
max_chars_per_result:
|
|
2025
|
-
max_chars_total:
|
|
2133
|
+
excerpts: import_zod4.z.object({
|
|
2134
|
+
max_chars_per_result: import_zod4.z.number().optional().describe("Maximum characters per result."),
|
|
2135
|
+
max_chars_total: import_zod4.z.number().optional().describe("Maximum total characters across all results.")
|
|
2026
2136
|
}).optional().describe("Excerpt configuration for controlling result length."),
|
|
2027
|
-
fetch_policy:
|
|
2028
|
-
max_age_seconds:
|
|
2137
|
+
fetch_policy: import_zod4.z.object({
|
|
2138
|
+
max_age_seconds: import_zod4.z.number().optional().describe(
|
|
2029
2139
|
"Maximum age in seconds for cached content. Set to 0 to always fetch fresh content."
|
|
2030
2140
|
)
|
|
2031
2141
|
}).optional().describe("Fetch policy for controlling content freshness.")
|
|
2032
2142
|
})
|
|
2033
2143
|
)
|
|
2034
2144
|
);
|
|
2035
|
-
var parallelSearchOutputSchema = (0,
|
|
2036
|
-
() => (0,
|
|
2037
|
-
|
|
2145
|
+
var parallelSearchOutputSchema = (0, import_provider_utils19.lazySchema)(
|
|
2146
|
+
() => (0, import_provider_utils19.zodSchema)(
|
|
2147
|
+
import_zod4.z.union([
|
|
2038
2148
|
// Success response
|
|
2039
|
-
|
|
2040
|
-
searchId:
|
|
2041
|
-
results:
|
|
2042
|
-
|
|
2043
|
-
url:
|
|
2044
|
-
title:
|
|
2045
|
-
excerpt:
|
|
2046
|
-
publishDate:
|
|
2047
|
-
relevanceScore:
|
|
2149
|
+
import_zod4.z.object({
|
|
2150
|
+
searchId: import_zod4.z.string(),
|
|
2151
|
+
results: import_zod4.z.array(
|
|
2152
|
+
import_zod4.z.object({
|
|
2153
|
+
url: import_zod4.z.string(),
|
|
2154
|
+
title: import_zod4.z.string(),
|
|
2155
|
+
excerpt: import_zod4.z.string(),
|
|
2156
|
+
publishDate: import_zod4.z.string().nullable().optional(),
|
|
2157
|
+
relevanceScore: import_zod4.z.number().optional()
|
|
2048
2158
|
})
|
|
2049
2159
|
)
|
|
2050
2160
|
}),
|
|
2051
2161
|
// Error response
|
|
2052
|
-
|
|
2053
|
-
error:
|
|
2162
|
+
import_zod4.z.object({
|
|
2163
|
+
error: import_zod4.z.enum([
|
|
2054
2164
|
"api_error",
|
|
2055
2165
|
"rate_limit",
|
|
2056
2166
|
"timeout",
|
|
@@ -2058,13 +2168,13 @@ var parallelSearchOutputSchema = (0, import_provider_utils17.lazySchema)(
|
|
|
2058
2168
|
"configuration_error",
|
|
2059
2169
|
"unknown"
|
|
2060
2170
|
]),
|
|
2061
|
-
statusCode:
|
|
2062
|
-
message:
|
|
2171
|
+
statusCode: import_zod4.z.number().optional(),
|
|
2172
|
+
message: import_zod4.z.string()
|
|
2063
2173
|
})
|
|
2064
2174
|
])
|
|
2065
2175
|
)
|
|
2066
2176
|
);
|
|
2067
|
-
var parallelSearchToolFactory = (0,
|
|
2177
|
+
var parallelSearchToolFactory = (0, import_provider_utils19.createProviderToolFactoryWithOutputSchema)({
|
|
2068
2178
|
id: "gateway.parallel_search",
|
|
2069
2179
|
inputSchema: parallelSearchInputSchema,
|
|
2070
2180
|
outputSchema: parallelSearchOutputSchema
|
|
@@ -2072,82 +2182,82 @@ var parallelSearchToolFactory = (0, import_provider_utils17.createProviderToolFa
|
|
|
2072
2182
|
var parallelSearch = (config = {}) => parallelSearchToolFactory(config);
|
|
2073
2183
|
|
|
2074
2184
|
// src/tool/perplexity-search.ts
|
|
2075
|
-
var
|
|
2076
|
-
var
|
|
2077
|
-
var perplexitySearchInputSchema = (0,
|
|
2078
|
-
() => (0,
|
|
2079
|
-
|
|
2080
|
-
query:
|
|
2185
|
+
var import_provider_utils20 = require("@ai-sdk/provider-utils");
|
|
2186
|
+
var import_zod5 = require("zod");
|
|
2187
|
+
var perplexitySearchInputSchema = (0, import_provider_utils20.lazySchema)(
|
|
2188
|
+
() => (0, import_provider_utils20.zodSchema)(
|
|
2189
|
+
import_zod5.z.object({
|
|
2190
|
+
query: import_zod5.z.union([import_zod5.z.string(), import_zod5.z.array(import_zod5.z.string())]).describe(
|
|
2081
2191
|
"Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."
|
|
2082
2192
|
),
|
|
2083
|
-
max_results:
|
|
2193
|
+
max_results: import_zod5.z.number().optional().describe(
|
|
2084
2194
|
"Maximum number of search results to return (1-20, default: 10)"
|
|
2085
2195
|
),
|
|
2086
|
-
max_tokens_per_page:
|
|
2196
|
+
max_tokens_per_page: import_zod5.z.number().optional().describe(
|
|
2087
2197
|
"Maximum number of tokens to extract per search result page (256-2048, default: 2048)"
|
|
2088
2198
|
),
|
|
2089
|
-
max_tokens:
|
|
2199
|
+
max_tokens: import_zod5.z.number().optional().describe(
|
|
2090
2200
|
"Maximum total tokens across all search results (default: 25000, max: 1000000)"
|
|
2091
2201
|
),
|
|
2092
|
-
country:
|
|
2202
|
+
country: import_zod5.z.string().optional().describe(
|
|
2093
2203
|
"Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"
|
|
2094
2204
|
),
|
|
2095
|
-
search_domain_filter:
|
|
2205
|
+
search_domain_filter: import_zod5.z.array(import_zod5.z.string()).optional().describe(
|
|
2096
2206
|
"List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"
|
|
2097
2207
|
),
|
|
2098
|
-
search_language_filter:
|
|
2208
|
+
search_language_filter: import_zod5.z.array(import_zod5.z.string()).optional().describe(
|
|
2099
2209
|
"List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"
|
|
2100
2210
|
),
|
|
2101
|
-
search_after_date:
|
|
2211
|
+
search_after_date: import_zod5.z.string().optional().describe(
|
|
2102
2212
|
"Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."
|
|
2103
2213
|
),
|
|
2104
|
-
search_before_date:
|
|
2214
|
+
search_before_date: import_zod5.z.string().optional().describe(
|
|
2105
2215
|
"Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."
|
|
2106
2216
|
),
|
|
2107
|
-
last_updated_after_filter:
|
|
2217
|
+
last_updated_after_filter: import_zod5.z.string().optional().describe(
|
|
2108
2218
|
"Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."
|
|
2109
2219
|
),
|
|
2110
|
-
last_updated_before_filter:
|
|
2220
|
+
last_updated_before_filter: import_zod5.z.string().optional().describe(
|
|
2111
2221
|
"Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."
|
|
2112
2222
|
),
|
|
2113
|
-
search_recency_filter:
|
|
2223
|
+
search_recency_filter: import_zod5.z.enum(["day", "week", "month", "year"]).optional().describe(
|
|
2114
2224
|
"Filter results by relative time period. Cannot be used with search_after_date or search_before_date."
|
|
2115
2225
|
)
|
|
2116
2226
|
})
|
|
2117
2227
|
)
|
|
2118
2228
|
);
|
|
2119
|
-
var perplexitySearchOutputSchema = (0,
|
|
2120
|
-
() => (0,
|
|
2121
|
-
|
|
2229
|
+
var perplexitySearchOutputSchema = (0, import_provider_utils20.lazySchema)(
|
|
2230
|
+
() => (0, import_provider_utils20.zodSchema)(
|
|
2231
|
+
import_zod5.z.union([
|
|
2122
2232
|
// Success response
|
|
2123
|
-
|
|
2124
|
-
results:
|
|
2125
|
-
|
|
2126
|
-
title:
|
|
2127
|
-
url:
|
|
2128
|
-
snippet:
|
|
2129
|
-
date:
|
|
2130
|
-
lastUpdated:
|
|
2233
|
+
import_zod5.z.object({
|
|
2234
|
+
results: import_zod5.z.array(
|
|
2235
|
+
import_zod5.z.object({
|
|
2236
|
+
title: import_zod5.z.string(),
|
|
2237
|
+
url: import_zod5.z.string(),
|
|
2238
|
+
snippet: import_zod5.z.string(),
|
|
2239
|
+
date: import_zod5.z.string().optional(),
|
|
2240
|
+
lastUpdated: import_zod5.z.string().optional()
|
|
2131
2241
|
})
|
|
2132
2242
|
),
|
|
2133
|
-
id:
|
|
2243
|
+
id: import_zod5.z.string()
|
|
2134
2244
|
}),
|
|
2135
2245
|
// Error response
|
|
2136
|
-
|
|
2137
|
-
error:
|
|
2246
|
+
import_zod5.z.object({
|
|
2247
|
+
error: import_zod5.z.enum([
|
|
2138
2248
|
"api_error",
|
|
2139
2249
|
"rate_limit",
|
|
2140
2250
|
"timeout",
|
|
2141
2251
|
"invalid_input",
|
|
2142
2252
|
"unknown"
|
|
2143
2253
|
]),
|
|
2144
|
-
statusCode:
|
|
2145
|
-
message:
|
|
2254
|
+
statusCode: import_zod5.z.number().optional(),
|
|
2255
|
+
message: import_zod5.z.string()
|
|
2146
2256
|
})
|
|
2147
2257
|
])
|
|
2148
2258
|
)
|
|
2149
2259
|
);
|
|
2150
|
-
var perplexitySearchToolFactory = (0,
|
|
2260
|
+
var perplexitySearchToolFactory = (0, import_provider_utils20.createProviderToolFactoryWithOutputSchema)({
|
|
2151
2261
|
id: "gateway.perplexity_search",
|
|
2152
2262
|
inputSchema: perplexitySearchInputSchema,
|
|
2153
2263
|
outputSchema: perplexitySearchOutputSchema
|
|
@@ -2155,192 +2265,192 @@ var perplexitySearchToolFactory = (0, import_provider_utils18.createProviderTool
|
|
|
2155
2265
|
var perplexitySearch = (config = {}) => perplexitySearchToolFactory(config);
|
|
2156
2266
|
|
|
2157
2267
|
// src/tool/tako-search.ts
|
|
2158
|
-
var
|
|
2159
|
-
var
|
|
2160
|
-
var takoDataSourceInputSchema =
|
|
2161
|
-
count:
|
|
2268
|
+
var import_provider_utils21 = require("@ai-sdk/provider-utils");
|
|
2269
|
+
var import_zod6 = require("zod");
|
|
2270
|
+
var takoDataSourceInputSchema = import_zod6.z.object({
|
|
2271
|
+
count: import_zod6.z.number().optional().describe(
|
|
2162
2272
|
"Maximum number of data results to return (1-20). When include_contents is true, each additional result adds its own data surcharge."
|
|
2163
2273
|
),
|
|
2164
|
-
include_contents:
|
|
2274
|
+
include_contents: import_zod6.z.boolean().optional().describe(
|
|
2165
2275
|
"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."
|
|
2166
2276
|
),
|
|
2167
|
-
mode:
|
|
2277
|
+
mode: import_zod6.z.enum(["inline", "url"]).optional().describe(
|
|
2168
2278
|
"Requested data delivery mode. Search card data is always inline."
|
|
2169
2279
|
),
|
|
2170
|
-
content_format:
|
|
2171
|
-
max_rows:
|
|
2280
|
+
content_format: import_zod6.z.enum(["card_json", "csv", "json_compact", "json_records"]).optional().describe("Serialization for inlined card data."),
|
|
2281
|
+
max_rows: import_zod6.z.number().optional().describe(
|
|
2172
2282
|
"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."
|
|
2173
2283
|
),
|
|
2174
|
-
node_ids:
|
|
2175
|
-
strict:
|
|
2284
|
+
node_ids: import_zod6.z.array(import_zod6.z.string()).optional().describe("Data Graph node IDs to prioritize. Maximum 20."),
|
|
2285
|
+
strict: import_zod6.z.boolean().optional().describe(
|
|
2176
2286
|
"Only return cards matching node_ids. Requires a non-empty node_ids."
|
|
2177
2287
|
)
|
|
2178
2288
|
});
|
|
2179
|
-
var takoWebSourceInputSchema =
|
|
2180
|
-
count:
|
|
2181
|
-
include_contents:
|
|
2182
|
-
category:
|
|
2183
|
-
include_domains:
|
|
2184
|
-
exclude_domains:
|
|
2185
|
-
snippet_max_chars:
|
|
2186
|
-
highlights:
|
|
2289
|
+
var takoWebSourceInputSchema = import_zod6.z.object({
|
|
2290
|
+
count: import_zod6.z.number().optional().describe("Maximum number of web results to return (1-20)."),
|
|
2291
|
+
include_contents: import_zod6.z.boolean().optional().describe("Inline extracted web page text. This can add a data charge."),
|
|
2292
|
+
category: import_zod6.z.enum(["finance", "news", "sports"]).optional().describe("Optional web-result category filter."),
|
|
2293
|
+
include_domains: import_zod6.z.array(import_zod6.z.string()).optional().describe("Only return results from these bare domains."),
|
|
2294
|
+
exclude_domains: import_zod6.z.array(import_zod6.z.string()).optional().describe("Exclude results from these bare domains."),
|
|
2295
|
+
snippet_max_chars: import_zod6.z.number().optional().describe("Maximum characters in each web-result snippet."),
|
|
2296
|
+
highlights: import_zod6.z.boolean().optional().describe(
|
|
2187
2297
|
"Include highlighted passages in web results. Defaults to true in AI Gateway."
|
|
2188
2298
|
),
|
|
2189
|
-
article_content_max_chars:
|
|
2299
|
+
article_content_max_chars: import_zod6.z.number().optional().describe(
|
|
2190
2300
|
"Maximum extracted characters per web page when including contents."
|
|
2191
2301
|
),
|
|
2192
|
-
published_after:
|
|
2193
|
-
published_before:
|
|
2302
|
+
published_after: import_zod6.z.string().optional().describe("Keep results published on or after this ISO date (YYYY-MM-DD)."),
|
|
2303
|
+
published_before: import_zod6.z.string().optional().describe(
|
|
2194
2304
|
"Keep results published on or before this ISO date (YYYY-MM-DD)."
|
|
2195
2305
|
)
|
|
2196
2306
|
});
|
|
2197
|
-
var takoSearchInputSchema = (0,
|
|
2198
|
-
() => (0,
|
|
2199
|
-
|
|
2200
|
-
query:
|
|
2307
|
+
var takoSearchInputSchema = (0, import_provider_utils21.lazySchema)(
|
|
2308
|
+
() => (0, import_provider_utils21.zodSchema)(
|
|
2309
|
+
import_zod6.z.object({
|
|
2310
|
+
query: import_zod6.z.string().describe(
|
|
2201
2311
|
'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.'
|
|
2202
2312
|
),
|
|
2203
|
-
effort:
|
|
2313
|
+
effort: import_zod6.z.enum(["deep", "fast", "instant"]).optional().describe(
|
|
2204
2314
|
"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."
|
|
2205
2315
|
),
|
|
2206
|
-
sources:
|
|
2316
|
+
sources: import_zod6.z.object({
|
|
2207
2317
|
data: takoDataSourceInputSchema.optional(),
|
|
2208
2318
|
web: takoWebSourceInputSchema.optional()
|
|
2209
2319
|
}).optional().describe(
|
|
2210
2320
|
"Sources to search. Omit to search both curated data and the web. When provided, only keys present are searched."
|
|
2211
2321
|
),
|
|
2212
|
-
location:
|
|
2213
|
-
latitude:
|
|
2214
|
-
longitude:
|
|
2322
|
+
location: import_zod6.z.object({
|
|
2323
|
+
latitude: import_zod6.z.number().describe("Latitude between -90 and 90."),
|
|
2324
|
+
longitude: import_zod6.z.number().describe("Longitude between -180 and 180.")
|
|
2215
2325
|
}).optional().describe("End-user coordinates for localized results."),
|
|
2216
|
-
country_code:
|
|
2217
|
-
locale:
|
|
2218
|
-
timezone:
|
|
2219
|
-
output_settings:
|
|
2220
|
-
image_dark_mode:
|
|
2221
|
-
force_refresh:
|
|
2326
|
+
country_code: import_zod6.z.string().optional().describe("Two-letter ISO 3166-1 country code, such as 'US'."),
|
|
2327
|
+
locale: import_zod6.z.string().optional().describe("BCP-47 locale, such as 'en-US'."),
|
|
2328
|
+
timezone: import_zod6.z.string().optional().describe("IANA timezone, such as 'America/New_York'."),
|
|
2329
|
+
output_settings: import_zod6.z.object({
|
|
2330
|
+
image_dark_mode: import_zod6.z.boolean().optional().describe("Render card preview images in dark mode."),
|
|
2331
|
+
force_refresh: import_zod6.z.boolean().optional().describe(
|
|
2222
2332
|
"Instant-effort only. Request a refreshed instant result."
|
|
2223
2333
|
)
|
|
2224
2334
|
}).optional().describe("Controls card rendering in the search response."),
|
|
2225
|
-
include_related:
|
|
2335
|
+
include_related: import_zod6.z.number().optional().describe("Maximum related search suggestions to include (1-20).")
|
|
2226
2336
|
})
|
|
2227
2337
|
)
|
|
2228
2338
|
);
|
|
2229
|
-
var takoDatasetCellSchema =
|
|
2230
|
-
var takoResultContentSchema =
|
|
2231
|
-
content_format:
|
|
2232
|
-
cost:
|
|
2233
|
-
data:
|
|
2234
|
-
records:
|
|
2235
|
-
dataset:
|
|
2236
|
-
columns:
|
|
2237
|
-
|
|
2238
|
-
name:
|
|
2239
|
-
type:
|
|
2240
|
-
unit:
|
|
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({
|
|
2341
|
+
content_format: import_zod6.z.enum(["card_json", "csv", "json_compact", "json_records"]).nullish(),
|
|
2342
|
+
cost: import_zod6.z.number().optional(),
|
|
2343
|
+
data: import_zod6.z.string().nullish(),
|
|
2344
|
+
records: import_zod6.z.array(import_zod6.z.record(import_zod6.z.string(), takoDatasetCellSchema)).nullish(),
|
|
2345
|
+
dataset: import_zod6.z.object({
|
|
2346
|
+
columns: import_zod6.z.array(
|
|
2347
|
+
import_zod6.z.object({
|
|
2348
|
+
name: import_zod6.z.string(),
|
|
2349
|
+
type: import_zod6.z.enum(["boolean", "date", "datetime", "number", "string"]),
|
|
2350
|
+
unit: import_zod6.z.string().nullish()
|
|
2241
2351
|
})
|
|
2242
2352
|
),
|
|
2243
|
-
rows:
|
|
2244
|
-
total_rows:
|
|
2245
|
-
truncated:
|
|
2246
|
-
ref:
|
|
2247
|
-
sources:
|
|
2248
|
-
|
|
2249
|
-
name:
|
|
2250
|
-
index:
|
|
2353
|
+
rows: import_zod6.z.array(import_zod6.z.array(takoDatasetCellSchema)),
|
|
2354
|
+
total_rows: import_zod6.z.number(),
|
|
2355
|
+
truncated: import_zod6.z.boolean(),
|
|
2356
|
+
ref: import_zod6.z.string(),
|
|
2357
|
+
sources: import_zod6.z.array(
|
|
2358
|
+
import_zod6.z.object({
|
|
2359
|
+
name: import_zod6.z.string(),
|
|
2360
|
+
index: import_zod6.z.enum(["data", "web"]).optional()
|
|
2251
2361
|
})
|
|
2252
2362
|
),
|
|
2253
|
-
provenance:
|
|
2363
|
+
provenance: import_zod6.z.enum(["query", "web_extraction"]).optional()
|
|
2254
2364
|
}).nullish(),
|
|
2255
|
-
card_data:
|
|
2256
|
-
card_data_schema:
|
|
2257
|
-
url:
|
|
2258
|
-
expires_at:
|
|
2259
|
-
total_rows:
|
|
2260
|
-
truncated:
|
|
2261
|
-
export_pricing:
|
|
2262
|
-
baseline_usd:
|
|
2263
|
-
free_rows:
|
|
2264
|
-
max_rows_ceiling:
|
|
2265
|
-
row_cpm_usd:
|
|
2365
|
+
card_data: import_zod6.z.object({}).passthrough().nullish(),
|
|
2366
|
+
card_data_schema: import_zod6.z.object({}).passthrough().nullish(),
|
|
2367
|
+
url: import_zod6.z.string().nullish(),
|
|
2368
|
+
expires_at: import_zod6.z.string().nullish(),
|
|
2369
|
+
total_rows: import_zod6.z.number().nullish(),
|
|
2370
|
+
truncated: import_zod6.z.boolean().optional(),
|
|
2371
|
+
export_pricing: import_zod6.z.object({
|
|
2372
|
+
baseline_usd: import_zod6.z.number(),
|
|
2373
|
+
free_rows: import_zod6.z.number(),
|
|
2374
|
+
max_rows_ceiling: import_zod6.z.number(),
|
|
2375
|
+
row_cpm_usd: import_zod6.z.number()
|
|
2266
2376
|
}).nullish(),
|
|
2267
|
-
manifest:
|
|
2268
|
-
|
|
2269
|
-
dtype:
|
|
2270
|
-
entity:
|
|
2271
|
-
metric:
|
|
2272
|
-
name:
|
|
2273
|
-
unit:
|
|
2377
|
+
manifest: import_zod6.z.array(
|
|
2378
|
+
import_zod6.z.object({
|
|
2379
|
+
dtype: import_zod6.z.enum(["boolean", "date", "datetime", "number", "string"]).nullish(),
|
|
2380
|
+
entity: import_zod6.z.string().nullish(),
|
|
2381
|
+
metric: import_zod6.z.string().nullish(),
|
|
2382
|
+
name: import_zod6.z.string().nullish(),
|
|
2383
|
+
unit: import_zod6.z.string().nullish()
|
|
2274
2384
|
})
|
|
2275
2385
|
).nullish()
|
|
2276
2386
|
}).passthrough();
|
|
2277
|
-
var takoCardSchema =
|
|
2278
|
-
card_id:
|
|
2279
|
-
title:
|
|
2280
|
-
description:
|
|
2281
|
-
semantic_description:
|
|
2282
|
-
webpage_url:
|
|
2283
|
-
image_url:
|
|
2284
|
-
embed_url:
|
|
2285
|
-
sources:
|
|
2286
|
-
|
|
2287
|
-
source_name:
|
|
2288
|
-
source_description:
|
|
2289
|
-
source_index:
|
|
2290
|
-
source_text:
|
|
2291
|
-
url:
|
|
2387
|
+
var takoCardSchema = import_zod6.z.object({
|
|
2388
|
+
card_id: import_zod6.z.string().nullish(),
|
|
2389
|
+
title: import_zod6.z.string().nullish(),
|
|
2390
|
+
description: import_zod6.z.string().nullish(),
|
|
2391
|
+
semantic_description: import_zod6.z.string().nullish(),
|
|
2392
|
+
webpage_url: import_zod6.z.string().nullish(),
|
|
2393
|
+
image_url: import_zod6.z.string().nullish(),
|
|
2394
|
+
embed_url: import_zod6.z.string().nullish(),
|
|
2395
|
+
sources: import_zod6.z.array(
|
|
2396
|
+
import_zod6.z.object({
|
|
2397
|
+
source_name: import_zod6.z.string().nullish(),
|
|
2398
|
+
source_description: import_zod6.z.string().nullish(),
|
|
2399
|
+
source_index: import_zod6.z.enum(["data", "web"]),
|
|
2400
|
+
source_text: import_zod6.z.string().nullish(),
|
|
2401
|
+
url: import_zod6.z.string().nullish()
|
|
2292
2402
|
})
|
|
2293
2403
|
).nullish(),
|
|
2294
|
-
methodologies:
|
|
2295
|
-
|
|
2296
|
-
methodology_name:
|
|
2297
|
-
methodology_description:
|
|
2404
|
+
methodologies: import_zod6.z.array(
|
|
2405
|
+
import_zod6.z.object({
|
|
2406
|
+
methodology_name: import_zod6.z.string().nullable(),
|
|
2407
|
+
methodology_description: import_zod6.z.string().nullable()
|
|
2298
2408
|
})
|
|
2299
2409
|
).nullish(),
|
|
2300
|
-
source_indexes:
|
|
2301
|
-
card_type:
|
|
2302
|
-
relevance:
|
|
2410
|
+
source_indexes: import_zod6.z.array(import_zod6.z.enum(["data", "web"])).nullish(),
|
|
2411
|
+
card_type: import_zod6.z.string().nullish(),
|
|
2412
|
+
relevance: import_zod6.z.enum(["High", "Low", "Medium"]).nullish(),
|
|
2303
2413
|
content: takoResultContentSchema.nullish(),
|
|
2304
|
-
exportable:
|
|
2305
|
-
nodes:
|
|
2306
|
-
|
|
2307
|
-
id:
|
|
2308
|
-
type:
|
|
2309
|
-
name:
|
|
2310
|
-
description:
|
|
2414
|
+
exportable: import_zod6.z.boolean().optional(),
|
|
2415
|
+
nodes: import_zod6.z.array(
|
|
2416
|
+
import_zod6.z.object({
|
|
2417
|
+
id: import_zod6.z.string(),
|
|
2418
|
+
type: import_zod6.z.enum(["entity", "metric"]),
|
|
2419
|
+
name: import_zod6.z.string(),
|
|
2420
|
+
description: import_zod6.z.string().nullish()
|
|
2311
2421
|
})
|
|
2312
2422
|
).nullish(),
|
|
2313
|
-
metric_definitions:
|
|
2314
|
-
data_freshness:
|
|
2315
|
-
coverage_end:
|
|
2316
|
-
data_as_of:
|
|
2317
|
-
last_updated:
|
|
2423
|
+
metric_definitions: import_zod6.z.array(import_zod6.z.object({ name: import_zod6.z.string(), definition: import_zod6.z.string() })).nullish(),
|
|
2424
|
+
data_freshness: import_zod6.z.object({
|
|
2425
|
+
coverage_end: import_zod6.z.string().nullish(),
|
|
2426
|
+
data_as_of: import_zod6.z.string().nullish(),
|
|
2427
|
+
last_updated: import_zod6.z.string().nullish()
|
|
2318
2428
|
}).nullish()
|
|
2319
2429
|
}).passthrough();
|
|
2320
|
-
var takoWebResultSchema =
|
|
2321
|
-
title:
|
|
2322
|
-
url:
|
|
2323
|
-
snippet:
|
|
2324
|
-
source_name:
|
|
2325
|
-
publish_date:
|
|
2430
|
+
var takoWebResultSchema = import_zod6.z.object({
|
|
2431
|
+
title: import_zod6.z.string(),
|
|
2432
|
+
url: import_zod6.z.string(),
|
|
2433
|
+
snippet: import_zod6.z.string().nullish(),
|
|
2434
|
+
source_name: import_zod6.z.string().nullish(),
|
|
2435
|
+
publish_date: import_zod6.z.string().nullish(),
|
|
2326
2436
|
content: takoResultContentSchema.nullish()
|
|
2327
2437
|
}).passthrough();
|
|
2328
|
-
var takoSearchOutputSchema = (0,
|
|
2329
|
-
() => (0,
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
request_id:
|
|
2333
|
-
cards:
|
|
2334
|
-
web_results:
|
|
2335
|
-
usage:
|
|
2336
|
-
total_cost_usd:
|
|
2337
|
-
compute:
|
|
2338
|
-
data:
|
|
2438
|
+
var takoSearchOutputSchema = (0, import_provider_utils21.lazySchema)(
|
|
2439
|
+
() => (0, import_provider_utils21.zodSchema)(
|
|
2440
|
+
import_zod6.z.union([
|
|
2441
|
+
import_zod6.z.object({
|
|
2442
|
+
request_id: import_zod6.z.string(),
|
|
2443
|
+
cards: import_zod6.z.array(takoCardSchema).optional(),
|
|
2444
|
+
web_results: import_zod6.z.array(takoWebResultSchema).optional(),
|
|
2445
|
+
usage: import_zod6.z.object({
|
|
2446
|
+
total_cost_usd: import_zod6.z.number(),
|
|
2447
|
+
compute: import_zod6.z.object({ cost_usd: import_zod6.z.number() }).nullish(),
|
|
2448
|
+
data: import_zod6.z.object({ cost_usd: import_zod6.z.number(), datasets: import_zod6.z.number() }).nullish()
|
|
2339
2449
|
}).nullish(),
|
|
2340
|
-
related:
|
|
2450
|
+
related: import_zod6.z.array(import_zod6.z.object({}).passthrough()).nullish()
|
|
2341
2451
|
}).passthrough(),
|
|
2342
|
-
|
|
2343
|
-
error:
|
|
2452
|
+
import_zod6.z.object({
|
|
2453
|
+
error: import_zod6.z.enum([
|
|
2344
2454
|
"api_error",
|
|
2345
2455
|
"configuration_error",
|
|
2346
2456
|
"execution_error",
|
|
@@ -2349,13 +2459,13 @@ var takoSearchOutputSchema = (0, import_provider_utils19.lazySchema)(
|
|
|
2349
2459
|
"timeout",
|
|
2350
2460
|
"unknown_tool"
|
|
2351
2461
|
]),
|
|
2352
|
-
statusCode:
|
|
2353
|
-
message:
|
|
2462
|
+
statusCode: import_zod6.z.number().optional(),
|
|
2463
|
+
message: import_zod6.z.string()
|
|
2354
2464
|
})
|
|
2355
2465
|
])
|
|
2356
2466
|
)
|
|
2357
2467
|
);
|
|
2358
|
-
var takoSearchToolFactory = (0,
|
|
2468
|
+
var takoSearchToolFactory = (0, import_provider_utils21.createProviderToolFactoryWithOutputSchema)({
|
|
2359
2469
|
id: "gateway.tako_search",
|
|
2360
2470
|
inputSchema: takoSearchInputSchema,
|
|
2361
2471
|
outputSchema: takoSearchOutputSchema
|
|
@@ -2364,6 +2474,20 @@ var takoSearch = (config = {}) => takoSearchToolFactory(config);
|
|
|
2364
2474
|
|
|
2365
2475
|
// src/gateway-tools.ts
|
|
2366
2476
|
var gatewayTools = {
|
|
2477
|
+
/**
|
|
2478
|
+
* Fetch page content using Browserbase's lightweight Fetch API.
|
|
2479
|
+
*
|
|
2480
|
+
* Supports raw, Markdown, and schema-driven JSON output as well as redirects,
|
|
2481
|
+
* proxy routing, and TLS controls.
|
|
2482
|
+
*/
|
|
2483
|
+
browserbaseFetch,
|
|
2484
|
+
/**
|
|
2485
|
+
* Search the web using Browserbase's Search API for fast, structured results.
|
|
2486
|
+
*
|
|
2487
|
+
* Returns titles, URLs, and available publication metadata without requiring
|
|
2488
|
+
* a browser session.
|
|
2489
|
+
*/
|
|
2490
|
+
browserbaseSearch,
|
|
2367
2491
|
/**
|
|
2368
2492
|
* Search the web using Exa for current information and token-efficient
|
|
2369
2493
|
* excerpts optimized for agent workflows.
|
|
@@ -2409,7 +2533,7 @@ async function getVercelRequestId() {
|
|
|
2409
2533
|
}
|
|
2410
2534
|
|
|
2411
2535
|
// src/version.ts
|
|
2412
|
-
var VERSION = true ? "3.0.
|
|
2536
|
+
var VERSION = true ? "3.0.202" : "0.0.0-test";
|
|
2413
2537
|
|
|
2414
2538
|
// src/gateway-provider.ts
|
|
2415
2539
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
|
@@ -2419,11 +2543,11 @@ function createGatewayProvider(options = {}) {
|
|
|
2419
2543
|
let metadataCache = null;
|
|
2420
2544
|
const cacheRefreshMillis = (_a11 = options.metadataCacheRefreshMillis) != null ? _a11 : 1e3 * 60 * 5;
|
|
2421
2545
|
let lastFetchTime = 0;
|
|
2422
|
-
const baseURL = (_b11 = (0,
|
|
2546
|
+
const baseURL = (_b11 = (0, import_provider_utils22.withoutTrailingSlash)(options.baseURL)) != null ? _b11 : "https://ai-gateway.vercel.sh/v3/ai";
|
|
2423
2547
|
const getHeaders = async () => {
|
|
2424
2548
|
try {
|
|
2425
2549
|
const auth = await getGatewayAuthToken(options);
|
|
2426
|
-
return (0,
|
|
2550
|
+
return (0, import_provider_utils22.withUserAgentSuffix)(
|
|
2427
2551
|
{
|
|
2428
2552
|
Authorization: `Bearer ${auth.token}`,
|
|
2429
2553
|
"ai-gateway-protocol-version": AI_GATEWAY_PROTOCOL_VERSION,
|
|
@@ -2442,19 +2566,19 @@ function createGatewayProvider(options = {}) {
|
|
|
2442
2566
|
}
|
|
2443
2567
|
};
|
|
2444
2568
|
const createO11yHeaders = () => {
|
|
2445
|
-
const deploymentId = (0,
|
|
2569
|
+
const deploymentId = (0, import_provider_utils22.loadOptionalSetting)({
|
|
2446
2570
|
settingValue: void 0,
|
|
2447
2571
|
environmentVariableName: "VERCEL_DEPLOYMENT_ID"
|
|
2448
2572
|
});
|
|
2449
|
-
const environment = (0,
|
|
2573
|
+
const environment = (0, import_provider_utils22.loadOptionalSetting)({
|
|
2450
2574
|
settingValue: void 0,
|
|
2451
2575
|
environmentVariableName: "VERCEL_ENV"
|
|
2452
2576
|
});
|
|
2453
|
-
const region = (0,
|
|
2577
|
+
const region = (0, import_provider_utils22.loadOptionalSetting)({
|
|
2454
2578
|
settingValue: void 0,
|
|
2455
2579
|
environmentVariableName: "VERCEL_REGION"
|
|
2456
2580
|
});
|
|
2457
|
-
const projectId = (0,
|
|
2581
|
+
const projectId = (0, import_provider_utils22.loadOptionalSetting)({
|
|
2458
2582
|
settingValue: void 0,
|
|
2459
2583
|
environmentVariableName: "VERCEL_PROJECT_ID"
|
|
2460
2584
|
});
|
|
@@ -2620,7 +2744,7 @@ function createGatewayProvider(options = {}) {
|
|
|
2620
2744
|
}
|
|
2621
2745
|
var gateway = createGatewayProvider();
|
|
2622
2746
|
async function getGatewayAuthToken(options) {
|
|
2623
|
-
const apiKey = (0,
|
|
2747
|
+
const apiKey = (0, import_provider_utils22.loadOptionalSetting)({
|
|
2624
2748
|
settingValue: options.apiKey,
|
|
2625
2749
|
environmentVariableName: "AI_GATEWAY_API_KEY"
|
|
2626
2750
|
});
|