This commit addresses an issue with the dify agent integration by updating it to use a streaming response mode. This allows for handling message data in smaller chunks, improving performance and reducing memory usage. The commit also includes updates to the CHANGELOG.md file and the dify.service.ts file, where the actual changes were implemented.
Changes made:
- Added `instanceId` to sessions in DifyService, OpenaiService, and TypebotService to ensure that sessions are individual per instance and remoteJid.
- Decreased delay time in BaileysStartupService from 2000ms to 1000ms.
The bug fix ensures that sessions are unique per instance and remoteJid, which improves the overall functionality of the application. The delay time reduction in BaileysStartupService speeds up the pairing code request process.
The modified files are DifyService, OpenaiService, TypebotService, and BaileysStartupService.
Corrected an issue with connecting to the instance by updating the connection status in the Whatsapp Baileys service.
Modified files:
- Whatsapp Baileys service (src/api/services/channels/whatsapp.baileys.service.ts)
Modified: index.router.ts, whatsapp.baileys.service.ts
Fixed an issue with connecting to the instance by modifying the code in index.router.ts and whatsapp.baileys.service.ts. This change resolves a critical problem that was preventing the application from connecting to the necessary instance.
This commit introduces a new feature that transcribes audio messages to text using OpenAI's Whisper model. The following files were modified to implement this feature:
- `CHANGELOG.md`: Added a new entry under the 'Features' section to document the speech-to-text functionality.
- `prisma/postgresql-schema.prisma`: Added a new boolean field `speechToText` to the `OpenaiSetting` model.
- `src/api/integrations/openai/dto/openai.dto.ts`: Added a new optional boolean property `speechToText` to the `OpenaiSettingDto` class.
- `src/api/integrations/openai/services/openai.service.ts`: Implemented the `speechToText` method to handle the transcription process.
- `src/api/integrations/openai/validate/openai.schema.ts`: Added a new required boolean schema for the `speechToText` property in the `openaiSettingSchema`.
- `src/api/integrations/typebot/services/typebot.service.ts`: Updated the `audioMessage` property to consider the new `speechToText` field.
- `src/api/services/channels/whatsapp.baileys.service.ts` and `src/api/services/channels/whatsapp.business.service.ts`: Added logic to handle the transcription of audio messages when the `speechToText` setting is enabled.
The purpose of this change is to provide a more accessible way for users to interact with audio messages by converting them to text. This improvement will be particularly useful for users with hearing impairments or those in noisy environments.