entari-plugin-hyw 3.3.0__py3-none-any.whl → 3.3.1__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.

Files changed (48) hide show
  1. entari_plugin_hyw/__init__.py +309 -763
  2. entari_plugin_hyw/hyw_core.py +700 -0
  3. {entari_plugin_hyw-3.3.0.dist-info → entari_plugin_hyw-3.3.1.dist-info}/METADATA +28 -20
  4. entari_plugin_hyw-3.3.1.dist-info/RECORD +6 -0
  5. entari_plugin_hyw/assets/icon/anthropic.svg +0 -1
  6. entari_plugin_hyw/assets/icon/deepseek.png +0 -0
  7. entari_plugin_hyw/assets/icon/gemini.svg +0 -1
  8. entari_plugin_hyw/assets/icon/google.svg +0 -1
  9. entari_plugin_hyw/assets/icon/grok.png +0 -0
  10. entari_plugin_hyw/assets/icon/microsoft.svg +0 -15
  11. entari_plugin_hyw/assets/icon/minimax.png +0 -0
  12. entari_plugin_hyw/assets/icon/mistral.png +0 -0
  13. entari_plugin_hyw/assets/icon/nvida.png +0 -0
  14. entari_plugin_hyw/assets/icon/openai.svg +0 -1
  15. entari_plugin_hyw/assets/icon/openrouter.png +0 -0
  16. entari_plugin_hyw/assets/icon/perplexity.svg +0 -24
  17. entari_plugin_hyw/assets/icon/qwen.png +0 -0
  18. entari_plugin_hyw/assets/icon/xai.png +0 -0
  19. entari_plugin_hyw/assets/icon/zai.png +0 -0
  20. entari_plugin_hyw/assets/libs/highlight.css +0 -10
  21. entari_plugin_hyw/assets/libs/highlight.js +0 -1213
  22. entari_plugin_hyw/assets/libs/katex-auto-render.js +0 -1
  23. entari_plugin_hyw/assets/libs/katex.css +0 -1
  24. entari_plugin_hyw/assets/libs/katex.js +0 -1
  25. entari_plugin_hyw/assets/libs/tailwind.css +0 -1
  26. entari_plugin_hyw/assets/package-lock.json +0 -953
  27. entari_plugin_hyw/assets/package.json +0 -16
  28. entari_plugin_hyw/assets/tailwind.config.js +0 -12
  29. entari_plugin_hyw/assets/tailwind.input.css +0 -235
  30. entari_plugin_hyw/assets/template.html +0 -157
  31. entari_plugin_hyw/assets/template.html.bak +0 -157
  32. entari_plugin_hyw/assets/template.j2 +0 -307
  33. entari_plugin_hyw/core/__init__.py +0 -0
  34. entari_plugin_hyw/core/config.py +0 -35
  35. entari_plugin_hyw/core/history.py +0 -146
  36. entari_plugin_hyw/core/hyw.py +0 -41
  37. entari_plugin_hyw/core/pipeline.py +0 -1065
  38. entari_plugin_hyw/core/render.py +0 -596
  39. entari_plugin_hyw/core/render.py.bak +0 -926
  40. entari_plugin_hyw/utils/__init__.py +0 -2
  41. entari_plugin_hyw/utils/browser.py +0 -40
  42. entari_plugin_hyw/utils/misc.py +0 -93
  43. entari_plugin_hyw/utils/playwright_tool.py +0 -36
  44. entari_plugin_hyw/utils/prompts.py +0 -128
  45. entari_plugin_hyw/utils/search.py +0 -241
  46. entari_plugin_hyw-3.3.0.dist-info/RECORD +0 -46
  47. {entari_plugin_hyw-3.3.0.dist-info → entari_plugin_hyw-3.3.1.dist-info}/WHEEL +0 -0
  48. {entari_plugin_hyw-3.3.0.dist-info → entari_plugin_hyw-3.3.1.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: entari_plugin_hyw
3
- Version: 3.3.0
3
+ Version: 3.3.1
4
4
  Summary: Use large language models to interpret chat messages
5
5
  Author-email: kumoSleeping <zjr2992@outlook.com>
6
6
  License: MIT
@@ -19,9 +19,9 @@ Description-Content-Type: text/markdown
19
19
  Requires-Dist: arclet-entari[full]>=0.16.5
20
20
  Requires-Dist: openai
21
21
  Requires-Dist: httpx
22
- Requires-Dist: markdown>=3.10
23
- Requires-Dist: crawl4ai>=0.7.8
24
- Requires-Dist: jinja2>=3.0
22
+ Provides-Extra: playwright
23
+ Requires-Dist: playwright>=1.56.0; extra == "playwright"
24
+ Requires-Dist: trafilatura>=2.0.0; extra == "playwright"
25
25
  Provides-Extra: dev
26
26
  Requires-Dist: entari-plugin-server>=0.5.0; extra == "dev"
27
27
  Requires-Dist: satori-python-adapter-onebot11>=0.2.5; extra == "dev"
@@ -38,10 +38,6 @@ Requires-Dist: satori-python-adapter-onebot11>=0.2.5; extra == "dev"
38
38
 
39
39
  </div>
40
40
 
41
- # v3.3 迎来大幅度改动、现在图文不符
42
-
43
-
44
-
45
41
  ## 🎑 效果展示
46
42
 
47
43
 
@@ -51,9 +47,12 @@ Requires-Dist: satori-python-adapter-onebot11>=0.2.5; extra == "dev"
51
47
  </div>
52
48
 
53
49
  ## ✨ 功能特性
54
- - **关于搜索**:一次性触发 Bing 网页与图片搜索,组合结果后再回应。
55
- - 给予 `Alconna` `MessageChain` 混合处理, 深度优化触发体验。
56
- - **网页获取**:使用 Playwright 进行实时页面获取。
50
+ - **关于搜索**:
51
+ - 如果不设置 jina token, 模型会根据提示词优先使用 jina / playwright(成功率较低) 获取渲染 bing / google 混合搜索结果。
52
+ - 存在 jina token 时,模型会获得一个 web search 工具,~~但我没试过我喜欢白嫖~~。
53
+ - 也可以 OpenRouter 的 `:online` 参数,该参数会优先使用模型提供商的搜索、其次 `exa`(较贵) 进行网页搜索。
54
+ - 给予 `Alconna` 与 `MessageChain` 混合处理, 深度优化触发体验`。
55
+ - **网页获取**:支持通过 **Jina AI** 或 **Playwright** 进行实时页面获取。
57
56
  - **多模态理解**:支持图片视觉分析。
58
57
  - **上下文感知**:维护对话历史记录,支持连续的多轮对话。
59
58
  - `reaction` 表情, 表示任务开始。
@@ -68,8 +67,12 @@ Requires-Dist: satori-python-adapter-onebot11>=0.2.5; extra == "dev"
68
67
  pip install entari-plugin-hyw
69
68
  ```
70
69
 
71
- ### 搜索
72
- 默认通过 HTTP 请求搜索引擎(DuckDuckGo,可在配置中自定义完整搜索链接,如 `https://duckduckgo.com/?q={query}`)。
70
+ ### 启用 Playwright 支持
71
+ 如果你希望使用 Playwright 进行本地网页渲染(而非仅使用 Jina AI):
72
+ ```bash
73
+ pip install entari-plugin-hyw[playwright]
74
+ playwright install chromium
75
+ ```
73
76
 
74
77
  ## ⚙️ 配置
75
78
 
@@ -83,6 +86,7 @@ plugins:
83
86
  command_name_list: ["zssm", "hyw"]
84
87
 
85
88
  # 主 LLM 模型配置(必需), 如 x-ai/grok-4.1-fast:online、perplexity/sonar
89
+ # 如果模型不自带搜索 模型会根据提示词优先使用 jina / playwright(成功率较低) 获取渲染 bing / google 混合搜索结果
86
90
  model_name: "gx-ai/grok-4.1-fast:free"
87
91
  api_key: "your-api-key"
88
92
 
@@ -90,8 +94,19 @@ plugins:
90
94
  base_url: "openai-compatible-url"
91
95
 
92
96
  # --- 浏览器与搜索 ---
97
+ # 网页浏览工具: "jina" (默认) 或 "playwright"
98
+ browser_tool: "jina"
99
+
100
+ # 可选: Jina AI API Key (配置以获得更高限额)(免费方案20/min)
101
+ # 配置此项同时会启用 web search 工具
102
+ jina_api_key: "jina_..."
103
+
104
+ # Playwright 设置
93
105
  headless: true
94
106
 
107
+ # 浏览器回退: 当首选 browser_tool 失败时,尝试使用备用 browser_tool (默认: false)
108
+ enable_browser_fallback: false
109
+
95
110
  # --- 视觉配置 (可选) ---
96
111
  # 如果未设置,将回退使用主模型
97
112
  vision_model_name: "qwen-vl-plus"
@@ -103,10 +118,6 @@ plugins:
103
118
  reasoning:
104
119
  effort: low
105
120
 
106
- # --- 交互体验 ---
107
- # 是否开启表情反应 (默认: true)
108
- reaction: true
109
-
110
121
  # --- 调试 ---
111
122
  save_conversation: false
112
123
  ```
@@ -137,6 +148,3 @@ hyw -t 一大段话。
137
148
  ### 引用回复
138
149
  支持引用消息进行追问,机器人会自动读取被引用的消息作为上下文:
139
150
  - **引用 + 命令**:机器人将理解被引用消息的内容(包括图片)通过 `MessageChain` 操作拼接 `Text`、`Image` 与部分 `Custom`。
140
-
141
- UncleCode. (2024). Crawl4AI: Open-source LLM Friendly Web Crawler & Scraper [Computer software].
142
- GitHub. https://github.com/unclecode/crawl4ai
@@ -0,0 +1,6 @@
1
+ entari_plugin_hyw/__init__.py,sha256=uoIuk9-nWh8Wz03ziRopgmHmOGeBQYehD4PKqueNrjI,13275
2
+ entari_plugin_hyw/hyw_core.py,sha256=B80dPjufwNYFWVpu17mWtMNe3k8DTDI3Nk5NbBZ0o3M,29882
3
+ entari_plugin_hyw-3.3.1.dist-info/METADATA,sha256=fLSahfcztnHbqoLm0ZLskaYRz9P_6BwJ-0-1U_jLWaU,5390
4
+ entari_plugin_hyw-3.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
+ entari_plugin_hyw-3.3.1.dist-info/top_level.txt,sha256=TIDsn6XPs6KA5e3ezsE65JoXsy03ejDdrB41I4SPjmo,18
6
+ entari_plugin_hyw-3.3.1.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 512 512"><rect fill="#CC9B7A" width="512" height="512" rx="104.187" ry="105.042"/><path fill="#1F1F1E" fill-rule="nonzero" d="M318.663 149.787h-43.368l78.952 212.423 43.368.004-78.952-212.427zm-125.326 0l-78.952 212.427h44.255l15.932-44.608 82.846-.004 16.107 44.612h44.255l-79.126-212.427h-45.317zm-4.251 128.341l26.91-74.701 27.083 74.701h-53.993z"/></svg>
Binary file
@@ -1 +0,0 @@
1
- <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M16 8.016A8.522 8.522 0 008.016 16h-.032A8.521 8.521 0 000 8.016v-.032A8.521 8.521 0 007.984 0h.032A8.522 8.522 0 0016 7.984v.032z" fill="url(#prefix__paint0_radial_980_20147)"/><defs><radialGradient id="prefix__paint0_radial_980_20147" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(16.1326 5.4553 -43.70045 129.2322 1.588 6.503)"><stop offset=".067" stop-color="#9168C0"/><stop offset=".343" stop-color="#5684D1"/><stop offset=".672" stop-color="#1BA1E3"/></radialGradient></defs></svg>
@@ -1 +0,0 @@
1
- <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M16 8.016A8.522 8.522 0 008.016 16h-.032A8.521 8.521 0 000 8.016v-.032A8.521 8.521 0 007.984 0h.032A8.522 8.522 0 0016 7.984v.032z" fill="url(#prefix__paint0_radial_980_20147)"/><defs><radialGradient id="prefix__paint0_radial_980_20147" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(16.1326 5.4553 -43.70045 129.2322 1.588 6.503)"><stop offset=".067" stop-color="#9168C0"/><stop offset=".343" stop-color="#5684D1"/><stop offset=".672" stop-color="#1BA1E3"/></radialGradient></defs></svg>
Binary file
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!-- Generator: Adobe Illustrator 24.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
- viewBox="0 0 129 129" style="enable-background:new 0 0 129 129;" xml:space="preserve">
5
- <style type="text/css">
6
- .st0{fill:#F25022;}
7
- .st1{fill:#7FBA00;}
8
- .st2{fill:#00A4EF;}
9
- .st3{fill:#FFB900;}
10
- </style>
11
- <path class="st0" d="M0,0h61.3v61.3H0V0z"/>
12
- <path class="st1" d="M67.7,0H129v61.3H67.7V0z"/>
13
- <path class="st2" d="M0,67.7h61.3V129H0V67.7z"/>
14
- <path class="st3" d="M67.7,67.7H129V129H67.7V67.7z"/>
15
- </svg>
Binary file
Binary file
Binary file
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="256" height="260" preserveAspectRatio="xMidYMid" viewBox="0 0 256 260"><path d="M239.184 106.203a64.716 64.716 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.716 64.716 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.665 64.665 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.767 64.767 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483Zm-97.56 136.338a48.397 48.397 0 0 1-31.105-11.255l1.535-.87 51.67-29.825a8.595 8.595 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601Zm-104.466-44.61a48.345 48.345 0 0 1-5.781-32.589l1.534.921 51.722 29.826a8.339 8.339 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803ZM23.549 85.38a48.499 48.499 0 0 1 25.58-21.333v61.39a8.288 8.288 0 0 0 4.195 7.316l62.874 36.272-21.845 12.636a.819.819 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466 41.695-63.08-36.63L161.73 77.86a.819.819 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.544 8.544 0 0 0-4.4-7.213Zm21.742-32.69-1.535-.922-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.716.716 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391v.205ZM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87-51.67 29.825a8.595 8.595 0 0 0-4.246 7.367l-.051 72.697Zm11.868-25.58 28.138-16.217 28.188 16.218v32.434l-28.086 16.218-28.188-16.218-.052-32.434Z"/></svg>
@@ -1,24 +0,0 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- width="80"
4
- height="80"
5
- viewBox="0 0 48 48">
6
- <path
7
- fill="none"
8
- stroke="#20808d"
9
- stroke-linecap="round"
10
- stroke-linejoin="round"
11
- d="M24 4.5v39M13.73 16.573v-9.99L24 16.573m0 14.5L13.73 41.417V27.01L24 16.573m0 0l10.27-9.99v9.99"/>
12
- <path
13
- fill="none"
14
- stroke="#20808d"
15
- stroke-linecap="round"
16
- stroke-linejoin="round"
17
- d="M13.73 31.396H9.44V16.573h29.12v14.823h-4.29"/>
18
- <path
19
- fill="none"
20
- stroke="#20808d"
21
- stroke-linecap="round"
22
- stroke-linejoin="round"
23
- d="M24 16.573L34.27 27.01v14.407L24 31.073"/>
24
- </svg>
Binary file
Binary file
Binary file
@@ -1,10 +0,0 @@
1
- pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
2
- Theme: GitHub
3
- Description: Light theme as seen on github.com
4
- Author: github.com
5
- Maintainer: @Hirse
6
- Updated: 2021-05-15
7
-
8
- Outdated base version: https://github.com/primer/github-syntax-light
9
- Current colors taken from GitHub's CSS
10
- */.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}