ai4scholar 0.6.2 → 0.6.4
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/README.md +0 -6
- package/dist/index.js +4 -4
- package/package.json +1 -8
package/README.md
CHANGED
|
@@ -113,12 +113,6 @@ AI4Scholar gives your OpenClaw agent direct access to **6 academic platforms** t
|
|
|
113
113
|
openclaw plugins install ai4scholar
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
-
### From GitHub
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
openclaw plugins install github:literaf/ai4scholar
|
|
120
|
-
```
|
|
121
|
-
|
|
122
116
|
After installation, **restart the gateway**:
|
|
123
117
|
|
|
124
118
|
```bash
|
package/dist/index.js
CHANGED
|
@@ -24822,7 +24822,7 @@ function createSciDrawTool() {
|
|
|
24822
24822
|
return {
|
|
24823
24823
|
label: "Scientific Drawing",
|
|
24824
24824
|
name: "sci_draw",
|
|
24825
|
-
description: "Generate or process scientific figures using AI. Actions: 'smart' (auto-optimize prompt, supports Chinese), 'generate' (text-to-image), 'edit' (modify existing image), 'style' (style transfer), 'compose' (combine multiple images), 'iterate' (auto-review and refine), 'critic' (expert review, returns text), 'svg' (generate SVG vector graphics). Models: 'flash' (fast), 'flash31' (balanced, default), 'pro' (high quality). Returns image URL or SVG code.",
|
|
24825
|
+
description: "Generate or process scientific figures using AI. IMPORTANT: Image generation takes 30-60 seconds. You MUST tell the user '\u6B63\u5728\u751F\u6210\u79D1\u7814\u56FE\u7247\uFF0C\u5927\u7EA6\u9700\u8981 30-60 \u79D2\uFF0C\u8BF7\u7A0D\u5019...' BEFORE calling this tool, so the user knows to wait. Actions: 'smart' (auto-optimize prompt, supports Chinese, recommended), 'generate' (text-to-image), 'edit' (modify existing image), 'style' (style transfer), 'compose' (combine multiple images), 'iterate' (auto-review and refine), 'critic' (expert review, returns text), 'svg' (generate SVG vector graphics). Models: 'flash' (fast), 'flash31' (balanced, default), 'pro' (high quality). Returns image URL or SVG code. After receiving the result, display the imageUrl as an image to the user.",
|
|
24826
24826
|
parameters: Type.Object({
|
|
24827
24827
|
action: Type.String({
|
|
24828
24828
|
description: "Operation type: 'smart', 'generate', 'edit', 'style', 'compose', 'iterate', 'critic', 'svg'",
|
|
@@ -24898,9 +24898,9 @@ function createSciDrawTool() {
|
|
|
24898
24898
|
}
|
|
24899
24899
|
let data = await res.json();
|
|
24900
24900
|
if (!data.success)
|
|
24901
|
-
return Result.err("generation_failed", "Image generation failed");
|
|
24901
|
+
return Result.err("generation_failed", "Image generation failed. Credits have been refunded automatically.");
|
|
24902
24902
|
let result = { action };
|
|
24903
|
-
return data.imageUrl
|
|
24903
|
+
return data.imageUrl ? result.imageUrl = data.imageUrl : action !== "critic" && action !== "svg" && (result.warning = "Image was generated but imageUrl is empty. This may be a transient issue \u2014 please retry."), data.svgCode && (result.svgCode = data.svgCode), data.svgUrl && (result.svgUrl = data.svgUrl), data.optimizedPrompt && (result.optimizedPrompt = data.optimizedPrompt), data.critique && (result.critique = data.critique), data.creditCost !== void 0 && (result.creditCost = data.creditCost), Result.ok(result);
|
|
24904
24904
|
} catch (e) {
|
|
24905
24905
|
return Result.err("request_failed", e instanceof Error ? e.message : String(e));
|
|
24906
24906
|
}
|
|
@@ -24990,7 +24990,7 @@ function handleReadingList(_ctx) {
|
|
|
24990
24990
|
}
|
|
24991
24991
|
|
|
24992
24992
|
// src/hooks/scholar-mode.ts
|
|
24993
|
-
var SCHOLAR_MODE_PROMPT =
|
|
24993
|
+
var SCHOLAR_MODE_PROMPT = '[AI4Scholar] You have 36 academic tools covering Semantic Scholar, PubMed, Google Scholar, arXiv, bioRxiv, and medRxiv. Capabilities: search, paper detail, citations, references, author lookup, recommendations, snippet search, batch queries, title matching, bulk search, PDF download, full-text reading, DOI-based paper download (institutional access), auto-citation (auto_cite tool), and scientific figure generation (sci_draw tool). For paper search or literature questions, call the search tools directly and respond in Markdown. When the user pastes academic text and asks to add citations/references, call the auto_cite tool directly. When the user asks to create scientific figures or diagrams, call the sci_draw tool \u2014 IMPORTANT: always tell the user "\u6B63\u5728\u751F\u6210\u79D1\u7814\u56FE\u7247\uFF0C\u5927\u7EA6\u9700\u8981 30-60 \u79D2\uFF0C\u8BF7\u7A0D\u5019..." BEFORE calling sci_draw, because image generation takes time and the user needs to know to wait. After sci_draw returns, display the imageUrl as an image to the user.';
|
|
24994
24994
|
function createScholarModeHook() {
|
|
24995
24995
|
return (event, _context) => !event.messages || event.messages.length === 0 ? { prependContext: SCHOLAR_MODE_PROMPT } : {};
|
|
24996
24996
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai4scholar",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "Multi-source academic literature search, management, and analysis plugin for OpenClaw. Powered by ai4scholar.net.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -24,13 +24,6 @@
|
|
|
24
24
|
"author": "ai4scholar",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"homepage": "https://ai4scholar.net?src=openclaw",
|
|
27
|
-
"repository": {
|
|
28
|
-
"type": "git",
|
|
29
|
-
"url": "https://github.com/literaf/ai4scholar.git"
|
|
30
|
-
},
|
|
31
|
-
"bugs": {
|
|
32
|
-
"url": "https://github.com/literaf/ai4scholar/issues"
|
|
33
|
-
},
|
|
34
27
|
"scripts": {
|
|
35
28
|
"build": "node esbuild.config.mjs",
|
|
36
29
|
"build:tsc": "tsc --noEmit",
|