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).
This commit is contained in:
parent
b251f7de7c
commit
3d4f84947a
|
|
@ -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()])
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue