mirror of
https://github.com/foxhui/WebAI2API.git
synced 2026-06-16 21:03:59 +08:00
feat: 支持 thinking/reasoning 提取与传递
- respond.js: buildChatCompletion 和 buildChatCompletionChunk 新增 reasoningContent 参数,输出 OpenAI o1 兼容的 reasoning_content 字段 - openai/routes.js: 解析请求体中的 reasoning 布尔标志,prompt 预览扩展到 100 字 - queue.js: 将 reasoning 标志传递给 generate - lmarena_text.js: 解析 SSE 中的 ag: 行提取思考过程 - deepseek_text.js: 识别 THINK fragment 类型,收集 thinking 内容 - gemini_text.js: 从 protobuf 响应的 rc[37] 路径提取 thinking 内容
This commit is contained in:
+2
-2
@@ -94,7 +94,7 @@ export function createQueueManager(queueConfig, callbacks) {
|
||||
* @param {TaskContext} task - 任务上下文
|
||||
*/
|
||||
async function processTask(task) {
|
||||
const { res, prompt, imagePaths, modelId, modelName, id, isStreaming } = task;
|
||||
const { res, prompt, imagePaths, modelId, modelName, id, isStreaming, reasoning } = task;
|
||||
const startTime = Date.now();
|
||||
|
||||
logger.info('服务器', '[队列] 开始处理任务', { id, remaining: queue.length });
|
||||
@@ -133,7 +133,7 @@ export function createQueueManager(queueConfig, callbacks) {
|
||||
}
|
||||
|
||||
// 调用核心生图逻辑 (通过 Pool 分发)
|
||||
const result = await generate(poolContext, prompt, imagePaths, modelId, { id });
|
||||
const result = await generate(poolContext, prompt, imagePaths, modelId, { id, reasoning });
|
||||
|
||||
// 清除心跳
|
||||
if (heartbeatInterval) clearInterval(heartbeatInterval);
|
||||
|
||||
Reference in New Issue
Block a user