You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "Search for articles on arXiv. [See the documentation](https://info.arxiv.org/help/api/user-manual.html#2-api-quickstart)",
8
+
version: "0.0.1",
9
+
type: "action",
10
+
annotations: {
11
+
destructiveHint: false,
12
+
openWorldHint: true,
13
+
readOnlyHint: true,
14
+
},
15
+
props: {
16
+
arxiv,
17
+
searchQuery: {
18
+
type: "string",
19
+
label: "Search Query",
20
+
description: "The search query to use. Example: `all:electron`. [See the documentation](https://info.arxiv.org/help/api/user-manual.html#51-details-of-query-construction) for information on constructing a search query.",
21
+
optional: true,
22
+
},
23
+
idList: {
24
+
type: "string[]",
25
+
label: "ID List",
26
+
description: "A list of arXiv article IDs to search for. Example ID: `2505.08081v1`",
27
+
optional: true,
28
+
},
29
+
start: {
30
+
type: "integer",
31
+
label: "Start",
32
+
description: "The index of the first result to return. Defaults to 0.",
33
+
optional: true,
34
+
},
35
+
maxResults: {
36
+
type: "integer",
37
+
label: "Max Results",
38
+
description: "The maximum number of results to return. Defaults to 10.",
39
+
optional: true,
40
+
},
41
+
filename: {
42
+
type: "string",
43
+
label: "Filename",
44
+
description: "A filename to save the result as an xml file to the /tmp directory. Example: `arxiv-search-results.xml`",
45
+
optional: true,
46
+
},
47
+
syncDir: {
48
+
type: "dir",
49
+
accessMode: "write",
50
+
sync: true,
51
+
},
52
+
},
53
+
asyncrun({ $ }){
54
+
constresponse=awaitthis.arxiv.search({
55
+
$,
56
+
params: {
57
+
search_query: this.searchQuery,
58
+
id_list: this.idList
59
+
? this.idList.join(",")
60
+
: undefined,
61
+
start: this.start,
62
+
max_results: this.maxResults,
63
+
},
64
+
});
65
+
66
+
if(!this.filename){
67
+
$.export("$summary","Successfully searched for articles");
68
+
returnresponse;
69
+
}
70
+
71
+
constfilePath=`/tmp/${this.filename}`;
72
+
fs.writeFileSync(filePath,response,"utf8");
73
+
74
+
$.export("$summary",`Successfully saved search results to ${filePath}`);
0 commit comments