Spaces:
Runtime error
Runtime error
| # Configuration Refactoring: Global Geography Integration | |
| ## Overview | |
| This document outlines the refactoring done to eliminate redundancy between global geography configuration and OMIRL tool-specific configuration, establishing a single source of truth for geographic data. | |
| ## Changes Made | |
| ### 1. Global Geography Configuration (`/agent/config/geography.yaml`) | |
| - **Status**: β Centralized source of truth for all geographic data | |
| - **Contains**: | |
| - Province names, codes, and mappings | |
| - Alert zones and descriptions | |
| - Comuni by province (to be populated) | |
| - Regional information for Liguria | |
| ### 2. OMIRL Local Configuration (`/tools/omirl/config/parameters.yaml`) | |
| - **Status**: β Refactored to remove redundancies | |
| - **Removed**: | |
| - `provinces` section (now loaded from global config) | |
| - `alert_zones` section (now loaded from global config) | |
| - **Preserved**: | |
| - OMIRL-specific sensor types | |
| - Time periods | |
| - Climate variables | |
| - Satellite areas | |
| - Task URL mappings | |
| ### 3. OMIRL Validator (`/tools/omirl/shared/validation.py`) | |
| - **Status**: β Updated to use global geography configuration | |
| - **Changes**: | |
| - Added `_load_geography_config()` method | |
| - Loads geographic data from `/agent/config/geography.yaml` | |
| - Maintains backward compatibility with existing validation API | |
| - Preserves task-specific province format conversion (codes vs names) | |
| ## Architecture Benefits | |
| ### β Single Source of Truth | |
| - All geographic data centralized in `/agent/config/geography.yaml` | |
| - Eliminates duplicate maintenance of province and alert zone data | |
| - Consistent data across all tools and components | |
| ### β Separation of Concerns | |
| - **Global Config**: Geographic data used by routing and multiple tools | |
| - **Tool Config**: Tool-specific parameters and settings | |
| - **Validation**: Task-specific format requirements and rules | |
| ### β Backward Compatibility | |
| - OMIRL validator API remains unchanged | |
| - All existing validation functionality preserved | |
| - Province format conversion still works correctly: | |
| - `valori_stazioni`: "Genova" β "GE" (codes) | |
| - `massimi_precipitazione`: "genova" β "Genova" (proper names) | |
| ## Configuration Flow | |
| ``` | |
| Global Geography Config | |
| β | |
| Agent Router System | |
| β | |
| Tool Registry | |
| β | |
| OMIRL Validator | |
| β | |
| Task-Specific Validation | |
| ``` | |
| ## Testing Verification | |
| All validation functionality tested and confirmed working: | |
| - β Province validation with case-insensitive matching | |
| - β Task-specific format conversion (codes vs names) | |
| - β Alert zone validation | |
| - β Complete agent routing flow | |
| - β LLM prompt building with dynamic geography data | |
| ## Future Considerations | |
| 1. **Additional Tools**: New tools can easily leverage the global geography configuration | |
| 2. **Data Updates**: Geographic data updates only need to be made in one place | |
| 3. **Extensibility**: Easy to add new geographic entities (regions, zones, etc.) | |
| 4. **Validation**: Centralized validation rules can be applied consistently | |
| ## Summary | |
| The refactoring successfully eliminates configuration redundancy while maintaining full functionality. The system now has a clean separation between global geographic data and tool-specific parameters, making the codebase more maintainable and extensible. | |