From 3d4f84947aebfa41b23537287ab1a9857786ea18 Mon Sep 17 00:00:00 2001 From: hanishkvc Date: Sat, 8 Nov 2025 21:06:42 +0530 Subject: [PATCH] SimpleChatTC:NSChatMessage:ToolResponse show handling Given that the user query box no longer includes the special xml string wrt tool response data (TOOL.TEMP ROLE), so now instead set a special attribute to indicate that user query/input box is maintaining a tool response. For regular Tool responses in the chat session, now show the tool call id and tool name before the tool response data (ie content field). --- tools/server/public_simplechat/simplechat.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/server/public_simplechat/simplechat.js b/tools/server/public_simplechat/simplechat.js index 40533c35e1..bab3355bf3 100644 --- a/tools/server/public_simplechat/simplechat.js +++ b/tools/server/public_simplechat/simplechat.js @@ -222,6 +222,13 @@ class NSChatMessage { return false; } + has_toolresponse() { + if (this.tool_call_id) { + return true + } + return false + } + } @@ -1021,6 +1028,7 @@ class MultiChatUI { if (msg.ns.role === Roles.ToolTemp) { if (iFromLast == 0) { this.elInUser.value = msg.ns.getContent(); + this.elInUser.dataset.role = Roles.ToolTemp } return } @@ -1043,6 +1051,14 @@ class MultiChatUI { if (msg.ns.has_reasoning()) { showList.push(['reasoning', `!!!Reasoning: ${msg.ns.getReasoningContent()} !!!\n\n`]) } + if (msg.ns.has_toolresponse()) { + if (msg.ns.tool_call_id) { + showList.push(['toolcallid', msg.ns.tool_call_id]) + } + if (msg.ns.name) { + showList.push(['toolname', msg.ns.name]) + } + } if (msg.ns.getContent().trim().length > 0) { showList.push(['content', msg.ns.getContent().trim()]) }