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()]) }