@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 +11 -22
- package/src/i18n/zh.json +42 -42
- package/src/index.d.ts +1 -1
- package/src/index.d.ts.map +1 -0
- package/src/index.js +10 -40
- package/src/index.js.map +1 -1
- package/src/lib/actions/extract.d.ts +1 -0
- package/src/lib/actions/extract.d.ts.map +1 -0
- package/src/lib/actions/extract.js +6 -3
- package/src/lib/actions/extract.js.map +1 -1
- package/src/lib/actions/search.d.ts +1 -0
- package/src/lib/actions/search.d.ts.map +1 -0
- package/src/lib/actions/search.js +6 -3
- package/src/lib/actions/search.js.map +1 -1
- package/src/lib/auth.d.ts +2 -0
- package/src/lib/auth.d.ts.map +1 -0
- package/src/lib/auth.js +40 -0
- package/src/lib/auth.js.map +1 -0
- package/README.md +0 -25
package/package.json
CHANGED
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-tavily",
|
|
3
|
-
"version": "0.1.
|
|
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
|
-
"@
|
|
6
|
-
"
|
|
7
|
-
"
|
|
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.": "
|
|
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.": "
|
|
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.": "
|
|
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.": "
|
|
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.": "
|
|
29
|
-
"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.": "
|
|
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.": "
|
|
34
|
-
"Include a list of images extracted from the URLs in the response.": "
|
|
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 =
|
|
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
|
|
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:
|
|
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":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAA6D;AAC7D,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
|
|
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:
|
|
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":["
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../src/lib/actions/extract.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,kCAAqC;AAExB,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,+CAA+C;IAC5D,IAAI,EAAE,iBAAU;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;gBACvB,GAAG,EAAE,gCAAgC;gBACrC,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,IAAI,CAAC,WAAW;iBACxB;gBACD,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE;oBACJ,IAAI,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
|
|
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:
|
|
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":["
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../src/lib/actions/search.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,kCAAqC;AAExB,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,mCAAmC;IAChD,IAAI,EAAE,iBAAU;IAChB,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACvB,WAAW,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ADDED
|
@@ -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
|