@activepieces/piece-tavily 0.1.3 → 0.1.5

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/package.json CHANGED
@@ -1,27 +1,16 @@
1
1
  {
2
2
  "name": "@activepieces/piece-tavily",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
+ "main": "./src/index.js",
5
+ "types": "./src/index.d.ts",
6
+ "scripts": {
7
+ "build": "tsc -p tsconfig.lib.json && cp package.json dist/",
8
+ "lint": "eslint 'src/**/*.ts'"
9
+ },
4
10
  "dependencies": {
5
- "@sinclair/typebox": "0.34.11",
6
- "ai": "^6.0.0",
7
- "axios": "1.13.5",
8
- "axios-retry": "4.4.1",
9
- "deepmerge-ts": "7.1.0",
10
- "form-data": "4.0.4",
11
- "mime-types": "2.1.35",
12
- "nanoid": "3.3.8",
13
- "semver": "7.6.0",
14
- "socket.io-client": "4.8.1",
15
- "zod": "4.1.13",
16
- "@activepieces/pieces-common": "0.11.5",
17
- "@activepieces/pieces-framework": "0.25.3",
18
- "@activepieces/shared": "0.37.0",
11
+ "@activepieces/pieces-common": "0.12.3",
12
+ "@activepieces/pieces-framework": "0.27.2",
13
+ "@activepieces/shared": "0.67.0",
19
14
  "tslib": "2.6.2"
20
- },
21
- "resolutions": {
22
- "rollup": "npm:@rollup/wasm-node"
23
- },
24
- "types": "./src/index.d.ts",
25
- "main": "./src/index.js",
26
- "type": "commonjs"
15
+ }
27
16
  }
package/src/i18n/zh.json CHANGED
@@ -1,47 +1,47 @@
1
1
  {
2
- "Search engine tailored for AI agents.": "适用于 AI 代理人的搜索引擎。",
2
+ "Search engine tailored for AI agents.": "Search engine tailored for AI agents.",
3
3
  "\nFollow these steps to obtain your Tavily API Key:\n\n1. Visit [tavily](https://tavily.com/) and create an account.\n2. Log in and navigate to your dashboard.\n3. Locate and copy your API key from the dashboard.\n": "\nFollow these steps to obtain your Tavily API Key:\n\n1. Visit [tavily](https://tavily.com/) and create an account.\n2. Log in and navigate to your dashboard.\n3. Locate and copy your API key from the dashboard.\n",
4
4
  "Search": "搜索",
5
- "Extract Content": "提取内容",
6
- "Search for data based on a query.": "基于查询搜索数据。",
7
- "Retrieve raw web content from specified URLs.": "从指定的 URL 获取原始网页内容。",
8
- "Search Query": "搜索查询",
9
- "Search Depth": "搜索深度",
10
- "Topic": "主题",
11
- "Days": "天",
12
- "Time Range": "时间范围",
13
- "Maximum Results": "最大结果",
14
- "Include Images": "包含图像",
15
- "Include Image Descriptions": "包含图像描述",
16
- "Include Answer": "包含答案",
17
- "Include Raw Content": "包含原始内容",
18
- "Include Domains": "包括域",
19
- "Exclude Domains": "排除域",
20
- "URLs": "链接地址",
21
- "The search query you want to execute with Tavily.": "您想要使用 Tavily 执行的搜索查询。",
22
- "The depth of the search. It can be \"basic\" or \"advanced\".": "搜索的深度。它可以是“基本”或“高级”。",
23
- "The category of the search. This will determine which of our agents will be used for the search.": "搜索的类别。这将决定哪些代理人将用于搜索。",
24
- "The number of days back from the current date to include in the search results. Only available when using the \"news\" search topic. Default is 3.": "从当前日期起包含在搜索结果中的天数。 仅在使用“新闻”搜索主题时可用。默认值是 3。",
25
- "The time range back from the current date to include in the search results.": "时间范围从当前日期到搜索结果包含进去。",
26
- "The maximum number of search results to return.": "要返回的搜索结果的最大数量。",
27
- "Include a list of query-related images in the response.": "在响应中包含一个与查询相关的图像列表。",
28
- "When include_images is set to True, this option adds descriptive text for each image.": "当include_image 设置为 True时,此选项为每个图像添加描述性文本。",
29
- "Include a short answer to original query, generated by an LLM based on Tavily's search results.": "包含一个由基于Tavily搜索结果的 LLM 生成的原始查询的简短答案。",
30
- "Include the cleaned and parsed HTML content of each search result.": "包括每个搜索结果的清理和分析的 HTML 内容。",
31
- "A list of domains to specifically include in the search results.": "具体包含在搜索结果中的域列表。",
32
- "A list of domains to specifically exclude from the search results.": "要从搜索结果中具体排除的域列表。",
33
- "The URLs you want to extract with Tavily.": "您想要使用 Tavily 提取的 URL。",
34
- "Include a list of images extracted from the URLs in the response.": "在响应中包含从URL中提取的图像列表。",
35
- "Basic": "基本的",
36
- "Advanced": "高级版",
5
+ "Extract Content": "Extract Content",
6
+ "Search for data based on a query.": "Search for data based on a query.",
7
+ "Retrieve raw web content from specified URLs.": "Retrieve raw web content from specified URLs.",
8
+ "Search Query": "Search Query",
9
+ "Search Depth": "Search Depth",
10
+ "Topic": "Topic",
11
+ "Days": "Days",
12
+ "Time Range": "Time Range",
13
+ "Maximum Results": "Maximum Results",
14
+ "Include Images": "Include Images",
15
+ "Include Image Descriptions": "Include Image Descriptions",
16
+ "Include Answer": "Include Answer",
17
+ "Include Raw Content": "Include Raw Content",
18
+ "Include Domains": "Include Domains",
19
+ "Exclude Domains": "Exclude Domains",
20
+ "URLs": "URLs",
21
+ "The search query you want to execute with Tavily.": "The search query you want to execute with Tavily.",
22
+ "The depth of the search. It can be \"basic\" or \"advanced\".": "The depth of the search. It can be \"basic\" or \"advanced\".",
23
+ "The category of the search. This will determine which of our agents will be used for the search.": "The category of the search. This will determine which of our agents will be used for the search.",
24
+ "The number of days back from the current date to include in the search results. Only available when using the \"news\" search topic. Default is 3.": "The number of days back from the current date to include in the search results. Only available when using the \"news\" search topic. Default is 3.",
25
+ "The time range back from the current date to include in the search results.": "The time range back from the current date to include in the search results.",
26
+ "The maximum number of search results to return.": "The maximum number of search results to return.",
27
+ "Include a list of query-related images in the response.": "Include a list of query-related images in the response.",
28
+ "When include_images is set to True, this option adds descriptive text for each image.": "When include_images is set to True, this option adds descriptive text for each image.",
29
+ "Include a short answer to original query, generated by an LLM based on Tavily's search results.": "Include a short answer to original query, generated by an LLM based on Tavily's search results.",
30
+ "Include the cleaned and parsed HTML content of each search result.": "Include the cleaned and parsed HTML content of each search result.",
31
+ "A list of domains to specifically include in the search results.": "A list of domains to specifically include in the search results.",
32
+ "A list of domains to specifically exclude from the search results.": "A list of domains to specifically exclude from the search results.",
33
+ "The URLs you want to extract with Tavily.": "The URLs you want to extract with Tavily.",
34
+ "Include a list of images extracted from the URLs in the response.": "Include a list of images extracted from the URLs in the response.",
35
+ "Basic": "Basic",
36
+ "Advanced": "Advanced",
37
37
  "General": "A. 概况",
38
- "News": "新闻",
39
- "Day": "日",
40
- "Week": "周",
41
- "Month": "月",
42
- "Year": "年份",
43
- "Day (Short)": "天 (快捷键)",
44
- "Week (Short)": "周(快捷)",
45
- "Month (Short)": "月份(快捷)",
46
- "Year (Short)": "年份 (高时)"
38
+ "News": "News",
39
+ "Day": "Day",
40
+ "Week": "Week",
41
+ "Month": "Month",
42
+ "Year": "Year",
43
+ "Day (Short)": "Day (Short)",
44
+ "Week (Short)": "Week (Short)",
45
+ "Month (Short)": "Month (Short)",
46
+ "Year (Short)": "Year (Short)"
47
47
  }
package/src/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const tavilyAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
2
1
  export declare const tavily: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,MAAM,mHAgBjB,CAAC"}
package/src/index.js CHANGED
@@ -1,49 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tavily = exports.tavilyAuth = void 0;
3
+ exports.tavily = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const pieces_common_1 = require("@activepieces/pieces-common");
6
6
  const pieces_framework_1 = require("@activepieces/pieces-framework");
7
7
  const shared_1 = require("@activepieces/shared");
8
8
  const search_1 = require("./lib/actions/search");
9
9
  const extract_1 = require("./lib/actions/extract");
10
- const markdownDescription = `
11
- Follow these steps to obtain your Tavily API Key:
12
-
13
- 1. Visit [tavily](https://tavily.com/) and create an account.
14
- 2. Log in and navigate to your dashboard.
15
- 3. Locate and copy your API key from the dashboard.
16
- `;
17
- exports.tavilyAuth = pieces_framework_1.PieceAuth.SecretText({
18
- description: markdownDescription,
19
- displayName: 'API Key',
20
- required: true,
21
- validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
22
- try {
23
- yield pieces_common_1.httpClient.sendRequest({
24
- method: pieces_common_1.HttpMethod.POST,
25
- url: 'https://api.tavily.com/search',
26
- headers: {
27
- 'Content-Type': 'application/json',
28
- },
29
- body: {
30
- api_key: auth,
31
- query: 'test',
32
- search_depth: 'basic',
33
- },
34
- });
35
- return {
36
- valid: true,
37
- };
38
- }
39
- catch (e) {
40
- return {
41
- valid: false,
42
- error: 'Invalid API Key',
43
- };
44
- }
45
- }),
46
- });
10
+ const auth_1 = require("./lib/auth");
47
11
  exports.tavily = (0, pieces_framework_1.createPiece)({
48
12
  displayName: 'Tavily',
49
13
  description: 'Search engine tailored for AI agents.',
@@ -51,8 +15,14 @@ exports.tavily = (0, pieces_framework_1.createPiece)({
51
15
  logoUrl: 'https://cdn.activepieces.com/pieces/tavily.jpg',
52
16
  categories: [shared_1.PieceCategory.ARTIFICIAL_INTELLIGENCE],
53
17
  authors: ['OsamaHaikal'],
54
- auth: exports.tavilyAuth,
55
- actions: [search_1.searchAction, extract_1.extractAction],
18
+ auth: auth_1.tavilyAuth,
19
+ actions: [search_1.searchAction, extract_1.extractAction,
20
+ (0, pieces_common_1.createCustomApiCallAction)({
21
+ baseUrl: () => 'https://api.tavily.com',
22
+ auth: auth_1.tavilyAuth,
23
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { return ({ Authorization: `Bearer ${auth.secret_text}` }); }),
24
+ })
25
+ ],
56
26
  triggers: [],
57
27
  });
58
28
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/tavily/src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AACrE,qEAAwE;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iDAAqD;AACrD,iDAAoD;AACpD,mDAAsD;AACtD,qCAAwC;AAE3B,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IACjC,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,uCAAuC;IACpD,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,gDAAgD;IACzD,UAAU,EAAE,CAAC,sBAAa,CAAC,uBAAuB,CAAC;IACnD,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,IAAI,EAAE,iBAAU;IAChB,OAAO,EAAE,CAAC,qBAAY,EAAE,uBAAa;QACpC,IAAA,yCAAyB,EAAC;YACzB,OAAO,EAAE,GAAG,EAAE,CAAC,wBAAwB;YACvC,IAAI,EAAE,iBAAU;YAChB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE,0DAAC,OAAA,CAAC,EAAE,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA,GAAA;SAC9E,CAAC;KACF;IACD,QAAQ,EAAE,EAAE;CACZ,CAAC,CAAC"}
@@ -2,3 +2,4 @@ export declare const extractAction: import("@activepieces/pieces-framework").IAc
2
2
  urls: import("@activepieces/pieces-framework").ArrayProperty<true>;
3
3
  include_images: import("@activepieces/pieces-framework").CheckboxProperty<false>;
4
4
  }>;
5
+ //# sourceMappingURL=extract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/extract.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa;;;EAqCxB,CAAC"}
@@ -4,12 +4,12 @@ exports.extractAction = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const pieces_framework_1 = require("@activepieces/pieces-framework");
6
6
  const pieces_common_1 = require("@activepieces/pieces-common");
7
- const index_1 = require("../../index");
7
+ const auth_1 = require("../auth");
8
8
  exports.extractAction = (0, pieces_framework_1.createAction)({
9
9
  name: 'extract',
10
10
  displayName: 'Extract Content',
11
11
  description: 'Retrieve raw web content from specified URLs.',
12
- auth: index_1.tavilyAuth,
12
+ auth: auth_1.tavilyAuth,
13
13
  props: {
14
14
  urls: pieces_framework_1.Property.Array({
15
15
  displayName: 'URLs',
@@ -28,11 +28,14 @@ exports.extractAction = (0, pieces_framework_1.createAction)({
28
28
  const response = yield pieces_common_1.httpClient.sendRequest({
29
29
  method: pieces_common_1.HttpMethod.POST,
30
30
  url: 'https://api.tavily.com/extract',
31
+ authentication: {
32
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
33
+ token: auth.secret_text
34
+ },
31
35
  headers: {
32
36
  'Content-Type': 'application/json',
33
37
  },
34
38
  body: {
35
- api_key: auth,
36
39
  urls: propsValue.urls,
37
40
  include_images: propsValue.include_images,
38
41
  },
@@ -1 +1 @@
1
- {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/tavily/src/lib/actions/extract.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,uCAAyC;AAE5B,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,+CAA+C;IAC5D,IAAI,EAAE,kBAAU;IAChB,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACnB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,2CAA2C;YACxD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,cAAc,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAChC,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,mEAAmE;YAChF,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACpB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gB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,EAAE,UAAU,CAAC,IAAI;oBACrB,cAAc,EAAE,UAAU,CAAC,cAAc;iBAC1C;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -12,3 +12,4 @@ export declare const searchAction: import("@activepieces/pieces-framework").IAct
12
12
  include_domains: import("@activepieces/pieces-framework").ArrayProperty<false>;
13
13
  exclude_domains: import("@activepieces/pieces-framework").ArrayProperty<false>;
14
14
  }>;
15
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/search.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY;;;;;;;;;;;;;EAgIvB,CAAC"}
@@ -4,12 +4,12 @@ exports.searchAction = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const pieces_framework_1 = require("@activepieces/pieces-framework");
6
6
  const pieces_common_1 = require("@activepieces/pieces-common");
7
- const index_1 = require("../../index");
7
+ const auth_1 = require("../auth");
8
8
  exports.searchAction = (0, pieces_framework_1.createAction)({
9
9
  name: 'search',
10
10
  displayName: 'Search',
11
11
  description: 'Search for data based on a query.',
12
- auth: index_1.tavilyAuth,
12
+ auth: auth_1.tavilyAuth,
13
13
  props: {
14
14
  query: pieces_framework_1.Property.LongText({
15
15
  displayName: 'Search Query',
@@ -109,11 +109,14 @@ exports.searchAction = (0, pieces_framework_1.createAction)({
109
109
  const response = yield pieces_common_1.httpClient.sendRequest({
110
110
  method: pieces_common_1.HttpMethod.POST,
111
111
  url: 'https://api.tavily.com/search',
112
+ authentication: {
113
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
114
+ token: auth.secret_text
115
+ },
112
116
  headers: {
113
117
  'Content-Type': 'application/json',
114
118
  },
115
119
  body: {
116
- api_key: auth,
117
120
  query: propsValue.query,
118
121
  search_depth: propsValue.search_depth,
119
122
  topic: propsValue.topic,
@@ -1 +1 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/tavily/src/lib/actions/search.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,uCAAyC;AAE5B,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,mCAAmC;IAChD,IAAI,EAAE,kBAAU;IAChB,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACvB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,cAAc,CAAC;YACpC,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,2DAA2D;YACxE,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,OAAO;YACrB,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;oBAClC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;iBACzC;aACF;SACF,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC7B,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,kGAAkG;YAC/G,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,SAAS;YACvB,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;oBACtC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;iBACjC;aACF;SACF,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACpB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,kJAAkJ;YAC/J,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,CAAC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BACzC,0BAA0B,EAAE,UAAU,CAAC,0BAA0B;oBACjE,cAAc,EAAE,UAAU,CAAC,cAAc;oBACzC,mBAAmB,EAAE,UAAU,CAAC,mBAAmB;oBACnD,eAAe,EAAE,UAAU,CAAC,eAAe;oBAC3C,eAAe,EAAE,UAAU,CAAC,eAAe;iBAC5C;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const tavilyAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
2
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,mEAwBrB,CAAC"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tavilyAuth = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const markdownDescription = `
8
+ Follow these steps to obtain your Tavily API Key:
9
+
10
+ 1. Visit [tavily](https://tavily.com/) and create an account.
11
+ 2. Log in and navigate to your dashboard.
12
+ 3. Locate and copy your API key from the dashboard.
13
+ `;
14
+ exports.tavilyAuth = pieces_framework_1.PieceAuth.SecretText({
15
+ description: markdownDescription,
16
+ displayName: 'API Key',
17
+ required: true,
18
+ validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
19
+ try {
20
+ yield pieces_common_1.httpClient.sendRequest({
21
+ method: pieces_common_1.HttpMethod.GET,
22
+ url: 'https://api.tavily.com/usage',
23
+ authentication: {
24
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
25
+ token: auth
26
+ }
27
+ });
28
+ return {
29
+ valid: true,
30
+ };
31
+ }
32
+ catch (e) {
33
+ return {
34
+ valid: false,
35
+ error: 'Invalid API Key',
36
+ };
37
+ }
38
+ }),
39
+ });
40
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAA2D;AAC3D,+DAAyF;AAEzF,MAAM,mBAAmB,GAAG;;;;;;CAM3B,CAAC;AAEW,QAAA,UAAU,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC9C,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,SAAS;IACtB,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACxB,IAAI,CAAC;YACJ,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,8BAA8B;gBACnC,cAAc,EAAE;oBACf,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,IAAI;iBACX;aACD,CAAC,CAAC;YACH,OAAO;gBACN,KAAK,EAAE,IAAI;aACX,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,OAAO;gBACN,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,iBAAiB;aACxB,CAAC;QACH,CAAC;IACF,CAAC,CAAA;CACD,CAAC,CAAC"}
package/README.md DELETED
@@ -1,25 +0,0 @@
1
- # Tavily
2
-
3
- ## Description
4
- Tavily is an AI-powered search engine designed for accurate and real-time information retrieval. This piece enables integration with Tavily's API to perform searches and extract information.
5
-
6
- ## Actions
7
- 1. **Search**: Perform a search query using Tavily's AI search engine
8
- - Supports both basic and advanced search depths
9
- - Optional AI-generated answer
10
- - Configurable result limits
11
- - Raw content inclusion option
12
-
13
- 2. **Extract**: Extract structured data from a webpage using Tavily's extraction API
14
- - Clean and formatted content extraction
15
- - Supports various content types
16
- - Removes ads and irrelevant content
17
-
18
- ## Authentication
19
- This piece requires an API key from Tavily. To obtain your API key:
20
- 1. Visit https://tavily.com/ and sign up for an account
21
- 2. Navigate to your dashboard
22
- 3. Copy your API key from the dashboard
23
-
24
- ## Requirements
25
- - Tavily API Key