entari-plugin-hyw 3.3.3__py3-none-any.whl → 3.3.5__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/config.py +1 -0
- entari_plugin_hyw/core/hyw.py +22 -15
- entari_plugin_hyw/core/pipeline.py +2 -5
- entari_plugin_hyw/utils/prompts.py +1 -0
- entari_plugin_hyw/utils/search.py +1 -1
- {entari_plugin_hyw-3.3.3.dist-info → entari_plugin_hyw-3.3.5.dist-info}/METADATA +1 -1
- {entari_plugin_hyw-3.3.3.dist-info → entari_plugin_hyw-3.3.5.dist-info}/RECORD +9 -9
- {entari_plugin_hyw-3.3.3.dist-info → entari_plugin_hyw-3.3.5.dist-info}/WHEEL +0 -0
- {entari_plugin_hyw-3.3.3.dist-info → entari_plugin_hyw-3.3.5.dist-info}/top_level.txt +0 -0
entari_plugin_hyw/core/config.py
CHANGED
|
@@ -18,6 +18,7 @@ class HYWConfig:
|
|
|
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
20
|
search_params: Optional[str] = None # e.g. "&kl=cn-zh" for China region
|
|
21
|
+
search_limit: int = 8
|
|
21
22
|
extra_body: Optional[Dict[str, Any]] = None
|
|
22
23
|
temperature: float = 0.4
|
|
23
24
|
max_turns: int = 10
|
entari_plugin_hyw/core/hyw.py
CHANGED
|
@@ -11,31 +11,38 @@ class HYW:
|
|
|
11
11
|
"""
|
|
12
12
|
def __init__(self, config: HYWConfig):
|
|
13
13
|
self.config = config
|
|
14
|
-
|
|
14
|
+
# No persistent pipeline - we create one per request to ensure thread safety
|
|
15
|
+
# self.pipeline = ProcessingPipeline(config)
|
|
15
16
|
logger.info(f"HYW V2 (Ironclad) initialized - Model: {config.model_name}")
|
|
16
17
|
|
|
17
18
|
async def agent(self, user_input: str, conversation_history: List[Dict] = None, images: List[str] = None,
|
|
18
19
|
selected_model: str = None, selected_vision_model: str = None, local_mode: bool = False) -> Dict[str, Any]:
|
|
19
20
|
"""
|
|
20
21
|
Main entry point for the plugin (called by __init__.py).
|
|
22
|
+
Creates a fresh pipeline instance for each request to avoid state contamination (race conditions).
|
|
21
23
|
"""
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
pipeline = ProcessingPipeline(self.config)
|
|
25
|
+
try:
|
|
26
|
+
# Delegate completely to pipeline
|
|
27
|
+
result = await pipeline.execute(
|
|
28
|
+
user_input,
|
|
29
|
+
conversation_history or [],
|
|
30
|
+
model_name=selected_model,
|
|
31
|
+
images=images,
|
|
32
|
+
selected_vision_model=selected_vision_model,
|
|
33
|
+
)
|
|
34
|
+
return result
|
|
35
|
+
finally:
|
|
36
|
+
await pipeline.close()
|
|
34
37
|
|
|
35
38
|
async def close(self):
|
|
36
39
|
"""Explicit async close method. NO __del__."""
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
# Close shared resources
|
|
41
|
+
try:
|
|
42
|
+
from ..utils.search import close_shared_crawler
|
|
43
|
+
await close_shared_crawler()
|
|
44
|
+
except Exception:
|
|
45
|
+
pass
|
|
39
46
|
|
|
40
47
|
# Legacy Compatibility (optional attributes just to prevent blind attribute errors if referenced externally)
|
|
41
48
|
# in V2 we strongly discourage accessing internal tools directly.
|
|
@@ -1058,8 +1058,5 @@ class ProcessingPipeline:
|
|
|
1058
1058
|
await self.search_service.close()
|
|
1059
1059
|
except Exception:
|
|
1060
1060
|
pass
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
await close_shared_crawler()
|
|
1064
|
-
except Exception:
|
|
1065
|
-
pass
|
|
1061
|
+
# Do NOT close shared crawler here, as pipeline instances are now per-request.
|
|
1062
|
+
# Shared crawler lifecycle is managed by HYW.close() or global cleanup.
|
|
@@ -33,7 +33,7 @@ class SearchService:
|
|
|
33
33
|
"""
|
|
34
34
|
def __init__(self, config: Any):
|
|
35
35
|
self.config = config
|
|
36
|
-
self._default_limit = 8
|
|
36
|
+
self._default_limit = getattr(config, "search_limit", 8)
|
|
37
37
|
self._crawler: Optional[AsyncWebCrawler] = None
|
|
38
38
|
|
|
39
39
|
def _build_search_url(self, query: str) -> str:
|
|
@@ -28,19 +28,19 @@ 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=
|
|
31
|
+
entari_plugin_hyw/core/config.py,sha256=ph9-_hDLaemyh9Hx5A44POhoRh8-gwNhUxXieaCPYu8,1634
|
|
32
32
|
entari_plugin_hyw/core/history.py,sha256=vqp7itwR5-KaqC4Ftmq6GOz7OM9GsiFJnSN9JJ2P6L4,5894
|
|
33
|
-
entari_plugin_hyw/core/hyw.py,sha256=
|
|
34
|
-
entari_plugin_hyw/core/pipeline.py,sha256=
|
|
33
|
+
entari_plugin_hyw/core/hyw.py,sha256=RCRjV9uYmvXysiliztphLP3VyUabrf0LY2Bk66W5JGA,1927
|
|
34
|
+
entari_plugin_hyw/core/pipeline.py,sha256=kejGXClgE9o7G6p7Kc3Kgh-AJYQqN7tA-Z3I5U3iuJU,48356
|
|
35
35
|
entari_plugin_hyw/core/render.py,sha256=ypfjcTXptW_I0Z9tz4pZ9lJ6hdjYVq07UIiuApMuS9c,28193
|
|
36
36
|
entari_plugin_hyw/core/render.py.bak,sha256=qMd6Tk0p6ItqGmErR6dkWRwCuKQYXINc7KRxnP-mb_s,48768
|
|
37
37
|
entari_plugin_hyw/utils/__init__.py,sha256=TnkxDqYr0zgRE7TC92tVbUaY8m1UyyoLg2zvzQ8nMVI,84
|
|
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=
|
|
42
|
-
entari_plugin_hyw/utils/search.py,sha256=
|
|
43
|
-
entari_plugin_hyw-3.3.
|
|
44
|
-
entari_plugin_hyw-3.3.
|
|
45
|
-
entari_plugin_hyw-3.3.
|
|
46
|
-
entari_plugin_hyw-3.3.
|
|
41
|
+
entari_plugin_hyw/utils/prompts.py,sha256=WiAzFdEnlhcVTzEAxsFxa5mlIN_x95dv5bSCD0wARgc,3633
|
|
42
|
+
entari_plugin_hyw/utils/search.py,sha256=HiAfCAHMiMaYgOcrhDDfyOyKST17m-edwx8oKW1AC0E,10062
|
|
43
|
+
entari_plugin_hyw-3.3.5.dist-info/METADATA,sha256=b_QZnmZKNJEb5-lpO1Zx9IPQk5NA8II6cKffmwfjYSw,4646
|
|
44
|
+
entari_plugin_hyw-3.3.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
45
|
+
entari_plugin_hyw-3.3.5.dist-info/top_level.txt,sha256=TIDsn6XPs6KA5e3ezsE65JoXsy03ejDdrB41I4SPjmo,18
|
|
46
|
+
entari_plugin_hyw-3.3.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|