Commit Graph

22 Commits

Author SHA1 Message Date
Judson Cairo
1059c92583 Unification of integrations, Typebot & OpenAI & Dify 2024-08-14 17:47:31 -03:00
Judson Cairo
32e58debc6 Path mapping & deps fix & bundler changed to tsup 2024-08-11 20:47:17 -03:00
Davidson Gomes
e7ff09752e fix: StopBotFromMe working with chatwoot 2024-08-09 09:55:50 -03:00
Davidson Gomes
56a165db54 feat: added general session button in typebot, dify and openai in manager 2024-08-08 23:14:51 -03:00
Davidson Gomes
6f2971cf24 feat: function for openai assistant added 2024-08-08 19:35:32 -03:00
Davidson Gomes
26a974a239 feat: function for openai assistant added 2024-08-08 18:47:52 -03:00
Davidson Gomes
2aa0e08ae4 fix: Added description column on typebot, dify and openai 2024-08-03 13:51:24 -03:00
Davidson Gomes
9c5eb4bfd1 fix: Session is now individual per instance and remoteJid
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.
2024-08-03 13:36:31 -03:00
Davidson Gomes
7ad96f54ca fix: update typebot, openai and dify 2024-08-02 19:42:54 -03:00
Davidson Gomes
3fa6b1fcc5 fix: get models openai 2024-08-02 10:49:06 -03:00
Davidson Gomes
67409e1bf5 Add speech-to-text functionality using OpenAI
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.
2024-08-01 17:15:20 -03:00
Davidson Gomes
8118c68dce v2.0.4-rc 2024-07-30 17:07:45 -03:00
Davidson Gomes
bb65b566e5 chore: Update dify and openai services
Modified the implementation of Dify and OpenAI services to improve overall functionality. These changes aim to enhance the stability and performance of the integration layer, although no new features have been added.

Changes affected the following files:
- dify.service.ts
- openai.service.ts
2024-07-30 15:38:27 -03:00
Davidson Gomes
a5d72a0dfd feat: Integration with Dify
Adds support for Dify integration, including new routes, services, and controllers. The configuration for Dify has been added to the environment file, and the necessary changes have been made to the `.env.example` file. Additionally, the WhatsApp Baileys service has been updated to handle Dify notifications.

Modified files:
- `.env.example`
- `package.json`
- `src/api/integrations/openai/services/openai.service.ts`
- `src/api/routes/index.router.ts`
- `src/api/server.module.ts`
- `src/api/services/channel.service.ts`
- `src/api/services/channels/whatsapp.baileys.service.ts`
- `src/config/env.config.ts`
- `src/validate/validate.schema.ts`

Introduced files:
- `src/api/integrations/dify/`
- `src/api/integrations/dify/controllers/dify.controller.ts`
- `src/api/integrations/dify/dto/dify.dto.ts`
- `src/api/integrations/dify/routes/dify.router.ts`
- `src/api/integrations/dify/services/dify.service.ts`
- `src/api/integrations/dify/validate/dify.schema.ts`
2024-07-30 13:34:35 -03:00
Davidson Gomes
5047e6281a fix: Correct openai session deletion and pause functionality
This commit fixes an issue where openai sessions were not being properly deleted or paused. It updates the `openai.service.ts` and `openai.schema.ts` files to correctly handle session deletion and pausing.

The `openai.service.ts` file now includes additional checks for session status before deleting or updating. The `openai.schema.ts` file has been updated to include a new 'delete' status option.

These changes ensure that openai sessions are properly managed and that the bot can be paused and resumed as intended. This improves the overall functionality and user experience of the application.
2024-07-29 19:07:26 -03:00
Davidson Gomes
7bfb4f93bb Fix: Corrected openai trigger validation
Corrected an issue in the validation of openai triggers by changing the 'findFirst' method to 'findMany' and implementing a loop to find the correct trigger match. This change improves the accuracy of trigger validation and ensures that all possible matches are considered.

Impact: This fix ensures that the correct trigger is identified, improving the overall functionality of the openai integration.

Affected files:
- openai.service.ts
2024-07-29 17:29:55 -03:00
Davidson Gomes
2a7f9698d2 fix: adjusts for new manager 2024-07-29 15:09:40 -03:00
Davidson Gomes
d00e3677f5 chore: adjust TriggerType for OpenAI and Typebot integrations
Modifies the TriggerType enum to include a 'none' option and updates the OpenAI and Typebot services to handle this new option. Additionally, the services now require a trigger operator and value when the trigger type is set to 'keyword'.

Modified files:
- prisma/postgresql-schema.prisma
- src/api/integrations/openai/services/openai.service.ts
- src/api/integrations/typebot/services/typebot.service.ts

Untracked file:
- prisma/migrations/20240729115127_modify_trigger_type_openai_typebot_table/
2024-07-29 08:53:15 -03:00
Davidson Gomes
c1d3209f2f chore: equations and adjustments for the new manager 2024-07-23 12:34:58 -03:00
Davidson Gomes
f8e303f3a3 fix: Implement open chat completion and refactor code
Remove unnecessary initialization of empty arrays for systemMessages, assistantMessages, and userMessages in OpenaiService.
Also, implement a function to handle open chat completion and refactor the code for better readability and maintainability.
Affected files: openai.service.ts
2024-07-18 21:33:21 -03:00
Davidson Gomes
51749e8712 feat: Open AI assistants implemented 2024-07-18 21:11:46 -03:00
Davidson Gomes
29b9e688a8 chore: Crud openai complete 2024-07-18 10:14:53 -03:00