@qzhike/agent-search 1.0.1 → 1.0.2

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 CHANGED
@@ -27,7 +27,16 @@ openclaw plugins install --link /absolute/path/to/qzhike-agent-search
27
27
 
28
28
  ## OpenClaw 配置
29
29
 
30
- ### 启用插件与工具
30
+ ### `searchMode`:fallback 与 concurrent
31
+
32
+ | 模式 | 行为 |
33
+ |---|---|
34
+ | **`fallback`**(默认) | 按 **`fallback`** 数组顺序线性尝试,首个有有效结果的 provider 胜出 |
35
+ | **`concurrent`** | 按 **`concurrent`** 列表并行调用,最多 **`concurrentMaxProviders`** 路,合并去重结果 |
36
+
37
+ 可同时保留 **`fallback`** 与 **`concurrent`** 数组以便切换 **`searchMode`**(可选);下方示例各只展示该模式所需字段。单次 **`qzhike_search`** 仍可用参数 **`searchMode`** / **`provider`** 覆盖 config。
38
+
39
+ ### fallback 模式(串行)
31
40
 
32
41
  ```json5
33
42
  {
@@ -62,7 +71,66 @@ openclaw plugins install --link /absolute/path/to/qzhike-agent-search
62
71
  }
63
72
  ```
64
73
 
65
- `~/.openclaw/.env` 中设置 `DEEPROUTE_CONSOLE_URL`、`DEEPROUTE_API_KEY` 等占位符。更完整的 DeepRoute 全 provider 模板见开源仓库 **`examples/openclaw.config.json5`**(npm 包内不含该文件)。
74
+ ### concurrent 模式(并行)
75
+
76
+ 与 fallback 共用 **`providers`** 与 **`.env`**;将 **`searchMode`** 改为 **`"concurrent"`**,并配置 **`concurrent`** / **`concurrentMaxProviders`**:
77
+
78
+ ```json5
79
+ {
80
+ plugins: {
81
+ allow: ["qzhike-agent-search"],
82
+ entries: {
83
+ "qzhike-agent-search": {
84
+ enabled: true,
85
+ config: {
86
+ searchMode: "concurrent",
87
+ concurrent: ["ragflow", "brave", "tavily"],
88
+ concurrentMaxProviders: 3,
89
+ providers: {
90
+ ragflow: {
91
+ auth: "deeproute",
92
+ baseUrl: "${DEEPROUTE_CONSOLE_URL}",
93
+ apiKey: "${DEEPROUTE_API_KEY}",
94
+ },
95
+ brave: {
96
+ auth: "deeproute",
97
+ baseUrl: "${DEEPROUTE_CONSOLE_URL}",
98
+ apiKey: "${DEEPROUTE_API_KEY}",
99
+ },
100
+ tavily: {
101
+ auth: "deeproute",
102
+ baseUrl: "${DEEPROUTE_CONSOLE_URL}",
103
+ apiKey: "${DEEPROUTE_API_KEY}",
104
+ },
105
+ },
106
+ },
107
+ },
108
+ },
109
+ },
110
+ tools: {
111
+ allow: ["qzhike_search", "qzhike_read_url"],
112
+ deny: ["web_search"],
113
+ },
114
+ }
115
+ ```
116
+
117
+ 合并进现有 **`openclaw.json`** 时勿整文件覆盖(保留 **`models`** 等大模型配置)。若已有 **`tools.profile`**,可用 **`tools.alsoAllow`** 追加两个工具名。
118
+
119
+ 在 `~/.openclaw/.env` 中设置占位符(**origin only**,无尾斜杠、**不含 `/api/v1`**):
120
+
121
+ ```bash
122
+ DEEPROUTE_CONSOLE_URL=http://<console-host>:20316
123
+ DEEPROUTE_API_KEY=sk-...
124
+ ```
125
+
126
+ **`baseUrl` 约定**(插值后由插件使用):
127
+
128
+ | Provider | `openclaw.json` 中 `baseUrl` |
129
+ |---|---|
130
+ | `auth: "deeproute"`(ragflow、brave、…) | `"${DEEPROUTE_CONSOLE_URL}"` → Console **`/api/mirror/{provider}/…`** |
131
+ | **`kimi`**(无 `auth`,不走 mirror) | **`"${DEEPROUTE_CONSOLE_URL}/api/v1"`** → **`/api/v1/chat/completions`** |
132
+
133
+ 更完整的 DeepRoute 全 provider 模板见开源仓库 **`examples/openclaw.config.json5`**(npm 包内不含该文件)。
66
134
 
67
135
  ### DeepRoute 扩展服务(凭据托管)
68
136
 
@@ -2,7 +2,7 @@
2
2
  "id": "qzhike-agent-search",
3
3
  "name": "Qzhike Agent Search",
4
4
  "description": "Multi-backend search (RAGFlow KB, Serper, Metaso, Zhipu, Exa, SearXNG, Kimi, Brave, Tavily, Jina, MiniMax) with fallback/concurrent modes, plus Jina Reader URL fetch. DeepRoute mirror support.",
5
- "version": "1.0.1",
5
+ "version": "1.0.2",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qzhike/agent-search",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Agent search plugin (OpenClaw-first): multi-backend search with RAGFlow KB, fallback/concurrent modes, Jina Reader read URL, and DeepRoute mirror support.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -7,8 +7,9 @@ description: >-
7
7
  metadata: {"openclaw":{}}
8
8
  ---
9
9
 
10
- > **本 Skill 随 npm 插件 `@qzhike/agent-search` 交付**:在 **`openclaw.plugin.json`** 中声明 **`skills/qzhike-agent-search`**,启用插件后 Gateway 自动加载(无需 symlink 到 **`~/.openclaw/skills/`**)。
11
- > 安装与配置见包内 **`README.md`**;插件 config 路径:**`plugins.entries.qzhike-agent-search.config`**。
10
+ > **本 Skill 随 npm 插件 `@qzhike/agent-search` 交付**:在 **`openclaw.plugin.json`** 中声明 **`skills/qzhike-agent-search`**,启用插件后 Gateway 自动加载(无需 symlink 到 **`~/.openclaw/skills/`**)。
11
+ > 完整安装、扩展服务映射与全 provider 模板见包内 **`README.md`** / 仓库 **`examples/openclaw.config.json5`**。
12
+ > 插件 config 路径:**`plugins.entries.qzhike-agent-search.config`**(OpenClaw 解析 `${ENV}`;**插件不读** `process.env`)。
12
13
 
13
14
  # 检索与读页工作流(原生工具)
14
15
 
@@ -25,6 +26,79 @@ metadata: {"openclaw":{}}
25
26
 
26
27
  ---
27
28
 
29
+ ## DeepRoute 配置速查(运维)
30
+
31
+ ### `~/.openclaw/.env`
32
+
33
+ ```bash
34
+ # Console API origin:无尾斜杠,不含 /api/v1
35
+ DEEPROUTE_CONSOLE_URL=http://<console-host>:20316
36
+ DEEPROUTE_API_KEY=sk-<New-API-用户令牌>
37
+ ```
38
+
39
+ ### `providers.*.baseUrl` 与 env 的关系
40
+
41
+ | Provider 类型 | `openclaw.json` 写法 | 实际 HTTP 前缀 |
42
+ |---|---|---|
43
+ | **`auth: "deeproute"`**(ragflow、brave、jina、…) | `baseUrl: "${DEEPROUTE_CONSOLE_URL}"` | `{origin}/api/mirror/{provider}/…` |
44
+ | **`kimi`(无 auth 字段)** | `baseUrl: "${DEEPROUTE_CONSOLE_URL}/api/v1"` | `{origin}/api/v1/chat/completions` |
45
+
46
+ **仅 kimi** 在 config 里拼接 **`/api/v1`**;**不要**把 `/api/v1` 写进 `.env` 的 `DEEPROUTE_CONSOLE_URL`(否则 kimi 路径会变成 `…/api/v1/api/v1/…`)。
47
+
48
+ ### 最小可运行片段(DeepRoute)
49
+
50
+ 合并进现有 **`openclaw.json`**(勿整文件覆盖;保留 **`models`** 等大模型配置):
51
+
52
+ ```json5
53
+ {
54
+ plugins: {
55
+ allow: ["qzhike-agent-search"],
56
+ entries: {
57
+ "qzhike-agent-search": {
58
+ enabled: true,
59
+ config: {
60
+ searchMode: "concurrent",
61
+ concurrent: ["ragflow", "brave", "kimi"],
62
+ concurrentMaxProviders: 3,
63
+ providers: {
64
+ ragflow: {
65
+ auth: "deeproute",
66
+ baseUrl: "${DEEPROUTE_CONSOLE_URL}",
67
+ apiKey: "${DEEPROUTE_API_KEY}",
68
+ },
69
+ kimi: {
70
+ baseUrl: "${DEEPROUTE_CONSOLE_URL}/api/v1",
71
+ apiKey: "${DEEPROUTE_API_KEY}",
72
+ model: "kimi-k2.6",
73
+ },
74
+ brave: {
75
+ auth: "deeproute",
76
+ baseUrl: "${DEEPROUTE_CONSOLE_URL}",
77
+ apiKey: "${DEEPROUTE_API_KEY}",
78
+ },
79
+ },
80
+ },
81
+ },
82
+ },
83
+ },
84
+ tools: {
85
+ allow: ["qzhike_search", "qzhike_read_url"],
86
+ deny: ["web_search"],
87
+ },
88
+ }
89
+ ```
90
+
91
+ 若已有 **`tools.profile`**(如 `coding`),改用 **`tools.alsoAllow`** 追加 `qzhike_search` / `qzhike_read_url`,勿仅用窄 **`tools.allow`** 覆盖默认工具集。
92
+
93
+ 改 **`~/.openclaw/.env`** 或插件 config 后:**`openclaw gateway restart`**。
94
+
95
+ ### RAGFlow(deeproute)
96
+
97
+ - Console **扩展服务**入库:`ragflow_base_url`、`ragflow`、`ragflow_dataset_ids`。
98
+ - 插件 config **勿写** `datasetIds`;检索走 **`qzhike_search`** + provider **`ragflow`**。
99
+
100
+ ---
101
+
28
102
  ## Agent 必须遵守的顺序
29
103
 
30
104
  ```
@@ -86,5 +160,5 @@ Skill 管流程与工具选择;TOOLS.md 强化调用顺序。
86
160
 
87
161
  ## 延伸阅读
88
162
 
89
- - 包内 **`README.md`**:安装、DeepRoute 扩展服务映射、配置示例。
90
- - 仓库 **`examples/openclaw.config.json5`**:完整 fallback / concurrent 与全 provider 模板。
163
+ - 包内 **`README.md`**:安装、DeepRoute 扩展服务映射、全 provider 配置与 fallback/concurrent 模板。
164
+ - 仓库 **`examples/openclaw.config.json5`**:完整 JSON5 示例(npm 包内不含该文件,见开源仓库)。