IAV-252/refactor: Implement category-based instruction management architecture
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
AgentStandardInstructionCategoryentity 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-instructionsis now a bulk update endpoint (not creation) - New category-level endpoints:
PATCH /{categoryUid}/activatePATCH /{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
initializeDefaultLanguagesby accepting agent entity - Removed redundant
languagesCountvalidation parameter - Improved error handling with helper methods
Related Issues
Closes IAV-252