This commit is contained in:
呆萌闷油瓶 2025-12-29 15:54:43 +08:00 committed by GitHub
commit cc9786d983
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 7 deletions

View File

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

View File

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