Skip to content

Commit 121e2fe

Browse files
committed
updated lite
1 parent 54db35c commit 121e2fe

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

embd_res/klite.embd

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Current version indicated by LITEVER below.
1212
-->
1313

1414
<script id="init-config">
15-
const LITEVER = 287;
15+
const LITEVER = 288;
1616
const urlParams = new URLSearchParams(window.location.search);
1717
var localflag = urlParams.get('local'); //this will be replaced automatically in embedded kcpp
1818
const STORAGE_PREFIX = (localflag?"e_":"")+"kaihordewebui_";
@@ -6099,15 +6099,24 @@ Current version indicated by LITEVER below.
60996099
}
61006100
else if (dch.message) {
61016101
synchro_polled_response = dch.message.content;
6102+
let reasoningtxt = "";
61026103
if(dch.message.reasoning_content!=null && dch.message.reasoning_content!="") //vllm compat
6104+
{
6105+
reasoningtxt = dch.message.reasoning_content;
6106+
}
6107+
else if(dch.message.reasoning!=null && dch.message.reasoning!="") //vllm compat
6108+
{
6109+
reasoningtxt = dch.message.reasoning;
6110+
}
6111+
if(reasoningtxt!="")
61036112
{
61046113
if(dch.message.content==null)
61056114
{
6106-
synchro_polled_response = dch.message.reasoning_content;
6115+
synchro_polled_response = reasoningtxt;
61076116
}
61086117
else
61096118
{
6110-
synchro_polled_response = `${localsettings.start_thinking_tag}${dch.message.reasoning_content}${localsettings.stop_thinking_tag}${dch.message.content}`;
6119+
synchro_polled_response = `${localsettings.start_thinking_tag}${reasoningtxt}${localsettings.stop_thinking_tag}${dch.message.content}`;
61116120
}
61126121
}
61136122

@@ -6254,6 +6263,11 @@ Current version indicated by LITEVER below.
62546263
streaming_was_thinking = true;
62556264
synchro_pending_stream += event.data.choices[0].delta.reasoning_content;
62566265
}
6266+
else if(event.data.choices[0].delta && !event.data.choices[0].delta.content && event.data.choices[0].delta.reasoning!=null&& event.data.choices[0].delta.reasoning!="")
6267+
{
6268+
streaming_was_thinking = true;
6269+
synchro_pending_stream += event.data.choices[0].delta.reasoning;
6270+
}
62576271

62586272
//mistral prefill interception
62596273
if(oaiemulatecompletionscontent!="" && synchro_pending_stream!="" && synchro_pending_stream.startsWith(oaiemulatecompletionscontent))

0 commit comments

Comments
 (0)