refactor(chatbot): enhance EvoaiService with OpenAI integration

- Integrated OpenAI service into the EvoaiService to streamline audio message transcription.
- Updated the constructor to initialize OpenaiService, allowing for direct transcription of audio messages.
- Refactored audio message handling to utilize the OpenAI service for improved reliability and maintainability.
- Adjusted the processing logic to handle transcription results more effectively, ensuring fallback content is provided when transcription fails.

This commit focuses on enhancing the EvoaiService's capabilities by leveraging OpenAI for audio transcription, improving overall service functionality and code structure.
This commit is contained in:
Davidson Gomes
2025-05-21 22:27:59 -03:00
parent 6a0fc19702
commit 5b817028a9
2 changed files with 19 additions and 23 deletions

View File

@@ -45,11 +45,11 @@ export class ChannelStartupService {
this.chatwootCache,
);
public typebotService = new TypebotService(waMonitor, this.configService, this.prismaRepository);
public openaiService = new OpenaiService(waMonitor, this.prismaRepository, this.configService);
public difyService = new DifyService(waMonitor, this.configService, this.prismaRepository);
public typebotService = new TypebotService(waMonitor, this.configService, this.prismaRepository, this.openaiService);
public difyService = new DifyService(waMonitor, this.configService, this.prismaRepository, this.openaiService);
public setInstance(instance: InstanceDto) {
this.logger.setInstance(instance.instanceName);