SimpleChatTC:ToolCallResponseTimeout: Allow end user to control

Moved it into Me->tools, so that end user can modify the same as
required from the settings ui.

TODO: Currently, if tc response is got after a tool call timed out
and user submitted default timed out error response, the delayed
actual response when it is got may overwrite any new content in
user query box, this needs to be tackled.
This commit is contained in:
hanishkvc 2025-10-26 23:25:05 +05:30
parent 252fb91e95
commit a1b33ecd1c
2 changed files with 10 additions and 2 deletions

View File

@ -230,6 +230,10 @@ It is attached to the document object. Some of these can also be updated using t
* searchUrl - specify the search engine's search url template along with the tag SEARCHWORDS in place where the search words should be substituted at runtime.
* toolCallResponseTimeoutMS - specifies the time (in msecs) for which the logic should wait for a tool call to respond
before a default timed out error response is generated and control given back to end user, for them to decide whether
to submit the error response or wait for actual tool call response further.
* auto - the amount of time in seconds to wait before the tool call request is auto triggered and generated response is auto submitted back.
setting this value to 0 (default), disables auto logic, so that end user can review the tool calls requested by ai and if needed even modify them, before triggering/executing them as well as review and modify results generated by the tool call, before submitting them back to the ai.

View File

@ -692,7 +692,6 @@ class MultiChatUI {
this.curChatId = "";
this.TimePeriods = {
ToolCallResponseTimeout: 10000,
ToolCallAutoTimeUnit: 1000
}
@ -978,7 +977,7 @@ class MultiChatUI {
this.timers.toolcallResponseTimeout = setTimeout(() => {
this.elInUser.value = ChatMessageEx.createToolCallResultAllInOne(toolCallId, toolname, `Tool/Function call ${toolname} taking too much time, aborting...`);
this.ui_reset_userinput(false)
}, this.TimePeriods.ToolCallResponseTimeout)
}, gMe.tools.toolCallResponseTimeoutMS)
}
}
@ -1086,6 +1085,11 @@ class Me {
fetchProxyUrl: "http://127.0.0.1:3128",
searchUrl: SearchURLS.duckduckgo,
toolNames: /** @type {Array<string>} */([]),
/**
* Control how many milliseconds to wait for tool call to respond, before generating a timed out
* error response and giving control back to end user.
*/
toolCallResponseTimeoutMS: 20000,
/**
* Control how many seconds to wait before auto triggering tool call or its response submission.
* A value of 0 is treated as auto triggering disable.