mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 09:15:18 +02:00
updated lite
This commit is contained in:
+42
-17
@@ -6304,20 +6304,21 @@ Current version indicated by LITEVER below.
|
||||
}
|
||||
}
|
||||
|
||||
// now fix final assist tag with an assist gen tag if applicable
|
||||
replaceDone = false;
|
||||
let memoryEtIndex = memory.lastIndexOf(et);
|
||||
let promptEtIndex = prompt.lastIndexOf(et);
|
||||
if(prompt && promptEtIndex!=-1 && localsettings.instruct_gentag)
|
||||
{
|
||||
prompt = replaceLast(prompt,et,localsettings.instruct_gentag.replaceAll("\\n", "\n"));
|
||||
replaceDone = true;
|
||||
}
|
||||
if(!replaceDone && memory && memoryEtIndex!=-1 && localsettings.instruct_gentag)
|
||||
{
|
||||
memory = replaceLast(memory,et,localsettings.instruct_gentag.replaceAll("\\n", "\n"));
|
||||
replaceDone = true;
|
||||
}
|
||||
}
|
||||
|
||||
// now fix final assist tag with an assist gen tag if applicable
|
||||
let replaceDone = false;
|
||||
let memoryEtIndex = memory.lastIndexOf(et);
|
||||
let promptEtIndex = prompt.lastIndexOf(et);
|
||||
if(prompt && promptEtIndex!=-1 && localsettings.instruct_gentag)
|
||||
{
|
||||
prompt = replaceLast(prompt,et,localsettings.instruct_gentag.replaceAll("\\n", "\n"));
|
||||
replaceDone = true;
|
||||
}
|
||||
if(!replaceDone && memory && memoryEtIndex!=-1 && localsettings.instruct_gentag)
|
||||
{
|
||||
memory = replaceLast(memory,et,localsettings.instruct_gentag.replaceAll("\\n", "\n"));
|
||||
replaceDone = true;
|
||||
}
|
||||
|
||||
return {"memory":memory,"prompt":prompt};
|
||||
@@ -8974,6 +8975,30 @@ Current version indicated by LITEVER below.
|
||||
throw err;
|
||||
})
|
||||
}
|
||||
function mcp_content_has_media(content)
|
||||
{
|
||||
if(!Array.isArray(content))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for(let i=0;i<content.length;++i)
|
||||
{
|
||||
let item = content[i];
|
||||
if(!item || typeof item!=="object")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if(item.type==="image_url" || item.type==="input_audio")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(item.type==="text" && typeof item.text==="string" && item.text.indexOf("data:image")!==-1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//MCP HTTP client code
|
||||
const MCP_PROTOCOL_VER = "2025-11-25";
|
||||
@@ -9357,7 +9382,7 @@ Current version indicated by LITEVER below.
|
||||
let tgt = replaceStringsInObject(response.content[i], """, "\""); //we must remove existing escaped quotes or things break later
|
||||
outitems.push(tgt);
|
||||
}
|
||||
callresp.content = JSON.stringify(outitems);
|
||||
callresp.content = mcp_content_has_media(outitems) ? outitems : JSON.stringify(outitems);
|
||||
}
|
||||
callresptxt += JSON.stringify(callresp);
|
||||
if(toolcall_obj.tool_calls.length < 2)
|
||||
@@ -33881,12 +33906,12 @@ Current version indicated by LITEVER below.
|
||||
<div class="popuptitletext">Edit Custom Tool</div>
|
||||
</div>
|
||||
<div class="menutext">
|
||||
<div class="settinglabel"><div class="justifyleft"> Tool Name: </div><input class="push-right" title="Tool Name" type="text" placeholder="Enter the tool's name (e.g. read_diary)" style="width: calc(100% - 250px);" id="customtooleditor_name"></div>
|
||||
<div class="settinglabel"><div class="justifyleft"> Tool Name: </div><input class="push-right" title="Tool Name" type="text" placeholder="Enter the tool's name (e.g. read_diary)" style="width: calc(100% - 100px);" id="customtooleditor_name"></div>
|
||||
<div class="settinglabel"><div class="justifyleft"> Description: </div><textarea class="form-control menuinput_multiline" title="Description" placeholder="Details on when and how to use the tool (e.g. Read the contents of the diary)" id="customtooleditor_description"></textarea></div>
|
||||
<br>
|
||||
<div class="settinglabel"><div class="justify-center"> Edit parameters JSON directly <span class="helpicon">?<span class="helptext">When checked, you must manually specify the JSON schema for the tool's input arguments.</span></span> <input type="checkbox" title="Edit Parameters JSON directly?" id="customtooleditor_editparametersjsondirectly" onchange="customtooleditor_parameters_toggle()"></div></div>
|
||||
<div class="settinglabel hidden" id="customtooleditor_parametersjsoncontainer"><textarea class="form-control menuinput_multiline" title="Parameters JSON" placeholder="{ type:'object', properties:{}, additionalProperties:false }" id="customtooleditor_parametersjson"></textarea></div>
|
||||
<div id="customtooleditor_parameterstemplatecontainer">
|
||||
<div class="settinglabel" id="customtooleditor_parameterstemplatecontainer">
|
||||
</div>
|
||||
<div class="settinglabel"><div class="justifyleft"> Function Body: </div><textarea class="form-control menuinput_multiline" title="Function Body" placeholder="Javascript source code for the function (e.g. return String( localsettings.diary || 'The diary is empty' ); )" rows="5" id="customtooleditor_functionbody"></textarea></div>
|
||||
<div class="settinglabel"><div class="justifyleft"> Is Asynchronous (returns a Promise)?: <input type="checkbox" title="Is Asynchronous?" id="customtooleditor_asynchronous"></div></div>
|
||||
|
||||
Reference in New Issue
Block a user