refactor: enhance Dify integration with improved validation and message processing

This commit refines the Dify integration by updating the controller and service logic for better functionality and maintainability. Key changes include:
- Added Dify-specific validation in the createBot method to prevent duplicate entries.
- Simplified comments for clarity and removed unused methods in DifyController.
- Enhanced message processing in DifyService to handle audio messages more effectively and improve error handling.
- Updated DifyDto and DifySettingDto to streamline properties and improve clarity.

These updates contribute to a more robust and maintainable Dify integration.
This commit is contained in:
Guilherme Gomes
2025-05-27 17:04:35 -03:00
parent 97ca23a7b0
commit 7682a679d1
3 changed files with 38 additions and 408 deletions

View File

@@ -3,12 +3,11 @@ import { $Enums } from '@prisma/client';
import { BaseChatbotDto, BaseChatbotSettingDto } from '../../base-chatbot.dto';
export class DifyDto extends BaseChatbotDto {
// Dify specific fields
botType?: $Enums.DifyBotType;
apiUrl?: string;
apiKey?: string;
}
export class DifySettingDto extends BaseChatbotSettingDto {
// Dify specific fields
difyIdFallback?: string;
}