mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-13 02:10:39 +02:00
updated lite
This commit is contained in:
+68
-3
@@ -8732,7 +8732,7 @@ Current version indicated by LITEVER below.
|
||||
function togglepalmmodel()
|
||||
{
|
||||
let mdlname = document.getElementById("custom_palm_model").value;
|
||||
if(mdlname=="gemini-1.5-pro-latest" || mdlname=="gemini-1.5-pro-001" || mdlname=="gemini-1.5-pro-002" || mdlname=="gemini-1.5-flash-latest" || mdlname=="gemini-1.5-pro-exp-0801" || mdlname=="gemini-1.5-pro-exp-0827" || mdlname=="gemini-exp-1114")
|
||||
if(mdlname.includes("gemini-1.5-") || mdlname.includes("gemini-exp-"))
|
||||
{
|
||||
document.getElementById("gemini_system_instruction").classList.remove("hidden");
|
||||
if(localsettings.saved_palm_jailbreak=="")
|
||||
@@ -8803,6 +8803,67 @@ Current version indicated by LITEVER below.
|
||||
}
|
||||
toggleoaichatcompl();
|
||||
}
|
||||
function gemini_fetch_models()
|
||||
{
|
||||
let desired_gemini_key = document.getElementById("custom_palm_key").value.trim();
|
||||
if(desired_gemini_key=="")
|
||||
{
|
||||
msgbox("Gemini requires an API key to fetch model list!");
|
||||
return;
|
||||
}
|
||||
|
||||
let dropdown = document.getElementById("custom_palm_model");
|
||||
fetch((default_gemini_base + "?key=" + desired_gemini_key), {
|
||||
method: 'GET',
|
||||
referrerPolicy: 'no-referrer',
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
console.log(data);
|
||||
if (data && data.models && data.models.length > 0)
|
||||
{
|
||||
var lastOption = dropdown.lastElementChild;
|
||||
for (var i = dropdown.options.length - 1; i >= 0; i--) {
|
||||
var option = dropdown.options[i];
|
||||
dropdown.remove(option);
|
||||
}
|
||||
let selidx = 0;
|
||||
for(var i = 0; i < data.models.length; i++) {
|
||||
var opt = data.models[i];
|
||||
var el = document.createElement("option");
|
||||
let optname = opt.name;
|
||||
if(optname.toLowerCase().startsWith("models/"))
|
||||
{
|
||||
optname = optname.substring(7);
|
||||
}
|
||||
el.textContent = optname;
|
||||
el.value = optname;
|
||||
dropdown.appendChild(el);
|
||||
}
|
||||
dropdown.selectedIndex = selidx;
|
||||
togglepalmmodel();
|
||||
}
|
||||
else
|
||||
{
|
||||
let errmsg = "";
|
||||
if(data && data.error)
|
||||
{
|
||||
errmsg = data.error;
|
||||
}
|
||||
else
|
||||
{
|
||||
errmsg = data;
|
||||
}
|
||||
msgbox(JSON.stringify(errmsg),"Error Encountered",false,false);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.log("Error: " + error);
|
||||
msgbox("Error: " + error,"Error Encountered",false,false,()=>{
|
||||
hide_msgbox();
|
||||
});
|
||||
});
|
||||
}
|
||||
function oai_fetch_models()
|
||||
{
|
||||
let desired_oai_key = document.getElementById("custom_oai_key").value.trim();
|
||||
@@ -13473,7 +13534,7 @@ Current version indicated by LITEVER below.
|
||||
};
|
||||
|
||||
let sysinst = document.getElementById("gemini_system_instruction").value;
|
||||
if(sysinst!="" && (mdlname=="gemini-1.5-pro-latest" || mdlname=="gemini-1.5-pro-001" || mdlname=="gemini-1.5-pro-002" || mdlname=="gemini-1.5-flash-latest" || mdlname=="gemini-1.5-pro-exp-0801"))
|
||||
if(sysinst!="" && (mdlname.includes("gemini-1.5-") || mdlname.includes("gemini-exp-")))
|
||||
{
|
||||
payload["systemInstruction"] = {
|
||||
"role": "system",
|
||||
@@ -18883,7 +18944,8 @@ Current version indicated by LITEVER below.
|
||||
<div id="palmcustom" class="aidgpopuplistheader anotelabel hidden">
|
||||
Uses Gemini or PaLM Text Bison by Google.<br><br>
|
||||
Note that KoboldAI Lite takes no responsibility for your usage or consequences of this feature. Your API key is used directly with the Gemini API and is not transmitted to us.<br><br>
|
||||
<select style="padding:4px;" class="form-control" id="custom_palm_model" onchange="togglepalmmodel()">
|
||||
<div>
|
||||
<select style="padding:4px; width:calc(100% - 110px); display:inline-block" class="form-control" id="custom_palm_model" onchange="togglepalmmodel()">
|
||||
<option value="gemini-pro" selected="selected">gemini-pro</option>
|
||||
<option value="gemini-1.5-pro-001">gemini-1.5-pro-001</option>
|
||||
<option value="gemini-1.5-pro-002">gemini-1.5-pro-002</option>
|
||||
@@ -18892,8 +18954,11 @@ Current version indicated by LITEVER below.
|
||||
<option value="gemini-1.5-pro-exp-0801">gemini-1.5-pro-exp-0801</option>
|
||||
<option value="gemini-1.5-pro-exp-0827">gemini-1.5-pro-exp-0827</option>
|
||||
<option value="gemini-exp-1114">gemini-exp-1114</option>
|
||||
<option value="gemini-exp-1121">gemini-exp-1121</option>
|
||||
<option value="text-bison-001">text-bison-001</option>
|
||||
</select>
|
||||
<button type="button" class="btn btn-primary" style="display:inline;width:105px;" id="geminifetchlist" onclick="gemini_fetch_models()">Fetch List</button>
|
||||
</div>
|
||||
<span class="color_green" style="font-weight: bold;">Please input Gemini or PaLM API Key.</span><br><br>
|
||||
<input class="form-control" type="password" id="custom_palm_key" placeholder="PaLM/Gemini API Key (Required)" value="" onfocus="focus_api_keys()" onblur="blur_api_keys()"><br>
|
||||
<textarea class="form-control" rows="3" style="resize: vertical; line-height:1.1; padding:4px; display:inline; width: 100%" type="text" id="gemini_system_instruction" placeholder="(Enter System Instruction)"
|
||||
|
||||
Reference in New Issue
Block a user