Skip to content

Commit

Permalink
Fix Unnecessary Newline Characters in Extracted Tool Response Text (#…
Browse files Browse the repository at this point in the history
…4646)

Co-authored-by: kronus <[email protected]>
  • Loading branch information
kronus-ho and kronus authored May 25, 2024
1 parent f804adb commit f56b984
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/core/workflow/nodes/tool/tool_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,12 @@ def _extract_tool_response_text(self, tool_response: list[ToolInvokeMessage]) ->
"""
Extract tool response text
"""
return ''.join([
f'{message.message}\n' if message.type == ToolInvokeMessage.MessageType.TEXT else
f'Link: {message.message}\n' if message.type == ToolInvokeMessage.MessageType.LINK else ''
return '\n'.join([
f'{message.message}' if message.type == ToolInvokeMessage.MessageType.TEXT else
f'Link: {message.message}' if message.type == ToolInvokeMessage.MessageType.LINK else ''
for message in tool_response
])


@classmethod
def _extract_variable_selector_to_variable_mapping(cls, node_data: ToolNodeData) -> dict[str, list[str]]:
Expand Down

0 comments on commit f56b984

Please sign in to comment.