mirror of https://github.com/Mai-with-u/MaiBot.git
Merge pull request #1100 from XXXxx7258/dev
fix: avoid slice error when content is not sliceablepull/1102/head
commit
03647e3848
|
|
@ -187,7 +187,11 @@ class ToolExecutor:
|
|||
tool_results.append(tool_info)
|
||||
|
||||
logger.info(f"{self.log_prefix}工具{tool_name}执行成功,类型: {tool_info['type']}")
|
||||
logger.debug(f"{self.log_prefix}工具{tool_name}结果内容: {tool_info['content'][:200]}...")
|
||||
content = tool_info['content']
|
||||
if not isinstance(content, (str, list, tuple)):
|
||||
content = str(content)
|
||||
preview = content[:200]
|
||||
logger.debug(f"{self.log_prefix}工具{tool_name}结果内容: {preview}...")
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"{self.log_prefix}工具{tool_name}执行失败: {e}")
|
||||
|
|
|
|||
Loading…
Reference in New Issue