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.
This commit introduces a new feature, dify tables, along with related migration scripts. The `prisma/migrations/20240730152156_create_dify_tables/migration.sql` file contains the migration for creating the dify tables, while the `prisma/postgresql-schema.prisma` file has been modified to include the necessary schema changes for these tables. This change improves data organization and simplifies data management for the project.
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/
Adds webhookUrl field to Message model, SendMessageDto, SendTemplateDto, SendContactDto, and related services to enable sending messages to a specified webhook URL. This change allows for more flexible message handling and delivery options.
Modified files:
- prisma/postgresql-schema.prisma
- src/api/dto/sendMessage.dto.ts
- src/api/services/channels/whatsapp.business.service.ts
- src/validate/message.schema.ts
Untracked files:
- prisma/migrations/20240723200254_add_webhookurl_on_message/
This commit introduces a new openai integration in the project, along with necessary changes in the database schema. The package.json file has been updated to include the openai package, and the prisma/postgresql-schema.prisma file has been modified to include OpenaiCreds, OpenaiAssistant, OpenaiAssistantThread, and OpenaiChatCompletion models. These models will handle the integration with OpenAI's API for various tasks.
Some of the key changes include:
- Addition of OpenaiCreds model to manage API credentials.
- Addition of OpenaiAssistant model to handle OpenAI assistant instances.
- Addition of OpenaiAssistantThread model to manage OpenAI assistant threads.
- Addition of OpenaiChatCompletion model to handle OpenAI chat completions.
These changes will enable seamless integration with OpenAI's API and allow for better management of assistant instances, threads, and chat completions.
Adds support for MinIO and S3 for storing media files. Modified several files to implement this feature, including package.json, prisma/postgresql-schema.prisma, src/api/integrations/typebot/services/typebot.service.ts, src/api/routes/index.router.ts, src/api/services/channels/whatsapp.baileys.service.ts, and src/config/env.config.ts. Added untracked files for the new S3 integration. Also added a new S3Controller and S3Service for handling S3 related operations.
This change allows for more flexible media storage options and enables the use of MinIO or S3 for storing media files.
Implements the ability to ignore specific JIDs in the Typebot integration, improving the flexibility of the feature. This change includes modifications in the Prisma schema, DTOs, services, and validation schema.
- Adds 'ignoreJids' field to the PostgreSQL schema (prisma/postgresql-schema.prisma).
- Updates TypebotDto and TypebotSettingDto to include 'ignoreJids' (src/api/integrations/typebot/dto/typebot.dto.ts).
- Modifies TypebotService to handle 'ignoreJids' when creating and updating Typebot instances (src/api/integrations/typebot/services/typebot.service.ts).
- Adds 'ignoreJids' to the Typebot validation schema (src/api/integrations/typebot/validate/typebot.schema.ts).
This update allows for more precise control over which JIDs are processed by the Typebot integration, reducing unnecessary processing and improving performance.
This commit removes the Template model, including its related functionality, from the project. The template table has been removed from the database schema, and all related functions and methods in the template service have been deleted. This change was made because the project now uses the persistence of the meta, eliminating the need for a separate template model.
Please note that this change may affect other parts of the application that rely on the Template model. Ensure that all necessary adjustments have been made before merging this commit.
The Issue:
The Instance model in the postgresql-schema.prisma file previously had a Template field that was a single Template object, but this caused issues with the association of multiple templates to a single instance.
The Change:
This commit resolves the issue by changing the Template field to an array of Template objects. This allows for multiple templates to be associated with a single instance.
The Impact:
This change allows for more flexible use of templates in the system and resolves a previous limitation in the association of templates to instances.
Affected Files:
- prisma/postgresql-schema.prisma
- src/api/services/template.service.ts
Note: The migration folder added in the untracked files section is a result of the Prisma schema change and can be safely ignored in this commit message.
This commit introduces changes to support managing WhatsApp templates using the official WhatsApp Business API. The following modifications have been made:
- Implemented a new Template model in the Prisma schema, including fields for template ID, name, language, and associated Instance (business ID, instance ID, and created/updated timestamps).
- Modified the Instance model in the Prisma schema to include a Template relationship.
- Updated InstanceController to include a new `businessId` property in the InstanceDto.
- Added a new TemplateRouter, TemplateController, and TemplateService to handle template-related requests and services.
- Updated the WebhookService to utilize the new TemplateService.
- Added new TypebotController, WebhookController, and WAMonitoringService methods to handle template-related events.
- Updated the validate schema to include a new template schema.
The main goal of this commit is to enable managing WhatsApp templates, including creating, updating, and deleting templates, as well as associating them with specific instances.