Skip to content

Commit d34c614

Browse files
committed
SimpleChatTC:Cleanup in general
Update readme wrt searchDrops, auto settings ui creation Rename tools-auto to tools-autoSecs, to make it easy to realise that the value represents seconds.
1 parent f00dd90 commit d34c614

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

tools/server/public_simplechat/readme.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ It is attached to the document object. Some of these can also be updated using t
263263

264264
* 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.
265265

266+
* searchDrops - allows one to drop contents of html tags with specified id from the plain text search result.
267+
268+
* specify a list of dicts, where each dict should contain a 'tag' entry specifying the tag to filter like div or p or ... and also a 'id' entry which specifies the id of interest.
269+
266270
* iResultMaxDataLength - specify what amount of any tool call result should be sent back to the ai engine server.
267271

268272
* specifying 0 disables this truncating of the results, and inturn full result will be sent to the ai engine server.
@@ -271,7 +275,7 @@ It is attached to the document object. Some of these can also be updated using t
271275
before a default timed out error response is generated and control given back to end user, for them to decide whether
272276
to submit the error response or wait for actual tool call response further.
273277

274-
* auto - the amount of time in seconds to wait before the tool call request is auto triggered and generated response is auto submitted back.
278+
* autoSecs - the amount of time in seconds to wait before the tool call request is auto triggered and generated response is auto submitted back.
275279

276280
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.
277281

@@ -285,7 +289,7 @@ It is attached to the document object. Some of these can also be updated using t
285289

286290
If you want to add additional options/fields to send to the server/ai-model, and or modify the existing options value or remove them, for now you can update this global var using browser's development-tools/console.
287291

288-
For string, numeric and boolean fields in apiRequestOptions, including even those added by a user at runtime by directly modifying gMe.apiRequestOptions, setting ui entries will be auto created.
292+
For string, numeric, boolean, object fields in apiRequestOptions, including even those added by a user at runtime by directly modifying gMe.apiRequestOptions, setting ui entries will be auto created.
289293

290294
cache_prompt option supported by example/server is allowed to be controlled by user, so that any caching supported wrt system-prompt and chat history, if usable can get used. When chat history sliding window is enabled, cache_prompt logic may or may not kick in at the backend wrt same, based on aspects related to model, positional encoding, attention mechanism etal. However system prompt should ideally get the benefit of caching.
291295

tools/server/public_simplechat/simplechat.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ class MultiChatUI {
762762
this.curChatId = "";
763763

764764
this.TimePeriods = {
765-
ToolCallAutoTimeUnit: 1000
765+
ToolCallAutoSecsTimeUnit: 1000
766766
}
767767

768768
this.timers = {
@@ -840,10 +840,10 @@ class MultiChatUI {
840840
this.elInToolName.dataset.tool_call_id = ar.ns.tool_calls[0].id
841841
this.elInToolArgs.value = ar.ns.tool_calls[0].function.arguments
842842
this.elBtnTool.disabled = false
843-
if ((gMe.tools.auto > 0) && (bAuto)) {
843+
if ((gMe.tools.autoSecs > 0) && (bAuto)) {
844844
this.timers.toolcallTriggerClick = setTimeout(()=>{
845845
this.elBtnTool.click()
846-
}, gMe.tools.auto*this.TimePeriods.ToolCallAutoTimeUnit)
846+
}, gMe.tools.autoSecs*this.TimePeriods.ToolCallAutoSecsTimeUnit)
847847
}
848848
} else {
849849
this.elDivTool.hidden = true
@@ -1066,10 +1066,10 @@ class MultiChatUI {
10661066
}
10671067
chat.add(new ChatMessageEx(Roles.ToolTemp, ChatMessageEx.createToolCallResultAllInOne(tcid, name, limitedData)))
10681068
if (this.chat_show(cid)) {
1069-
if (gMe.tools.auto > 0) {
1069+
if (gMe.tools.autoSecs > 0) {
10701070
this.timers.toolcallResponseSubmitClick = setTimeout(()=>{
10711071
this.elBtnUser.click()
1072-
}, gMe.tools.auto*this.TimePeriods.ToolCallAutoTimeUnit)
1072+
}, gMe.tools.autoSecs*this.TimePeriods.ToolCallAutoSecsTimeUnit)
10731073
}
10741074
}
10751075
this.ui_reset_userinput(false)
@@ -1333,7 +1333,7 @@ class Me {
13331333
* Control how many seconds to wait before auto triggering tool call or its response submission.
13341334
* A value of 0 is treated as auto triggering disable.
13351335
*/
1336-
auto: 0
1336+
autoSecs: 0
13371337
};
13381338
this.chatProps = {
13391339
apiEP: ApiEP.Type.Chat,

0 commit comments

Comments
 (0)