SimpleChatTC:ResultMaxDataLength, Desc

Allow user to limit the max amount of result data returned to ai
after a tool call.

Inturn it is set by default to 2K.

Update the pdf2text tool description to try make the local file
path support more explicit
This commit is contained in:
hanishkvc 2025-11-01 23:52:42 +05:30
parent dfeb94d3f6
commit 21544eaf87
2 changed files with 12 additions and 3 deletions

View File

@ -1091,7 +1091,11 @@ class MultiChatUI {
clearTimeout(this.timers.toolcallResponseTimeout)
this.timers.toolcallResponseTimeout = undefined
let chat = this.simpleChats[cid];
chat.add(new ChatMessageEx(Roles.ToolTemp, ChatMessageEx.createToolCallResultAllInOne(tcid, name, data)))
let limitedData = data
if (gMe.tools.iResultMaxDataLength > 0) {
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)) {
if (gMe.tools.auto > 0) {
this.timers.toolcallResponseSubmitClick = setTimeout(()=>{
@ -1336,6 +1340,11 @@ class Me {
proxyAuthInsecure: "NeverSecure",
searchUrl: SearchURLS.duckduckgo,
toolNames: /** @type {Array<string>} */([]),
/**
* Control the length of the tool call result data returned to ai after tool call.
* A value of 0 is treated as unlimited data.
*/
iResultMaxDataLength: 2048,
/**
* 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.

View File

@ -278,13 +278,13 @@ let pdf2text_meta = {
"type": "function",
"function": {
"name": "pdf2text",
"description": "Fetch pdf from requested web / file path url through a proxy server and return its text content after converting pdf to text, in few seconds",
"description": "Read pdf from requested local file / web url through a proxy server and return its text content after converting pdf to text, in few seconds",
"parameters": {
"type": "object",
"properties": {
"url":{
"type":"string",
"description":"local file / web (http/https) based url of the pdf that will be got and inturn converted to text to an extent"
"description":"local file path / web (http/https) based url of the pdf that will be got and inturn converted to text to an extent"
}
},
"required": ["url"]