Skip to content

IAV-252/refactor: Implement category-based instruction management architecture

salaheddine zidani a demandé de fusionner feature/IAV-252 vers develop

Overview

This MR introduces a significant architectural change to the instruction management system by implementing a category-based hierarchy for standard instructions and improving the response structure for custom instructions.

Key Changes

🏗️ Architecture

  • Introduced AgentStandardInstructionCategory entity to organize instructions hierarchically
  • Instructions are now automatically initialized when agents are created
  • All standard instructions are grouped by categories

🔄 API Changes (Breaking)

Custom Instructions

  • GET /agents/agent-custom-instructions/agent/{agentUid} now returns grouped response:
    • Separates suggestions and restrictions
    • Includes agent information and statistics
    • Response type: AgentCustomInstructionsByCategoryResponse

Standard Instructions

  • GET /agents/agent-standard-instructions/agent/{agentUid} returns category hierarchy
  • POST /agent-standard-instructions is now a bulk update endpoint (not creation)
  • New category-level endpoints:
    • PATCH /{categoryUid}/activate
    • PATCH /{categoryUid}/deactivate
  • Removed: Individual instruction retrieval by UID

New Features

  • Automatic instruction initialization during agent creation
  • Bulk configuration update with category and instruction-level control
  • Category-level activation/deactivation
  • Enhanced statistics in custom instruction responses

🔧 Refactoring

  • Consolidated validation logic in AgentValidationHelper
  • Simplified initializeDefaultLanguages by accepting agent entity
  • Removed redundant languagesCount validation parameter
  • Improved error handling with helper methods

Related Issues

Closes IAV-252

Rapports de requête de fusion