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

@@ -17,6 +17,7 @@ class HYWConfig:
17
17
  intruct_base_url: Optional[str] = None
18
18
  search_base_url: str = "https://lite.duckduckgo.com/lite/?q={query}"
19
19
  image_search_base_url: str = "https://duckduckgo.com/?q={query}&iax=images&ia=images"
20
+ search_params: Optional[str] = None # e.g. "&kl=cn-zh" for China region
20
21
  extra_body: Optional[Dict[str, Any]] = None
21
22
  temperature: float = 0.4
22
23
  max_turns: int = 10
@@ -19,7 +19,7 @@ INTRUCT_SP = """# 你是一个专业的指导专家.
19
19
  - 用户消息包含链接: 调用 crawl_page 获取内容, 无需其他工具
20
20
  - 用户消息包含典型名词、可能的专有名词组合: 调用 internal_web_search
21
21
  - 提炼出关键词搜索关键词本身, 不添加任何其他助词, 搜索效果最好
22
- - 同时调用 internal_image_search
22
+ - 如果用户消息关键词清晰, 使用图片搜索能搜索出诸如海报、地标、物品、角色立绘等, 调用 internal_image_search
23
23
  - 用户消息不需要搜索: 不调用工具
24
24
  - 调用 set_mode:
25
25
  - 绝大部分常规问题: standard
@@ -90,8 +90,16 @@ class SearchService:
90
90
  results: List[Dict[str, str]] = []
91
91
 
92
92
  def find_snippet(url: str, domain: str) -> str:
93
- for ln in lines:
93
+ for i, ln in enumerate(lines):
94
+ # Avoid matching DDG internal links (filter by site, etc) which contain the target URL in query params
95
+ if "duckduckgo.com" in ln:
96
+ continue
97
+
94
98
  if url in ln or (domain and domain in ln):
99
+ # If this line looks like the title/link line (e.g. starts with [Title](url) or similar),
100
+ # and the NEXT line exists, return the next line as snippet.
101
+ if i + 1 < len(lines) and len(ln) < 300: # heuristic: title lines are usually shorter
102
+ return lines[i+1][:400]
95
103
  return ln[:400]
96
104
  # fallback to first non-empty line
97
105
  return lines[0][:400] if lines else ""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: entari_plugin_hyw
3
- Version: 3.3.2
3
+ Version: 3.3.3
4
4
  Summary: Use large language models to interpret chat messages
5
5
  Author-email: kumoSleeping <zjr2992@outlook.com>
6
6
  License: MIT
@@ -28,7 +28,7 @@ entari_plugin_hyw/assets/libs/katex.css,sha256=UF1fgpAiu3tPJN_uCqEUHNe7pnr-QR0SQ
28
28
  entari_plugin_hyw/assets/libs/katex.js,sha256=3ISyluw-iE3gkxWPdg_Z1Ftser5YtTgVV_ThOPRqWK4,277038
29
29
  entari_plugin_hyw/assets/libs/tailwind.css,sha256=QlYLtFooDB4H5-2bxuS8DJD5L1_cZgjEQnrYvUXVFnI,19889
30
30
  entari_plugin_hyw/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
- entari_plugin_hyw/core/config.py,sha256=iNCSOzd-OHNeaYBOZxx6pEmiQcR31KPE93BOwSLfBUU,1530
31
+ entari_plugin_hyw/core/config.py,sha256=onodNERVzpjZBhi8_asyO38T0Yfxr7rHL-sEdTAwepQ,1607
32
32
  entari_plugin_hyw/core/history.py,sha256=vqp7itwR5-KaqC4Ftmq6GOz7OM9GsiFJnSN9JJ2P6L4,5894
33
33
  entari_plugin_hyw/core/hyw.py,sha256=QwLB2YpUnzbVCWXcJF0uUeDAjxd4LWMzm9EjB9T1G1g,1671
34
34
  entari_plugin_hyw/core/pipeline.py,sha256=Lw_x3Z12-hQDGj9FtVqeJHM91Yy90LMmiX7SRp3T-wY,48346
@@ -38,9 +38,9 @@ entari_plugin_hyw/utils/__init__.py,sha256=TnkxDqYr0zgRE7TC92tVbUaY8m1UyyoLg2zvz
38
38
  entari_plugin_hyw/utils/browser.py,sha256=LJlFh-oSqt9mQBpMALxbYGUG__t1YLUo7RxUAslsWUc,1416
39
39
  entari_plugin_hyw/utils/misc.py,sha256=_7iHVYj_mJ6OGq6FU1s_cFeS1Ao-neBjZYd6eI2p95U,3482
40
40
  entari_plugin_hyw/utils/playwright_tool.py,sha256=ZZNkzFtUt_Gxny3Od4boBAgNF9J0N84uySatzn1Bwe4,1272
41
- entari_plugin_hyw/utils/prompts.py,sha256=FiOw012CTD1IxcSi4hOr71wc92IlxcWCWwQJ1-twIv8,3498
42
- entari_plugin_hyw/utils/search.py,sha256=uXDnyEq6SKytRfqbJRYxJHCaGTM-ZvvRodSYihZf5Es,9460
43
- entari_plugin_hyw-3.3.2.dist-info/METADATA,sha256=X1O5-aU9WkMmiMYDfTpyHNIPKTlIzklIg-JsBhOm3vo,4646
44
- entari_plugin_hyw-3.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
- entari_plugin_hyw-3.3.2.dist-info/top_level.txt,sha256=TIDsn6XPs6KA5e3ezsE65JoXsy03ejDdrB41I4SPjmo,18
46
- entari_plugin_hyw-3.3.2.dist-info/RECORD,,
41
+ entari_plugin_hyw/utils/prompts.py,sha256=Hbp1zVrrlXrOp6wI5YNoDaob-3VwKc-_ohJJQhw83no,3607
42
+ entari_plugin_hyw/utils/search.py,sha256=5fjV3k--VjNIwsAT4aP82xKvsK7spx8X9H0HzPBUEQ4,10029
43
+ entari_plugin_hyw-3.3.3.dist-info/METADATA,sha256=4w5sqcXnZd5SvgePYAcOpzCq-23MYk8j1uIycCA--FI,4646
44
+ entari_plugin_hyw-3.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
+ entari_plugin_hyw-3.3.3.dist-info/top_level.txt,sha256=TIDsn6XPs6KA5e3ezsE65JoXsy03ejDdrB41I4SPjmo,18
46
+ entari_plugin_hyw-3.3.3.dist-info/RECORD,,