mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-16 23:45:33 +01:00
🐳 feat: Deepseek Reasoning UI (#5440)
This commit is contained in:
parent
b8b7f40e98
commit
7818ae5c60
4 changed files with 55 additions and 1 deletions
|
|
@ -1292,6 +1292,12 @@ ${convo}
|
|||
let reasoningCompleted = false;
|
||||
for await (const chunk of stream) {
|
||||
if (chunk?.choices?.[0]?.delta?.reasoning_content) {
|
||||
if (reasoningTokens.length === 0) {
|
||||
const thinkingDirective = ':::thinking\n';
|
||||
intermediateReply.push(thinkingDirective);
|
||||
reasoningTokens.push(thinkingDirective);
|
||||
onProgress(thinkingDirective);
|
||||
}
|
||||
const reasoning_content = chunk?.choices?.[0]?.delta?.reasoning_content || '';
|
||||
intermediateReply.push(reasoning_content);
|
||||
reasoningTokens.push(reasoning_content);
|
||||
|
|
@ -1301,7 +1307,7 @@ ${convo}
|
|||
const token = chunk?.choices?.[0]?.delta?.content || '';
|
||||
if (!reasoningCompleted && reasoningTokens.length > 0 && token) {
|
||||
reasoningCompleted = true;
|
||||
const separatorTokens = '\n\n---\n';
|
||||
const separatorTokens = '\n:::\n';
|
||||
reasoningTokens.push(separatorTokens);
|
||||
onProgress(separatorTokens);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue