@klarkxy/dsh-zhihu 0.2.6 → 0.2.8
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 +18 -11
- package/docs/README.zh-CN.md +14 -7
- package/lib/client.js +447 -86
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2426 -1
- package/lib/index.js.map +1 -1
- package/lib/tools.js +188 -0
- package/lib/tools.js.map +1 -1
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[简体中文](docs/README.zh-CN.md)
|
|
6
6
|
|
|
7
|
-
Use Zhihu as a research source for the model: site search, web search,
|
|
7
|
+
Use Zhihu as a research source for the model: site search, web search, hot list, Zhida answers, knowledge bases, question discovery, and creator statistics. The `zhihu_sync` tool also saves and validates article, question, or pin drafts and uploads images. Every request uses your own Zhihu Access Secret; results are reference material, not conclusions.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -16,32 +16,37 @@ Replace `web` with your profile name and restart DSH Web. Use the full scoped na
|
|
|
16
16
|
|
|
17
17
|
## Use
|
|
18
18
|
|
|
19
|
-
Open **Plugins → Zhihu** and enter your Access Secret under **Settings**.
|
|
19
|
+
Open **Plugins → Zhihu** and enter your Access Secret under **Settings**. Other tabs:
|
|
20
20
|
|
|
21
|
-
- **Stats**: local daily calls, failures, and
|
|
22
|
-
- **Official quota**:
|
|
21
|
+
- **Stats**: local daily calls, failures, and result counts;
|
|
22
|
+
- **Official quota**: remaining free allowance as reported by Zhihu;
|
|
23
23
|
- **Knowledge base**: upload and search reference files;
|
|
24
|
-
- **Test**: run any search or query by hand.
|
|
24
|
+
- **Test**: run any search or query by hand, expand an answer's reasoning, and inspect or copy structured response data.
|
|
25
25
|
|
|
26
26
|
With the Web Search plugin installed, Zhihu web search also appears in its provider list.
|
|
27
27
|
|
|
28
|
+
## Drafts and media
|
|
29
|
+
|
|
30
|
+
In **Plugins → Zhihu → Settings**, configure the publishing App Key and App Secret obtained from the [Zhihu publishing assistant](https://www.zhihu.com/playground/zhihu-publisher). These are separate from the search Access Secret. Zhihu’s authorization text can be pasted into the App Secret field when both credentials appear as `ZHIHU_OPENAPI_APP_KEY:"…"` and `ZHIHU_OPENAPI_APP_SECRET:"…"`; the plugin then keeps those two values only. The `zhihu_sync` tool then lets the model save, list, read, and validate drafts for articles, questions, or pins, and upload images for them. Drafts persist across DSH restarts. This version has no publishing interface: neither the model nor the plugin UI can publish a draft.
|
|
31
|
+
|
|
28
32
|
## Give the tools to the model
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
These model tools are enabled by default; no agent preset changes needed:
|
|
31
35
|
|
|
32
36
|
| Tool | Purpose |
|
|
33
37
|
| --- | --- |
|
|
34
38
|
| `zhihu_search`, `zhihu_global_search`, `zhihu_hot_list` | Zhihu search, web search, hot list |
|
|
35
|
-
| `zhihu_ask` | Zhida AI answers
|
|
39
|
+
| `zhihu_ask` | Zhida AI answers from Zhihu content |
|
|
36
40
|
| `zhihu_knowledge_search` | Search knowledge bases |
|
|
37
41
|
| `zhihu_question_recommendations`, `zhihu_question_answers` | Find questions and read answer summaries |
|
|
38
|
-
| `zhihu_user_content_detail`, `zhihu_user_content_comments` | Read your
|
|
42
|
+
| `zhihu_user_content_detail`, `zhihu_user_content_comments` | Read your published content and its comments |
|
|
39
43
|
| `zhihu_creator_account_stats`, `zhihu_creator_content_stats` | Your creator statistics |
|
|
40
44
|
| `zhihu_quota` | Check official quota |
|
|
45
|
+
| `zhihu_sync` | Save, list, read, and validate drafts or upload images |
|
|
41
46
|
|
|
42
47
|
## Cost protection
|
|
43
48
|
|
|
44
|
-
By default
|
|
49
|
+
By default research requests use only Zhihu's free allowance: before each request the plugin checks the official quota and skips the request if none is left. It also stops after 100 requests per day (Beijing time). Both are configurable:
|
|
45
50
|
|
|
46
51
|
```yaml
|
|
47
52
|
config:
|
|
@@ -54,9 +59,11 @@ Paid use is allowed only when you set `allowPaid: true` yourself.
|
|
|
54
59
|
## Limits
|
|
55
60
|
|
|
56
61
|
- Zero cost is not guaranteed: other clients on the same account can use up the free allowance first.
|
|
57
|
-
-
|
|
62
|
+
- Knowledge-base uploads are stored on Zhihu's servers and limited to 20 MB per file. Draft images are also uploaded to Zhihu.
|
|
63
|
+
- Drafts support articles, questions, and pins, not answers or videos. Supported images: JPEG, PNG, GIF, WebP, and BMP; GIF is limited to 15 MB and other images to 30 MB. Convert HEIC/AVIF before uploading.
|
|
64
|
+
- Draft and image operations use Zhihu's publishing authorization; search quota and paid-search settings do not govern them.
|
|
58
65
|
- Requests are never retried automatically.
|
|
59
|
-
- Not included: OAuth account switching, top-ups, or wallet queries.
|
|
66
|
+
- Not included: publishing drafts, OAuth account switching, top-ups, or wallet queries.
|
|
60
67
|
|
|
61
68
|
## License
|
|
62
69
|
|
package/docs/README.zh-CN.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[English](../README.md)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
把知乎交给模型当调研信源:站内搜索、全网搜索、热榜、知乎直答、知识库、问题发现和创作数据。`zhihu_sync` 工具还可以保存、校验文章、提问或想法草稿并上传配图。每次请求只用你自己的知乎 Access Secret;结果是参考资料,不是定论。
|
|
8
8
|
|
|
9
9
|
## 安装
|
|
10
10
|
|
|
@@ -21,13 +21,17 @@ dsh plugin --profile web add @klarkxy/dsh-zhihu
|
|
|
21
21
|
- **统计**:本机记录的每日调用、失败和结果条数;
|
|
22
22
|
- **官方用量**:知乎返回的剩余免费额度;
|
|
23
23
|
- **知识库**:上传并检索参考文件;
|
|
24
|
-
-
|
|
24
|
+
- **测试**:手动执行各类搜索和查询,展开直答的思考过程,查看或复制结构化返回数据。
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
安装网页搜索插件后,「知乎全网搜索」也会出现在它的服务列表中。
|
|
27
|
+
|
|
28
|
+
## 草稿与配图
|
|
29
|
+
|
|
30
|
+
在「插件 → 知乎 → 设置」填写发布用 App Key 和 App Secret,可从[知乎同步助手](https://www.zhihu.com/playground/zhihu-publisher)申请;它们与检索 Access Secret 分开配置。知乎的授权说明可以整段粘进 App Secret 输入框,条件是两项凭据都写成 `ZHIHU_OPENAPI_APP_KEY:"…"` 与 `ZHIHU_OPENAPI_APP_SECRET:"…"` 的形式;插件只保存其中的两项凭据。`zhihu_sync` 工具随后可让模型保存、列出、读取并校验文章、提问或想法草稿,并为其上传配图;草稿在重启 DSH 后仍可继续处理。本版本没有发布入口:模型与插件界面都不能发布草稿。
|
|
27
31
|
|
|
28
32
|
## 让模型使用
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
以下模型工具默认启用,无需修改 Agent 预设:
|
|
31
35
|
|
|
32
36
|
| 工具 | 用途 |
|
|
33
37
|
| --- | --- |
|
|
@@ -38,10 +42,11 @@ dsh plugin --profile web add @klarkxy/dsh-zhihu
|
|
|
38
42
|
| `zhihu_user_content_detail`、`zhihu_user_content_comments` | 读取自己已发布的内容及评论 |
|
|
39
43
|
| `zhihu_creator_account_stats`、`zhihu_creator_content_stats` | 自己的创作数据 |
|
|
40
44
|
| `zhihu_quota` | 查询官方额度 |
|
|
45
|
+
| `zhihu_sync` | 保存、列出、读取并校验草稿,上传配图 |
|
|
41
46
|
|
|
42
47
|
## 费用保护
|
|
43
48
|
|
|
44
|
-
|
|
49
|
+
检索与创作查询默认只用知乎的免费额度:每次请求前先查官方额度,额度不足就不发送。另外每天(北京时间)最多 100 次请求。两项都可在插件配置中修改:
|
|
45
50
|
|
|
46
51
|
```yaml
|
|
47
52
|
config:
|
|
@@ -54,9 +59,11 @@ config:
|
|
|
54
59
|
## 限制
|
|
55
60
|
|
|
56
61
|
- 不能保证绝对零费用:同一账号的其他客户端可能先用掉免费额度。
|
|
57
|
-
-
|
|
62
|
+
- 知识库文件保存在知乎云端,单个文件最大 20 MB;草稿配图也会上传到知乎。
|
|
63
|
+
- 草稿支持文章、提问和想法,不支持回答或视频。图片支持 JPEG、PNG、GIF、WebP、BMP;GIF 最大 15 MB,其他图片最大 30 MB。HEIC/AVIF 请先转换格式。
|
|
64
|
+
- 草稿与图片操作使用知乎提供的发布授权;搜索额度与付费搜索开关不控制它们。
|
|
58
65
|
- 所有请求都不会自动重试。
|
|
59
|
-
-
|
|
66
|
+
- 不提供草稿发布、OAuth 账号切换、充值或钱包查询。
|
|
60
67
|
|
|
61
68
|
## 许可证
|
|
62
69
|
|