fix: sandbox non-stream response not sent due to @Res() express native mode

- sandbox.controller.ts: non-stream chat path now calls res.json() instead
  of returning the value (which NestJS discards in @Res() library mode)
- ai-gateway.service.ts: 商汤科技 only registers sensenova model, no longer
  overwrites deepseek registration
- .gitignore: add .playwright-mcp/ and gitea-login.png
This commit is contained in:
TradeMate Dev
2026-06-23 23:21:28 +08:00
parent f4f17c10d8
commit 8a86334d05
3 changed files with 14 additions and 12 deletions
+10 -11
View File
@@ -69,17 +69,16 @@ export class AIGatewayService {
if (!apiUrl.endsWith('/chat/completions')) {
apiUrl = apiUrl.replace(/\/+$/, '') + '/chat/completions';
}
const models = ['deepseek-v4-flash', 'sensenova-6.7-flash-lite'];
for (const modelName of models) {
this.providers.set(modelName, new OpenAICompatibleProvider(
process.env.SENSENOVA_API_KEY!,
apiUrl,
modelName,
'商汤科技',
));
this.markAvailable(modelName);
}
this.logger.log(`商汤科技已注册: ${models.join(', ')}`);
// 商汤科技仅注册 sensenova 自有模型,避免覆盖硅基流动的 deepseek 注册
const modelName = 'sensenova-6.7-flash-lite';
this.providers.set(modelName, new OpenAICompatibleProvider(
process.env.SENSENOVA_API_KEY!,
apiUrl,
modelName,
'商汤科技',
));
this.markAvailable(modelName);
this.logger.log(`商汤科技已注册: ${modelName}`);
}
}
@@ -35,7 +35,8 @@ export class SandboxController {
}
res.end();
} else {
return this.sandboxService.chat(req.user.userId, body.conversationId, body.model, body.messages, body, body.images);
const result = await this.sandboxService.chat(req.user.userId, body.conversationId, body.model, body.messages, body, body.images);
res.json(result);
}
}