@tavily/ai-sdk 0.2.0 → 0.3.1
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/dist/index.d.ts +0 -1
- package/dist/index.js +7 -9
- package/package.json +6 -8
package/dist/index.d.ts
CHANGED
|
@@ -35,7 +35,6 @@ declare const tavilyCrawl: (options?: TavilyCrawlOptions) => ai.Tool<{
|
|
|
35
35
|
extractDepth?: "basic" | "advanced" | undefined;
|
|
36
36
|
instructions?: string | undefined;
|
|
37
37
|
allowExternal?: boolean | undefined;
|
|
38
|
-
query?: string | undefined;
|
|
39
38
|
}, _tavily_core.TavilyCrawlResponse>;
|
|
40
39
|
|
|
41
40
|
type TavilyMapOptions = TavilyClientOptions & Partial<TavilyMapOptions$1>;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { tool } from "ai";
|
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { tavily } from "@tavily/core";
|
|
5
5
|
var tavilySearch = (options = {}) => {
|
|
6
|
-
const client = tavily(options);
|
|
6
|
+
const client = tavily({ ...options, clientSource: "ai-sdk" });
|
|
7
7
|
const inputSchema = z.object({
|
|
8
8
|
query: z.string().describe("The search query to look up on the web"),
|
|
9
9
|
searchDepth: z.enum(["basic", "advanced"]).optional().describe(
|
|
@@ -33,7 +33,7 @@ import { tool as tool2 } from "ai";
|
|
|
33
33
|
import { z as z2 } from "zod";
|
|
34
34
|
import { tavily as tavily2 } from "@tavily/core";
|
|
35
35
|
var tavilyExtract = (options = {}) => {
|
|
36
|
-
const client = tavily2(options);
|
|
36
|
+
const client = tavily2({ ...options, clientSource: "ai-sdk" });
|
|
37
37
|
const inputSchema = z2.object({
|
|
38
38
|
urls: z2.array(z2.string()).describe("Array of URLs to extract content from"),
|
|
39
39
|
extractDepth: z2.enum(["basic", "advanced"]).optional().describe(
|
|
@@ -63,7 +63,7 @@ import { tool as tool3 } from "ai";
|
|
|
63
63
|
import { z as z3 } from "zod";
|
|
64
64
|
import { tavily as tavily3 } from "@tavily/core";
|
|
65
65
|
var tavilyCrawl = (options = {}) => {
|
|
66
|
-
const client = tavily3(options);
|
|
66
|
+
const client = tavily3({ ...options, clientSource: "ai-sdk" });
|
|
67
67
|
const inputSchema = z3.object({
|
|
68
68
|
url: z3.string().describe("The base URL to start crawling from"),
|
|
69
69
|
maxDepth: z3.number().min(1).max(5).optional().describe(
|
|
@@ -73,8 +73,7 @@ var tavilyCrawl = (options = {}) => {
|
|
|
73
73
|
instructions: z3.string().optional().describe(
|
|
74
74
|
"Optional instructions to guide the crawler (e.g., 'only crawl blog posts', 'focus on product pages')"
|
|
75
75
|
),
|
|
76
|
-
allowExternal: z3.boolean().optional().describe("Whether to allow crawling external domains (default: false)")
|
|
77
|
-
query: z3.string().optional().describe("User intent query for reranking extracted content chunks")
|
|
76
|
+
allowExternal: z3.boolean().optional().describe("Whether to allow crawling external domains (default: false)")
|
|
78
77
|
});
|
|
79
78
|
return tool3({
|
|
80
79
|
description: "Crawl a website starting from a base URL to discover and extract content from multiple pages. Intelligently traverses links and extracts structured data at scale.",
|
|
@@ -84,8 +83,7 @@ var tavilyCrawl = (options = {}) => {
|
|
|
84
83
|
maxDepth: inputMaxDepth,
|
|
85
84
|
extractDepth: inputExtractDepth,
|
|
86
85
|
instructions: inputInstructions,
|
|
87
|
-
allowExternal: inputAllowExternal
|
|
88
|
-
query: inputQuery
|
|
86
|
+
allowExternal: inputAllowExternal
|
|
89
87
|
}) => {
|
|
90
88
|
return await client.crawl(url, {
|
|
91
89
|
...options,
|
|
@@ -93,7 +91,7 @@ var tavilyCrawl = (options = {}) => {
|
|
|
93
91
|
extractDepth: inputExtractDepth ?? options.extractDepth,
|
|
94
92
|
instructions: inputInstructions ?? options.instructions,
|
|
95
93
|
allowExternal: inputAllowExternal ?? options.allowExternal,
|
|
96
|
-
|
|
94
|
+
chunksPerSource: 3
|
|
97
95
|
});
|
|
98
96
|
}
|
|
99
97
|
});
|
|
@@ -104,7 +102,7 @@ import { tool as tool4 } from "ai";
|
|
|
104
102
|
import { z as z4 } from "zod";
|
|
105
103
|
import { tavily as tavily4 } from "@tavily/core";
|
|
106
104
|
var tavilyMap = (options = {}) => {
|
|
107
|
-
const client = tavily4(options);
|
|
105
|
+
const client = tavily4({ ...options, clientSource: "ai-sdk" });
|
|
108
106
|
const inputSchema = z4.object({
|
|
109
107
|
url: z4.string().describe("The base URL to start mapping from"),
|
|
110
108
|
maxDepth: z4.number().min(1).max(5).optional().describe(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tavily/ai-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Tavily AI SDK tools - Search, Extract, Crawl, and Map",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,10 +15,6 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "tsup src/index.ts --format esm --dts",
|
|
20
|
-
"prepublishOnly": "pnpm build"
|
|
21
|
-
},
|
|
22
18
|
"keywords": [
|
|
23
19
|
"ai",
|
|
24
20
|
"ai-sdk",
|
|
@@ -39,7 +35,6 @@
|
|
|
39
35
|
"bugs": {
|
|
40
36
|
"url": "https://github.com/tavily-ai/ai-sdk/issues"
|
|
41
37
|
},
|
|
42
|
-
"packageManager": "pnpm@10.8.0",
|
|
43
38
|
"devDependencies": {
|
|
44
39
|
"@ai-sdk/openai": "^2.0.71",
|
|
45
40
|
"@types/node": "^24.10.1",
|
|
@@ -49,10 +44,13 @@
|
|
|
49
44
|
"typescript": "^5.9.3"
|
|
50
45
|
},
|
|
51
46
|
"dependencies": {
|
|
52
|
-
"@tavily/core": "
|
|
47
|
+
"@tavily/core": "^0.6.2"
|
|
53
48
|
},
|
|
54
49
|
"peerDependencies": {
|
|
55
50
|
"ai": "^5.0.0",
|
|
56
51
|
"zod": "^4.0.0"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "tsup src/index.ts --format esm --dts"
|
|
57
55
|
}
|
|
58
|
-
}
|
|
56
|
+
}
|