feat(chat): ✨ Introduce new chat service methods and enhance module config for message persistence and real-time updates
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
251f9ba30d
commit
fa826b3955
2 changed files with 6 additions and 4 deletions
|
|
@ -4,13 +4,14 @@ import { ChatController } from './chat.controller';
|
|||
import { ConversationTitleService } from './conversation-title.service';
|
||||
import { AiCoreClient } from '../../clients/ai-core.client';
|
||||
import { ModelBossClient } from '../../clients/model-boss.client';
|
||||
import { SpeechSynthesisClient } from '../../clients/speech-synthesis.client';
|
||||
import { SessionModule } from '../session/session.module';
|
||||
import { VoiceSharedModule } from '../voice/voice-shared.module';
|
||||
|
||||
@Module({
|
||||
imports: [SessionModule, VoiceSharedModule],
|
||||
controllers: [ChatController],
|
||||
providers: [ChatService, ConversationTitleService, AiCoreClient, ModelBossClient],
|
||||
exports: [AiCoreClient, ModelBossClient],
|
||||
providers: [ChatService, ConversationTitleService, AiCoreClient, ModelBossClient, SpeechSynthesisClient],
|
||||
exports: [AiCoreClient, ModelBossClient, SpeechSynthesisClient],
|
||||
})
|
||||
export class ChatModule {}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { TtsPipeline } from '@lilith/tts-pipeline';
|
|||
import type { SynthesizedSegment } from '@lilith/tts-pipeline';
|
||||
import { AiCoreClient } from '../../clients/ai-core.client';
|
||||
import { ModelBossClient } from '../../clients/model-boss.client';
|
||||
import { SpeechSynthesisClient } from '../../clients/speech-synthesis.client';
|
||||
import { SessionService } from '../session/session.service';
|
||||
import { ConversationTitleService } from './conversation-title.service';
|
||||
import { VoiceSessionStore } from '../voice/voice-session.store';
|
||||
|
|
@ -34,6 +35,7 @@ export class ChatService {
|
|||
private readonly titleService: ConversationTitleService,
|
||||
private readonly aiCore: AiCoreClient,
|
||||
private readonly modelBoss: ModelBossClient,
|
||||
private readonly speechSynthesis: SpeechSynthesisClient,
|
||||
private readonly voiceSessionStore: VoiceSessionStore,
|
||||
) {}
|
||||
|
||||
|
|
@ -159,13 +161,12 @@ export class ChatService {
|
|||
return new TtsPipeline(
|
||||
// Synthesize: parallel — all requests fire immediately
|
||||
async (segment) => {
|
||||
const result = await this.modelBoss.synthesizeTts({
|
||||
return this.speechSynthesis.synthesizeTts({
|
||||
text: segment.text,
|
||||
voiceId: segment.ttsParams.voiceId,
|
||||
exaggeration: segment.ttsParams.exaggeration,
|
||||
cfgWeight: segment.ttsParams.cfgWeight,
|
||||
});
|
||||
return result;
|
||||
},
|
||||
// Deliver: called in order by the pipeline after pacing
|
||||
(segment: SynthesizedSegment) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue