entari-plugin-hyw 3.5.0rc3__py3-none-any.whl → 3.5.0rc4__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/__init__.py +22 -14
- entari_plugin_hyw/assets/card-dist/index.html +46 -46
- entari_plugin_hyw/card-ui/src/App.vue +8 -6
- entari_plugin_hyw/card-ui/src/components/MarkdownContent.vue +8 -7
- entari_plugin_hyw/card-ui/src/components/StageCard.vue +71 -17
- entari_plugin_hyw/card-ui/src/style.css +21 -0
- entari_plugin_hyw/image_cache.py +15 -24
- entari_plugin_hyw/misc.py +38 -0
- entari_plugin_hyw/pipeline.py +140 -33
- entari_plugin_hyw/prompts.py +4 -0
- entari_plugin_hyw/search.py +2 -2
- {entari_plugin_hyw-3.5.0rc3.dist-info → entari_plugin_hyw-3.5.0rc4.dist-info}/METADATA +1 -1
- {entari_plugin_hyw-3.5.0rc3.dist-info → entari_plugin_hyw-3.5.0rc4.dist-info}/RECORD +15 -15
- {entari_plugin_hyw-3.5.0rc3.dist-info → entari_plugin_hyw-3.5.0rc4.dist-info}/WHEEL +0 -0
- {entari_plugin_hyw-3.5.0rc3.dist-info → entari_plugin_hyw-3.5.0rc4.dist-info}/top_level.txt +0 -0
entari_plugin_hyw/__init__.py
CHANGED
|
@@ -22,7 +22,7 @@ from arclet.entari.event.command import CommandReceive
|
|
|
22
22
|
from .pipeline import ProcessingPipeline
|
|
23
23
|
from .history import HistoryManager
|
|
24
24
|
from .render_vue import ContentRenderer
|
|
25
|
-
from .misc import process_onebot_json, process_images, resolve_model_name
|
|
25
|
+
from .misc import process_onebot_json, process_images, resolve_model_name, render_refuse_answer, REFUSE_ANSWER_MARKDOWN
|
|
26
26
|
from arclet.entari.event.lifespan import Cleanup
|
|
27
27
|
|
|
28
28
|
import os
|
|
@@ -288,18 +288,27 @@ async def process_request(
|
|
|
288
288
|
|
|
289
289
|
# Use stats_list if available, otherwise standard stats
|
|
290
290
|
stats_to_render = final_resp.get("stats_list", final_resp.get("stats", {}))
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
291
|
+
|
|
292
|
+
# Check if refuse_answer was triggered
|
|
293
|
+
if final_resp.get("refuse_answer"):
|
|
294
|
+
logger.info(f"Refuse answer triggered. Rendering refuse image. Reason: {final_resp.get('refuse_reason', '')}")
|
|
295
|
+
render_ok = await render_refuse_answer(
|
|
296
|
+
renderer=renderer,
|
|
297
|
+
output_path=output_path,
|
|
298
|
+
theme_color=conf.theme_color,
|
|
299
|
+
)
|
|
300
|
+
else:
|
|
301
|
+
render_ok = await renderer.render(
|
|
302
|
+
markdown_content=content,
|
|
303
|
+
output_path=output_path,
|
|
304
|
+
stats=stats_to_render,
|
|
305
|
+
references=structured.get("references", []),
|
|
306
|
+
page_references=structured.get("page_references", []),
|
|
307
|
+
image_references=structured.get("image_references", []),
|
|
308
|
+
stages_used=final_resp.get("stages_used", []),
|
|
309
|
+
image_timeout=conf.render_image_timeout_ms,
|
|
310
|
+
theme_color=conf.theme_color,
|
|
311
|
+
)
|
|
303
312
|
|
|
304
313
|
# Send & Save
|
|
305
314
|
if not render_ok:
|
|
@@ -397,5 +406,4 @@ metadata("hyw", author=[{"name": "kumoSleeping", "email": "zjr2992@outlook.com"}
|
|
|
397
406
|
|
|
398
407
|
@listen(CommandReceive)
|
|
399
408
|
async def remove_at(content: MessageChain):
|
|
400
|
-
logger.info(f"remove_at: {content}")
|
|
401
409
|
return content.lstrip(At)
|