fix: no content write back to plugin

This commit is contained in:
leslie2046 2025-12-22 15:01:01 +08:00
parent 95330162a4
commit 1b6520efdd
2 changed files with 5 additions and 4 deletions

View File

@ -187,7 +187,8 @@ class FunctionCallAgentRunner(BaseAgentRunner):
),
)
assistant_message = AssistantPromptMessage(content="", tool_calls=[])
assistant_message = AssistantPromptMessage(content=response, tool_calls=[])
if tool_calls:
assistant_message.tool_calls = [
AssistantPromptMessage.ToolCall(
@ -199,8 +200,8 @@ class FunctionCallAgentRunner(BaseAgentRunner):
)
for tool_call in tool_calls
]
else:
assistant_message.content = response
logger.debug(f"FunctionCallAgentRunner: assistant_message: {assistant_message.model_dump()}")
self._current_thoughts.append(assistant_message)

View File

@ -249,7 +249,7 @@ class AssistantPromptMessage(PromptMessage):
:return: True if prompt message is empty, False otherwise
"""
if not super().is_empty() and not self.tool_calls:
if not super().is_empty() or self.tool_calls:
return False
return True