fix: add @Optional() to ContentSafetyService in RagChatService
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 41s

Same issue as KnowledgeBaseService — NestJS can't resolve
ContentSafetyService in RagChatModule without @Optional().

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
WangDL 2026-05-24 13:46:30 +08:00
parent 7ae94d9178
commit 0c07b59765

View File

@ -1,4 +1,4 @@
import { Injectable, NotFoundException, Logger } from '@nestjs/common';
import { Injectable, NotFoundException, Logger, Optional } from '@nestjs/common';
import { PrismaService } from '../../infrastructure/database/prisma.service';
import { ContentSafetyService } from '../content-safety/content-safety.service';
@ -8,7 +8,7 @@ export class RagChatService {
constructor(
private readonly prisma: PrismaService,
private readonly safety?: ContentSafetyService,
@Optional() private readonly safety?: ContentSafetyService,
) {}
async createSession(userId: string, knowledgeBaseId: string, title?: string) {