diff --git a/.gitignore b/.gitignore index db4e4cd..c3ba762 100755 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,8 @@ out/ # Environment files .env .env.local +.playwright-mcp/ +gitea-login.png .env.*.local backend/.env frontend/.env.local diff --git a/backend/src/modules/ai/ai-gateway.service.ts b/backend/src/modules/ai/ai-gateway.service.ts index e58f350..8322260 100755 --- a/backend/src/modules/ai/ai-gateway.service.ts +++ b/backend/src/modules/ai/ai-gateway.service.ts @@ -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}`); } } diff --git a/backend/src/modules/sandbox/sandbox.controller.ts b/backend/src/modules/sandbox/sandbox.controller.ts index 516c101..06049ee 100755 --- a/backend/src/modules/sandbox/sandbox.controller.ts +++ b/backend/src/modules/sandbox/sandbox.controller.ts @@ -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); } }