SimpleChatTC:Auto tool calling control to end user
Instead of enforcing always explicit user triggered tool calling, now user is given the option whether to use explicit user triggered tool calling or to use auto triggering after showing tool details for a user specified amount of seconds. NOTE: The current logic doesnt account for user clicking the buttons before the autoclick triggers; need to cancel the auto clicks, if user triggers before autoclick, ie in future.
This commit is contained in:
parent
9e97880dde
commit
45f9db9963
|
|
@ -741,6 +741,11 @@ class MultiChatUI {
|
|||
this.elInToolName.dataset.tool_call_id = ar.ns.tool_calls[0].id
|
||||
this.elInToolArgs.value = ar.ns.tool_calls[0].function.arguments
|
||||
this.elBtnTool.disabled = false
|
||||
if (gMe.tools.auto > 0) {
|
||||
setTimeout(()=>{
|
||||
this.elBtnTool.click()
|
||||
}, gMe.tools.auto*1000)
|
||||
}
|
||||
} else {
|
||||
this.elDivTool.hidden = true
|
||||
this.elInToolName.value = ""
|
||||
|
|
@ -808,6 +813,11 @@ class MultiChatUI {
|
|||
clearTimeout(this.idTimeOut)
|
||||
this.elInUser.value = ChatMessageEx.createToolCallResultAllInOne(id, name, data);
|
||||
this.ui_reset_userinput(false)
|
||||
if (gMe.tools.auto > 0) {
|
||||
setTimeout(()=>{
|
||||
this.elBtnUser.click()
|
||||
}, gMe.tools.auto*1000)
|
||||
}
|
||||
})
|
||||
|
||||
this.elInUser.addEventListener("keyup", (ev)=> {
|
||||
|
|
@ -1033,7 +1043,8 @@ class Me {
|
|||
this.tools = {
|
||||
enabled: false,
|
||||
fetchProxyUrl: "http://127.0.0.1:3128",
|
||||
toolNames: /** @type {Array<string>} */([])
|
||||
toolNames: /** @type {Array<string>} */([]),
|
||||
auto: 0
|
||||
};
|
||||
this.chatProps = {
|
||||
apiEP: ApiEP.Type.Chat,
|
||||
|
|
|
|||
Loading…
Reference in New Issue