entari-plugin-hyw 3.3.6__py3-none-any.whl → 3.3.7__py3-none-any.whl
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.
Potentially problematic release.
This version of entari-plugin-hyw might be problematic. Click here for more details.
- entari_plugin_hyw/core/pipeline.py +50 -26
- entari_plugin_hyw/core/render.py +27 -0
- entari_plugin_hyw-3.3.7.dist-info/METADATA +142 -0
- {entari_plugin_hyw-3.3.6.dist-info → entari_plugin_hyw-3.3.7.dist-info}/RECORD +6 -6
- entari_plugin_hyw-3.3.6.dist-info/METADATA +0 -143
- {entari_plugin_hyw-3.3.6.dist-info → entari_plugin_hyw-3.3.7.dist-info}/WHEEL +0 -0
- {entari_plugin_hyw-3.3.6.dist-info → entari_plugin_hyw-3.3.7.dist-info}/top_level.txt +0 -0
|
@@ -647,12 +647,7 @@ class ProcessingPipeline:
|
|
|
647
647
|
except Exception:
|
|
648
648
|
pass
|
|
649
649
|
|
|
650
|
-
# 2.
|
|
651
|
-
ref_block_match = re.search(r'```references\s*(.*?)\s*```', remaining_text, re.DOTALL | re.IGNORECASE)
|
|
652
|
-
if ref_block_match:
|
|
653
|
-
remaining_text = remaining_text.replace(ref_block_match.group(0), "").strip()
|
|
654
|
-
|
|
655
|
-
# 3. Scan text for [type:id] tags and rebuild references in order of appearance
|
|
650
|
+
# 2. Extract references from text first (Order by appearance)
|
|
656
651
|
# Pattern matches [search:123], [page:123], [image:123]
|
|
657
652
|
pattern = re.compile(r'\[(search|page|image):(\d+)\]', re.IGNORECASE)
|
|
658
653
|
|
|
@@ -662,24 +657,12 @@ class ProcessingPipeline:
|
|
|
662
657
|
page_map = {}
|
|
663
658
|
image_map = {}
|
|
664
659
|
|
|
665
|
-
|
|
666
|
-
tag_type = m.group(1).lower()
|
|
667
|
-
old_id_str = m.group(2)
|
|
668
|
-
try:
|
|
669
|
-
old_id = int(old_id_str)
|
|
670
|
-
except ValueError:
|
|
671
|
-
continue
|
|
672
|
-
|
|
673
|
-
# Check if we already processed this ID for this type
|
|
674
|
-
if tag_type == "search" and old_id_str in search_map: continue
|
|
675
|
-
if tag_type == "page" and old_id_str in page_map: continue
|
|
676
|
-
if tag_type == "image" and old_id_str in image_map: continue
|
|
677
|
-
|
|
660
|
+
def process_ref(tag_type, old_id):
|
|
678
661
|
# Find in all_web_results
|
|
679
662
|
result_item = next((r for r in self.all_web_results if r.get("_id") == old_id and r.get("_type") == tag_type), None)
|
|
680
663
|
|
|
681
664
|
if not result_item:
|
|
682
|
-
|
|
665
|
+
return
|
|
683
666
|
|
|
684
667
|
entry = {
|
|
685
668
|
"title": result_item.get("title", ""),
|
|
@@ -690,15 +673,56 @@ class ProcessingPipeline:
|
|
|
690
673
|
entry["thumbnail"] = result_item.get("thumbnail", "")
|
|
691
674
|
|
|
692
675
|
# Add to respective list and map
|
|
676
|
+
# Check maps to avoid duplicates
|
|
693
677
|
if tag_type == "search":
|
|
694
|
-
|
|
695
|
-
|
|
678
|
+
if str(old_id) not in search_map:
|
|
679
|
+
parsed["references"].append(entry)
|
|
680
|
+
search_map[str(old_id)] = len(parsed["references"])
|
|
696
681
|
elif tag_type == "page":
|
|
697
|
-
|
|
698
|
-
|
|
682
|
+
if str(old_id) not in page_map:
|
|
683
|
+
parsed["page_references"].append(entry)
|
|
684
|
+
page_map[str(old_id)] = len(parsed["page_references"])
|
|
699
685
|
elif tag_type == "image":
|
|
700
|
-
|
|
701
|
-
|
|
686
|
+
if str(old_id) not in image_map:
|
|
687
|
+
parsed["image_references"].append(entry)
|
|
688
|
+
image_map[str(old_id)] = len(parsed["image_references"])
|
|
689
|
+
|
|
690
|
+
# Pass 1: Text Body
|
|
691
|
+
for m in matches:
|
|
692
|
+
try:
|
|
693
|
+
process_ref(m.group(1).lower(), int(m.group(2)))
|
|
694
|
+
except ValueError:
|
|
695
|
+
continue
|
|
696
|
+
|
|
697
|
+
# 3. Pass 2: References Block (Capture items missed in text)
|
|
698
|
+
ref_block_match = re.search(r'```references\s*(.*?)\s*```', remaining_text, re.DOTALL | re.IGNORECASE)
|
|
699
|
+
if ref_block_match:
|
|
700
|
+
ref_content = ref_block_match.group(1).strip()
|
|
701
|
+
remaining_text = remaining_text.replace(ref_block_match.group(0), "").strip()
|
|
702
|
+
|
|
703
|
+
for line in ref_content.split("\n"):
|
|
704
|
+
line = line.strip()
|
|
705
|
+
if not line: continue
|
|
706
|
+
# Match [id] [type]
|
|
707
|
+
# e.g. [1] [image] ... or [image:1] ...
|
|
708
|
+
|
|
709
|
+
# Check for [id] [type] format
|
|
710
|
+
id_match = re.match(r"^\[(\d+)\]\s*\[(search|page|image)\]", line, re.IGNORECASE)
|
|
711
|
+
if id_match:
|
|
712
|
+
try:
|
|
713
|
+
process_ref(id_match.group(2).lower(), int(id_match.group(1)))
|
|
714
|
+
except ValueError:
|
|
715
|
+
pass
|
|
716
|
+
else:
|
|
717
|
+
# Check for [type:id] format in list
|
|
718
|
+
alt_match = re.match(r"^\[(search|page|image):(\d+)\]", line, re.IGNORECASE)
|
|
719
|
+
if alt_match:
|
|
720
|
+
try:
|
|
721
|
+
process_ref(alt_match.group(1).lower(), int(alt_match.group(2)))
|
|
722
|
+
except ValueError:
|
|
723
|
+
pass
|
|
724
|
+
|
|
725
|
+
# 4. Replace tags in text with new sequential IDs
|
|
702
726
|
|
|
703
727
|
# 4. Replace tags in text with new sequential IDs
|
|
704
728
|
def replace_tag(match):
|
entari_plugin_hyw/core/render.py
CHANGED
|
@@ -441,6 +441,33 @@ class ContentRenderer:
|
|
|
441
441
|
**stage_children # Merge children
|
|
442
442
|
})
|
|
443
443
|
|
|
444
|
+
# Ensure references are displayed even if no "Search" stage was present
|
|
445
|
+
has_search_stage = any(s.get("name") == "Search" for s in processed_stages)
|
|
446
|
+
if not has_search_stage and (processed_refs or processed_image_refs):
|
|
447
|
+
# Create a virtual Search stage
|
|
448
|
+
virtual_search = {
|
|
449
|
+
"name": "Search",
|
|
450
|
+
"model": "DuckDuckGo", # Default assumption
|
|
451
|
+
"model_short": "DuckDuckGo",
|
|
452
|
+
"provider": "Reference",
|
|
453
|
+
"icon_html": SEARCH_ICON,
|
|
454
|
+
"time_str": "0.00s",
|
|
455
|
+
"cost_str": "$0",
|
|
456
|
+
}
|
|
457
|
+
if processed_refs:
|
|
458
|
+
virtual_search['references'] = processed_refs
|
|
459
|
+
if processed_image_refs:
|
|
460
|
+
virtual_search['image_references'] = processed_image_refs
|
|
461
|
+
|
|
462
|
+
# Insert after Vision/Instruct (usually index 0 or 1), or at start
|
|
463
|
+
insert_idx = 0
|
|
464
|
+
if processed_stages and processed_stages[0]["name"] in ["Vision", "Instruct"]:
|
|
465
|
+
insert_idx = 1
|
|
466
|
+
if len(processed_stages) > 1 and processed_stages[1]["name"] == "Instruct":
|
|
467
|
+
insert_idx = 2
|
|
468
|
+
|
|
469
|
+
processed_stages.insert(insert_idx, virtual_search)
|
|
470
|
+
|
|
444
471
|
# 4. Stats Footer Logic
|
|
445
472
|
processed_stats = {}
|
|
446
473
|
stats_dict = {}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: entari_plugin_hyw
|
|
3
|
+
Version: 3.3.7
|
|
4
|
+
Summary: Use large language models to interpret chat messages
|
|
5
|
+
Author-email: kumoSleeping <zjr2992@outlook.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/kumoSleeping/entari-plugin-hyw
|
|
8
|
+
Project-URL: Repository, https://github.com/kumoSleeping/entari-plugin-hyw
|
|
9
|
+
Project-URL: Issue Tracker, https://github.com/kumoSleeping/entari-plugin-hyw/issues
|
|
10
|
+
Keywords: entari,llm,ai,bot,chat
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
Requires-Dist: arclet-entari[full]>=0.16.5
|
|
20
|
+
Requires-Dist: openai
|
|
21
|
+
Requires-Dist: httpx
|
|
22
|
+
Requires-Dist: markdown>=3.10
|
|
23
|
+
Requires-Dist: crawl4ai>=0.7.8
|
|
24
|
+
Requires-Dist: jinja2>=3.0
|
|
25
|
+
Requires-Dist: ddgs>=9.10.0
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: entari-plugin-server>=0.5.0; extra == "dev"
|
|
28
|
+
Requires-Dist: satori-python-adapter-onebot11>=0.2.5; extra == "dev"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# Entari Plugin HYW
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
[](https://badge.fury.io/py/entari-plugin-hyw)
|
|
35
|
+
[](https://opensource.org/licenses/MIT)
|
|
36
|
+
[](https://pypi.org/project/entari-plugin-hyw/)
|
|
37
|
+
|
|
38
|
+
**Entari Plugin HYW** is an advanced agentic chat plugin for the [Entari](https://github.com/entari-org/entari) framework. It leverages Large Language Models (LLMs) to provide intelligent, context-aware, and multi-modal responses within instant messaging environments (OneBot 11, Satori).
|
|
39
|
+
|
|
40
|
+
**Entari Plugin HYW** 是 Entari 框架的高级智能体聊天插件。它利用大语言模型(LLM)在即时通讯环境(OneBot 11, Satori)中提供智能、上下文感知和多模态的回复体验。
|
|
41
|
+
|
|
42
|
+
The plugin implements a three-stage pipeline (**Vision**, **Instruct**, **Agent**) to autonomously decide when to search the web, crawl pages, or analyze images to answer user queries effectively.
|
|
43
|
+
|
|
44
|
+
插件实现了三阶段流水线(**视觉**、**指令**、**代理**),能够自主决定何时搜索网络、抓取网页或分析图片,从而高效地回答用户问题。
|
|
45
|
+
|
|
46
|
+
<img src="demo.jpg" width="300" />
|
|
47
|
+
|
|
48
|
+
## Features / 功能特性
|
|
49
|
+
|
|
50
|
+
- 📖 **Agentic Workflow (智能工作流)**
|
|
51
|
+
Autonomous decision-making process to search, browse, and reason.
|
|
52
|
+
具备自主决策能力,能够自动进行搜索、网页浏览和逻辑推理。
|
|
53
|
+
|
|
54
|
+
- 🎑 **Multi-Modal Support (多模态支持)**
|
|
55
|
+
Native support for image analysis using Vision Language Models (VLMs).
|
|
56
|
+
原生支持图片分析,利用视觉语言模型(VLM)理解图像内容。
|
|
57
|
+
|
|
58
|
+
- 🔍 **Web Search & Crawling (搜索与抓取)**
|
|
59
|
+
Integrated **DuckDuckGo** and **Crawl4AI** for real-time information retrieval.
|
|
60
|
+
集成 DuckDuckGo 搜索与 Crawl4AI 网页抓取,实时获取互联网信息。
|
|
61
|
+
|
|
62
|
+
- 🎨 **Rich Rendering (富媒体渲染)**
|
|
63
|
+
Responses are rendered as images containing Markdown, syntax-highlighted code, LaTeX math, and citation badges.
|
|
64
|
+
回答将渲染为包含 Markdown、代码高亮、LaTeX 公式及引用角标的精美图片。
|
|
65
|
+
|
|
66
|
+
- 🔌 **Protocol Support (多协议适配)**
|
|
67
|
+
Deep integration with OneBot 11 and Satori protocols.
|
|
68
|
+
深度适配 OneBot 11 和 Satori 协议,完美处理回复上下文与 JSON 卡片。
|
|
69
|
+
|
|
70
|
+
## Installation / 安装
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pip install entari-plugin-hyw
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Configuration / 配置
|
|
77
|
+
|
|
78
|
+
Configure the plugin in your `entari.yml`.
|
|
79
|
+
在 `entari.yml` 中进行配置。
|
|
80
|
+
|
|
81
|
+
### Minimal Configuration / 最小配置
|
|
82
|
+
|
|
83
|
+
```yaml
|
|
84
|
+
plugins:
|
|
85
|
+
entari_plugin_hyw:
|
|
86
|
+
# Trigger command / 触发指令
|
|
87
|
+
question_command: ".q"
|
|
88
|
+
|
|
89
|
+
# Main Model (Required) / 主模型(必需)
|
|
90
|
+
model_name: "google/gemini-2.0-flash-exp"
|
|
91
|
+
api_key: "your-api-key-here"
|
|
92
|
+
base_url: "https://generativelanguage.googleapis.com/v1beta/openai/"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Configuration Reference / 配置详解
|
|
96
|
+
|
|
97
|
+
| Option (选项) | Type | Default | Description (说明) |
|
|
98
|
+
| :--- | :--- | :--- | :--- |
|
|
99
|
+
| **Basic** | | | |
|
|
100
|
+
| `question_command` | `str` | `/q` | The command to trigger the bot. <br> 触发机器人的指令前缀。 |
|
|
101
|
+
| `reaction` | `bool` | `true` | React with emoji on start(now only lagrange ob extension). <br> 收到指令时是否回应表情(目前只支持拉格兰ob扩展)。 |
|
|
102
|
+
| `quote` | `bool` | `true` | Quote the user's message in reply. <br> 回复时是否引用原消息。 |
|
|
103
|
+
| **Models** | | | |
|
|
104
|
+
| `model_name` | `str` | *None* | **Required.** Main Agent model ID. <br> **必需。** 主代理模型 ID。 |
|
|
105
|
+
| `api_key` | `str` | *None* | **Required.** API key. <br> **必需。** API 密钥。 |
|
|
106
|
+
| `base_url` | `str` | `...` | OpenAI-compatible API base URL. <br> 兼容 OpenAI 的 API 地址。 |
|
|
107
|
+
| `extra_body` | `dict` | `null` | Extra parameters (e.g. `reasoning_effort`). <br> 传递给 LLM 的额外参数。 |
|
|
108
|
+
| **Specialized** | | | |
|
|
109
|
+
| `vision_model_name`| `str` | *None* | Model for images. Defaults to `model_name`. <br> 处理图片的模型,默认同主模型。 |
|
|
110
|
+
| `intruct_model_name`| `str` | *None* | Model for intent. Defaults to `model_name`. <br> 意图识别模型,默认同主模型。 |
|
|
111
|
+
| **Tools** | | | |
|
|
112
|
+
| `search_provider` | `str` | `ddgs`| `ddgs` (DuckDuckGo), `crawl4ai`, `httpx`. <br> 搜索后端提供商。 |
|
|
113
|
+
| `search_limit` | `int` | `8` | Max search results. <br> 搜索结果数量限制。 |
|
|
114
|
+
| `headless` | `bool` | `true` | Browser headless mode. <br> 浏览器无头模式。 |
|
|
115
|
+
|
|
116
|
+
## Usage / 使用方法
|
|
117
|
+
|
|
118
|
+
### Commands / 指令
|
|
119
|
+
|
|
120
|
+
- **Text Query (文本问答)**
|
|
121
|
+
```text
|
|
122
|
+
.q What's the latest news on Rust 1.83?
|
|
123
|
+
.q Rust 1.83 有什么新特性?
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
- **Image Analysis (图片分析)**
|
|
127
|
+
*(Send an image with command, or reply to an image)*
|
|
128
|
+
*(发送带图片的指令,或回复一张图片)*
|
|
129
|
+
```text
|
|
130
|
+
.q [Image] Explain this error.
|
|
131
|
+
.q [图片] 解释一下这个报错。
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
- **Follow-up (追问)**
|
|
135
|
+
*Reply to the bot's message to continue the conversation.*
|
|
136
|
+
*直接回复机器人的消息即可进行连续对话。*
|
|
137
|
+
|
|
138
|
+
-----
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
This project is licensed under the MIT License.
|
|
@@ -31,15 +31,15 @@ entari_plugin_hyw/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
31
31
|
entari_plugin_hyw/core/config.py,sha256=rN2hVI964D7eM6xPuOthEIpXyFGZpRSYNrl1xdKHJ1s,1636
|
|
32
32
|
entari_plugin_hyw/core/history.py,sha256=vqp7itwR5-KaqC4Ftmq6GOz7OM9GsiFJnSN9JJ2P6L4,5894
|
|
33
33
|
entari_plugin_hyw/core/hyw.py,sha256=RCRjV9uYmvXysiliztphLP3VyUabrf0LY2Bk66W5JGA,1927
|
|
34
|
-
entari_plugin_hyw/core/pipeline.py,sha256=
|
|
35
|
-
entari_plugin_hyw/core/render.py,sha256=
|
|
34
|
+
entari_plugin_hyw/core/pipeline.py,sha256=t1nIjQlMKqTb7wpY7Dn1rbWDD2kl8WWUnPQBY5MQO4E,49071
|
|
35
|
+
entari_plugin_hyw/core/render.py,sha256=rUhv2R5fdtsMIGg-Q1qe8hhUWC1_E50BODLA78u4_SI,28948
|
|
36
36
|
entari_plugin_hyw/utils/__init__.py,sha256=TnkxDqYr0zgRE7TC92tVbUaY8m1UyyoLg2zvzQ8nMVI,84
|
|
37
37
|
entari_plugin_hyw/utils/browser.py,sha256=LJlFh-oSqt9mQBpMALxbYGUG__t1YLUo7RxUAslsWUc,1416
|
|
38
38
|
entari_plugin_hyw/utils/misc.py,sha256=_7iHVYj_mJ6OGq6FU1s_cFeS1Ao-neBjZYd6eI2p95U,3482
|
|
39
39
|
entari_plugin_hyw/utils/playwright_tool.py,sha256=ZZNkzFtUt_Gxny3Od4boBAgNF9J0N84uySatzn1Bwe4,1272
|
|
40
40
|
entari_plugin_hyw/utils/prompts.py,sha256=oJpgNvRQ_Lmr2Ca-B6fcpysMT2i0obioBC1DuH_Z1MY,4430
|
|
41
41
|
entari_plugin_hyw/utils/search.py,sha256=Bvz2KFw3Gr2nuvmlo_8ExLHvO353NKX-YN35A2FCsBw,19047
|
|
42
|
-
entari_plugin_hyw-3.3.
|
|
43
|
-
entari_plugin_hyw-3.3.
|
|
44
|
-
entari_plugin_hyw-3.3.
|
|
45
|
-
entari_plugin_hyw-3.3.
|
|
42
|
+
entari_plugin_hyw-3.3.7.dist-info/METADATA,sha256=ZQ_HfsEQKXUPkEf2KaPSO9hPm1bYgHSfCo-GRV-f9l8,6340
|
|
43
|
+
entari_plugin_hyw-3.3.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
44
|
+
entari_plugin_hyw-3.3.7.dist-info/top_level.txt,sha256=TIDsn6XPs6KA5e3ezsE65JoXsy03ejDdrB41I4SPjmo,18
|
|
45
|
+
entari_plugin_hyw-3.3.7.dist-info/RECORD,,
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: entari_plugin_hyw
|
|
3
|
-
Version: 3.3.6
|
|
4
|
-
Summary: Use large language models to interpret chat messages
|
|
5
|
-
Author-email: kumoSleeping <zjr2992@outlook.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/kumoSleeping/entari-plugin-hyw
|
|
8
|
-
Project-URL: Repository, https://github.com/kumoSleeping/entari-plugin-hyw
|
|
9
|
-
Project-URL: Issue Tracker, https://github.com/kumoSleeping/entari-plugin-hyw/issues
|
|
10
|
-
Keywords: entari,llm,ai,bot,chat
|
|
11
|
-
Classifier: Development Status :: 3 - Alpha
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
-
Requires-Python: >=3.10
|
|
18
|
-
Description-Content-Type: text/markdown
|
|
19
|
-
Requires-Dist: arclet-entari[full]>=0.16.5
|
|
20
|
-
Requires-Dist: openai
|
|
21
|
-
Requires-Dist: httpx
|
|
22
|
-
Requires-Dist: markdown>=3.10
|
|
23
|
-
Requires-Dist: crawl4ai>=0.7.8
|
|
24
|
-
Requires-Dist: jinja2>=3.0
|
|
25
|
-
Requires-Dist: ddgs>=9.10.0
|
|
26
|
-
Provides-Extra: dev
|
|
27
|
-
Requires-Dist: entari-plugin-server>=0.5.0; extra == "dev"
|
|
28
|
-
Requires-Dist: satori-python-adapter-onebot11>=0.2.5; extra == "dev"
|
|
29
|
-
|
|
30
|
-
<div align="center">
|
|
31
|
-
|
|
32
|
-
# Entari Plugin HYW
|
|
33
|
-
|
|
34
|
-
**Entari 智能聊天解释插件**
|
|
35
|
-
|
|
36
|
-
[](https://opensource.org/licenses/MIT) [](https://pypi.org/project/entari-plugin-hyw/) [](https://www.python.org/downloads/)
|
|
37
|
-
|
|
38
|
-
*IM 环境下的 LLM 智能解释方案*
|
|
39
|
-
|
|
40
|
-
</div>
|
|
41
|
-
|
|
42
|
-
# v3.3 迎来大幅度改动、现在图文不符
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
## 🎑 效果展示
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
<div align="center">
|
|
51
|
-
<img src="demo.svg" alt="Chat Demo" width="100%">
|
|
52
|
-
</div>
|
|
53
|
-
|
|
54
|
-
## ✨ 功能特性
|
|
55
|
-
- **关于搜索**:一次性触发 Bing 网页与图片搜索,组合结果后再回应。
|
|
56
|
-
- 给予 `Alconna` 与 `MessageChain` 混合处理, 深度优化触发体验。
|
|
57
|
-
- **网页获取**:使用 Playwright 进行实时页面获取。
|
|
58
|
-
- **多模态理解**:支持图片视觉分析。
|
|
59
|
-
- **上下文感知**:维护对话历史记录,支持连续的多轮对话。
|
|
60
|
-
- `reaction` 表情, 表示任务开始。
|
|
61
|
-
- **OneBot 优化**:针对 OneBot 11 协议深度优化,支持解析 JSON 卡片、引用消息等特殊元素。
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
## 📦 安装
|
|
66
|
-
|
|
67
|
-
### 基础安装
|
|
68
|
-
```bash
|
|
69
|
-
pip install entari-plugin-hyw
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### 搜索
|
|
73
|
-
默认通过 HTTP 请求搜索引擎(DuckDuckGo,可在配置中自定义完整搜索链接,如 `https://duckduckgo.com/?q={query}`)。
|
|
74
|
-
|
|
75
|
-
## ⚙️ 配置
|
|
76
|
-
|
|
77
|
-
请在 `entari.yml` 中添加以下配置:
|
|
78
|
-
|
|
79
|
-
```yaml
|
|
80
|
-
plugins:
|
|
81
|
-
entari_plugin_hyw:
|
|
82
|
-
# --- 基础设置 ---
|
|
83
|
-
# 触发机器人的命令列表
|
|
84
|
-
command_name_list: ["zssm", "hyw"]
|
|
85
|
-
|
|
86
|
-
# 主 LLM 模型配置(必需), 如 x-ai/grok-4.1-fast:online、perplexity/sonar
|
|
87
|
-
model_name: "gx-ai/grok-4.1-fast:free"
|
|
88
|
-
api_key: "your-api-key"
|
|
89
|
-
|
|
90
|
-
# 默认 https://openrouter.ai/api/v1
|
|
91
|
-
base_url: "openai-compatible-url"
|
|
92
|
-
|
|
93
|
-
# --- 浏览器与搜索 ---
|
|
94
|
-
headless: true
|
|
95
|
-
|
|
96
|
-
# --- 视觉配置 (可选) ---
|
|
97
|
-
# 如果未设置,将回退使用主模型
|
|
98
|
-
vision_model_name: "qwen-vl-plus"
|
|
99
|
-
vision_api_key: "your-vision-api-key"
|
|
100
|
-
vision_base_url: "your-vision_base_url"
|
|
101
|
-
|
|
102
|
-
# --- openai extra_body ---
|
|
103
|
-
extra_body:
|
|
104
|
-
reasoning:
|
|
105
|
-
effort: low
|
|
106
|
-
|
|
107
|
-
# --- 交互体验 ---
|
|
108
|
-
# 是否开启表情反应 (默认: true)
|
|
109
|
-
reaction: true
|
|
110
|
-
|
|
111
|
-
# --- 调试 ---
|
|
112
|
-
save_conversation: false
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## 📖 使用方法
|
|
116
|
-
|
|
117
|
-
### 基础指令
|
|
118
|
-
使用配置的命令前缀与机器人交互:
|
|
119
|
-
|
|
120
|
-
```text
|
|
121
|
-
hyw 最近LLM有啥新闻, 是不是claude又被秒了
|
|
122
|
-
hyw [图片消息] 里面这人写代码怎么我一句都看不懂
|
|
123
|
-
hyw https://koishi.chat/ 怎么安装
|
|
124
|
-
[回复消息] hyw
|
|
125
|
-
[回复消息<[图片消息]>] hyw -t
|
|
126
|
-
[回复消息] hyw 补充: 这个rf的意思是github用户RF-Tar-Railt
|
|
127
|
-
[回复消息(hyw插件的输出)] /1 详细点描述
|
|
128
|
-
[回复消息(hyw插件的输出>] /那谁有多余解释器?
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### 选项参数
|
|
132
|
-
- `-t` / `--text`: 强制纯文本模式(跳过图片分析,节省 Token 或时间)。
|
|
133
|
-
|
|
134
|
-
```text
|
|
135
|
-
hyw -t 一大段话。
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### 引用回复
|
|
139
|
-
支持引用消息进行追问,机器人会自动读取被引用的消息作为上下文:
|
|
140
|
-
- **引用 + 命令**:机器人将理解被引用消息的内容(包括图片)通过 `MessageChain` 操作拼接 `Text`、`Image` 与部分 `Custom`。
|
|
141
|
-
|
|
142
|
-
UncleCode. (2024). Crawl4AI: Open-source LLM Friendly Web Crawler & Scraper [Computer software].
|
|
143
|
-
GitHub. https://github.com/unclecode/crawl4ai
|
|
File without changes
|
|
File without changes
|