diff --git a/tools/server/public_simplechat/readme.md b/tools/server/public_simplechat/readme.md index 7b98b832ac..326c9120a3 100644 --- a/tools/server/public_simplechat/readme.md +++ b/tools/server/public_simplechat/readme.md @@ -261,7 +261,7 @@ It is attached to the document object. Some of these can also be updated using t * iResultMaxDataLength - specify what amount of any tool call result should be sent back to the ai engine server. - * specifying 0 disables this truncating of the results. + * specifying 0 disables this truncating of the results, and inturn full result will be sent to the ai engine server. * 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 diff --git a/tools/server/public_simplechat/simplechat.js b/tools/server/public_simplechat/simplechat.js index c780373783..317637a59e 100644 --- a/tools/server/public_simplechat/simplechat.js +++ b/tools/server/public_simplechat/simplechat.js @@ -1093,7 +1093,9 @@ class MultiChatUI { let chat = this.simpleChats[cid]; let limitedData = data if (gMe.tools.iResultMaxDataLength > 0) { - limitedData = data.slice(0, gMe.tools.iResultMaxDataLength) + `\n\n\nALERT: Data too long, was chopped ....` + if (data.length > gMe.tools.iResultMaxDataLength) { + limitedData = data.slice(0, gMe.tools.iResultMaxDataLength) + `\n\n\nALERT: Data too long, was chopped ....` + } } chat.add(new ChatMessageEx(Roles.ToolTemp, ChatMessageEx.createToolCallResultAllInOne(tcid, name, limitedData))) if (this.chat_show(cid)) {