[PR #28912] feat(services): add workflow validation, LLM memory, output filter, email auth, and UI layout services #32233

Closed
opened 2026-02-21 20:51:00 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/28912

State: closed
Merged: No


Summary

This PR introduces five new service modules to enhance Dify's capabilities for workflow management, LLM operations, authentication, and UI rendering.

New Services

1. WorkflowValidationService (workflow_validation_service.py)

Comprehensive workflow validation including:

  • Node configuration validation
  • Connection graph validation
  • Cycle detection in workflow graphs
  • Resource limit validation
  • Input/output type compatibility checking

2. LLMOutputFilterService (llm_output_filter_service.py)

Streaming output filtering for LLM nodes:

  • Real-time streaming content filtering
  • Pattern-based content replacement
  • Sensitive data masking (emails, phones, API keys)
  • Format normalization
  • Configurable filter chains

3. LLMMemoryEnhancementService (llm_memory_enhancement_service.py)

Enhanced memory management for LLM nodes:

  • Conversation history management with token limits
  • Automatic memory summarization for long conversations
  • Context window optimization
  • Sliding window memory with importance scoring
  • Memory compression strategies

4. EmailAuthService (email_auth_service.py)

Case-insensitive email authentication:

  • Email format validation and normalization
  • Case-insensitive email matching for login
  • Domain validation and blocking
  • Disposable email detection
  • Email verification token management
  • Rate limiting for email operations

5. UILayoutService (ui_layout_service.py)

UI layout management utilities:

  • Form layout management and validation
  • Responsive width calculations
  • Layout state persistence
  • Component visibility management
  • Dynamic form field rendering
  • Layout adaptation for different contexts

Related Issues

  • Closes #13738 (Enhancement of LLM Node Memory Function)
  • Closes #14270 (Streaming Output Filter for LLM Nodes)
  • Closes #17313 (Case insensitive email login)
  • Closes #17603 (Form width adaptation in template conversion)

Testing

  • All files pass ruff check linting
  • Code follows project conventions and typing standards

Contribution by Gittensor, learn more at https://gittensor.io/

**Original Pull Request:** https://github.com/langgenius/dify/pull/28912 **State:** closed **Merged:** No --- ## Summary This PR introduces five new service modules to enhance Dify's capabilities for workflow management, LLM operations, authentication, and UI rendering. ## New Services ### 1. WorkflowValidationService (`workflow_validation_service.py`) Comprehensive workflow validation including: - Node configuration validation - Connection graph validation - Cycle detection in workflow graphs - Resource limit validation - Input/output type compatibility checking ### 2. LLMOutputFilterService (`llm_output_filter_service.py`) Streaming output filtering for LLM nodes: - Real-time streaming content filtering - Pattern-based content replacement - Sensitive data masking (emails, phones, API keys) - Format normalization - Configurable filter chains ### 3. LLMMemoryEnhancementService (`llm_memory_enhancement_service.py`) Enhanced memory management for LLM nodes: - Conversation history management with token limits - Automatic memory summarization for long conversations - Context window optimization - Sliding window memory with importance scoring - Memory compression strategies ### 4. EmailAuthService (`email_auth_service.py`) Case-insensitive email authentication: - Email format validation and normalization - Case-insensitive email matching for login - Domain validation and blocking - Disposable email detection - Email verification token management - Rate limiting for email operations ### 5. UILayoutService (`ui_layout_service.py`) UI layout management utilities: - Form layout management and validation - Responsive width calculations - Layout state persistence - Component visibility management - Dynamic form field rendering - Layout adaptation for different contexts ## Related Issues - Closes #13738 (Enhancement of LLM Node Memory Function) - Closes #14270 (Streaming Output Filter for LLM Nodes) - Closes #17313 (Case insensitive email login) - Closes #17603 (Form width adaptation in template conversion) ## Testing - All files pass `ruff check` linting - Code follows project conventions and typing standards --- *Contribution by Gittensor, learn more at https://gittensor.io/*
yindo added the pull-request label 2026-02-21 20:51:00 -05:00
yindo closed this issue 2026-02-21 20:51:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32233