mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
refactor: enhance tool message handling and improve error logging
- Updated _send_tool_message to accept a title parameter for better message context. - Modified various tool implementations to utilize the new title parameter for clearer messaging. - Improved error logging across multiple tools to include exception details for better debugging.
This commit is contained in:
@@ -26,12 +26,13 @@ class MoviePilotTool(BaseTool):
|
||||
async def _arun(self, **kwargs) -> str:
|
||||
raise NotImplementedError
|
||||
|
||||
def _send_tool_message(self, message: str, **kwargs):
|
||||
def _send_tool_message(self, message: str, title: str = None, **kwargs):
|
||||
"""发送工具执行消息"""
|
||||
try:
|
||||
self._message_helper.put(
|
||||
message=message,
|
||||
role="system"
|
||||
role="system",
|
||||
title=title or "工具执行"
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"发送工具消息失败: {e}")
|
||||
|
||||
Reference in New Issue
Block a user