feat(processing): Integrate response processing methods into ProcessingService and update module config for backend API

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
autocommit 2026-04-19 02:18:39 -07:00
parent 89dd63e2e6
commit ce86e81a97
2 changed files with 13 additions and 0 deletions

View file

@ -6,6 +6,7 @@ import { ProcessingController } from './processing.controller';
import { ProcessingService } from './processing.service';
import { MessageEntity } from '@/entities';
import { ResponsesModule } from '@/modules/responses';
import { ScreeningModule } from '@/modules/screening';
@Module({
@ -16,6 +17,7 @@ import { ScreeningModule } from '@/modules/screening';
maxRedirects: 0,
}),
ScreeningModule,
ResponsesModule,
],
controllers: [ProcessingController],
providers: [ProcessingService],

View file

@ -10,6 +10,7 @@ import { Repository, IsNull } from 'typeorm';
import { MessageEntity, MessageType, RawMessageData } from '@/entities';
import { ScreeningService } from '@/modules/screening/screening.service';
import { ResponsesService } from '@/modules/responses/responses.service';
/** Base directory for attachment storage */
const ATTACHMENTS_DIR = process.env.ATTACHMENTS_DIR || '/mnt/bigdisk/_/lilith-platform/features/conversation-assistant/attachments';
@ -66,6 +67,8 @@ export class ProcessingService {
private readonly httpService: HttpService,
@Optional() @Inject(ScreeningService)
private readonly screeningService?: ScreeningService,
@Optional() @Inject(ResponsesService)
private readonly responsesService?: ResponsesService,
) {}
/**
@ -187,6 +190,14 @@ export class ProcessingService {
this.logger.warn(`Screening failed for message ${message.id}: ${err instanceof Error ? err.message : 'Unknown'}`);
});
}
// Auto-generate response drafts for incoming messages from known contacts (non-blocking)
if (text && text.length > 0 && message.direction === 'incoming' && message.senderId && this.responsesService) {
this.responsesService.generateSuggestions(message.id, message.senderId)
.catch((err) => {
this.logger.warn(`Auto-draft failed for message ${message.id}: ${err instanceof Error ? err.message : 'Unknown'}`);
});
}
}
/**