feat(chatbot): implement base chatbot structure and enhance integration capabilities

- Introduced a base structure for chatbot integrations, including BaseChatbotController and BaseChatbotService.
- Added common DTOs for chatbot settings and data to streamline integration processes.
- Updated existing chatbot controllers (Dify, Evoai, N8n) to extend from the new base classes, improving code reusability and maintainability.
- Enhanced media message handling across integrations, including audio transcription capabilities using OpenAI's Whisper API.
- Refactored service methods to accommodate new message structures and improve error handling.
This commit is contained in:
Guilherme Gomes
2025-05-17 16:22:13 -03:00
parent d3ee370bdc
commit 69b4f1aa02
13 changed files with 2152 additions and 3229 deletions

View File

@@ -1,38 +1,13 @@
import { $Enums, TriggerOperator, TriggerType } from '@prisma/client';
import { BaseChatbotDto, BaseChatbotSettingDto } from '../../base-chatbot.dto';
export class DifyDto {
enabled?: boolean;
description?: string;
export class DifyDto extends BaseChatbotDto {
// Dify specific fields
botType?: $Enums.DifyBotType;
apiUrl?: string;
apiKey?: string;
expire?: number;
keywordFinish?: string;
delayMessage?: number;
unknownMessage?: string;
listeningFromMe?: boolean;
stopBotFromMe?: boolean;
keepOpen?: boolean;
debounceTime?: number;
triggerType?: TriggerType;
triggerOperator?: TriggerOperator;
triggerValue?: string;
ignoreJids?: any;
splitMessages?: boolean;
timePerChar?: number;
}
export class DifySettingDto {
expire?: number;
keywordFinish?: string;
delayMessage?: number;
unknownMessage?: string;
listeningFromMe?: boolean;
stopBotFromMe?: boolean;
keepOpen?: boolean;
debounceTime?: number;
difyIdFallback?: string;
ignoreJids?: any;
splitMessages?: boolean;
timePerChar?: number;
export class DifySettingDto extends BaseChatbotSettingDto {
// Dify specific fields
}