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:
@@ -13,6 +13,8 @@ out/
|
|||||||
# Environment files
|
# Environment files
|
||||||
.env
|
.env
|
||||||
.env.local
|
.env.local
|
||||||
|
.playwright-mcp/
|
||||||
|
gitea-login.png
|
||||||
.env.*.local
|
.env.*.local
|
||||||
backend/.env
|
backend/.env
|
||||||
frontend/.env.local
|
frontend/.env.local
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ export class AIGatewayService {
|
|||||||
if (!apiUrl.endsWith('/chat/completions')) {
|
if (!apiUrl.endsWith('/chat/completions')) {
|
||||||
apiUrl = apiUrl.replace(/\/+$/, '') + '/chat/completions';
|
apiUrl = apiUrl.replace(/\/+$/, '') + '/chat/completions';
|
||||||
}
|
}
|
||||||
const models = ['deepseek-v4-flash', 'sensenova-6.7-flash-lite'];
|
// 商汤科技仅注册 sensenova 自有模型,避免覆盖硅基流动的 deepseek 注册
|
||||||
for (const modelName of models) {
|
const modelName = 'sensenova-6.7-flash-lite';
|
||||||
this.providers.set(modelName, new OpenAICompatibleProvider(
|
this.providers.set(modelName, new OpenAICompatibleProvider(
|
||||||
process.env.SENSENOVA_API_KEY!,
|
process.env.SENSENOVA_API_KEY!,
|
||||||
apiUrl,
|
apiUrl,
|
||||||
@@ -78,8 +78,7 @@ export class AIGatewayService {
|
|||||||
'商汤科技',
|
'商汤科技',
|
||||||
));
|
));
|
||||||
this.markAvailable(modelName);
|
this.markAvailable(modelName);
|
||||||
}
|
this.logger.log(`商汤科技已注册: ${modelName}`);
|
||||||
this.logger.log(`商汤科技已注册: ${models.join(', ')}`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ export class SandboxController {
|
|||||||
}
|
}
|
||||||
res.end();
|
res.end();
|
||||||
} else {
|
} 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user