feat: 初步支持文本模型

This commit is contained in:
foxhui
2025-12-16 17:50:29 +08:00
Unverified
parent 1c4fc1a314
commit 92c0e3c420
12 changed files with 1014 additions and 33 deletions
+3
View File
@@ -135,13 +135,16 @@ export function createQueueManager(queueConfig, callbacks) {
}
// 发送成功响应
logger.info('服务器', '准备发送响应...', { id, isStreaming, contentLength: finalContent.length });
if (isStreaming) {
const chunk = buildChatCompletionChunk(finalContent, modelName);
sendSse(res, chunk);
sendSseDone(res);
logger.info('服务器', '流式响应已结束', { id });
} else {
const response = buildChatCompletion(finalContent, modelName);
sendJson(res, 200, response);
logger.info('服务器', 'JSON 响应已发送', { id });
}
} catch (err) {