fix: qwen thinking toggle and recall log styles

This commit is contained in:
2026-02-08 18:12:55 +08:00
parent b4e181caea
commit 8fdce7b9a1
4 changed files with 147 additions and 324 deletions

View File

@@ -29,7 +29,7 @@ function b64UrlEncode(str) {
/**
* 统一LLM调用 - 走酒馆后端(非流式)
* 修复:assistant prefill 用 bottomassistant 参数传递
* assistant prefill 用 bottomassistant 参数传递
*/
export async function callLLM(messages, options = {}) {
const {
@@ -46,10 +46,10 @@ export async function callLLM(messages, options = {}) {
throw new Error('L0 requires siliconflow API key');
}
// ★ 关键修复:分离 assistant prefill
// 分离 assistant prefill
let topMessages = [...messages];
let assistantPrefill = '';
if (topMessages.length > 0 && topMessages[topMessages.length - 1]?.role === 'assistant') {
const lastMsg = topMessages.pop();
assistantPrefill = lastMsg.content || '';
@@ -70,6 +70,10 @@ export async function callLLM(messages, options = {}) {
apipassword: apiKey,
model: DEFAULT_L0_MODEL,
};
const isQwen3 = String(DEFAULT_L0_MODEL || '').includes('Qwen3');
if (isQwen3) {
args.enable_thinking = 'false';
}
// ★ 用 bottomassistant 参数传递 prefill
if (assistantPrefill) {