Spaces:
Runtime error
Runtime error
Commit History
-
minor tweak to switch LLM provider from Ollama to Gemini
f001d2b
-
Configured Ollaman and improved llm config functionality: now the default is ollama, the fallback is gemini 2.5 flash lite, and these can be changed modifying just on line in the yaml config file
c46d4a9
-
Remove PNG files from git tracking
f75cbb4 -
fixed caching
7534cf3 -
Merge branch 'omirl_tool'
completed refactoring of omirl tool with service based architecture and 3 tasks: livelli idro massimi precipitazione valori stazion added caching serviceb371164 -
refactor: Complete OMIRL architecture cleanup and modernization
Major Changes: - Removed legacy compat.py (209 lines) - replaced with modern OMIRLAdapter - Refactored valori_stazioni.py to use create_omirl_adapter() - Refactored massimi_precipitazione.py to use create_omirl_adapter() - Fixed URL key bug in omirl_adapter.py (massimi_precipitazioni → massimi_precipitazione) - Removed 24 legacy test files (old architecture tests) - Created test_routing_only.py for LLM routing validation - Created test_task_output.py for full task execution testing - Updated services/web/__init__.py and services/media/__init__.py Architecture Improvements: - Unified caching layer through OMIRLAdapter - Consistent error handling across all OMIRL tasks - Proper separation of concerns (adapter → task modules) - Task attribute correctly used in ToolCall dataclass Testing: - All production code validated working - New routing tests confirm proper task extraction - Legacy test suite cleaned up (24 files removed) - 24 current architecture tests remainb28ba40
-
Fix LLM configuration and OMIRL comune filtering
- Updated Gemini model to models/gemini-2.5-flash-lite with models/ prefix - Removed all hardcoded model names from llm_client.py, llm_router_node.py, env_config.py - All LLM configuration now loaded from llm_router_config.yaml (single source of truth) - Added fallback mechanism to generate_insights() matching routing behavior - Fixed provincia auto-resolution issue: removed unnecessary provincia inference from comune - Comune filtering now works independently without provincia requirement - Enhanced routing prompts for better river query classification (livelli_idrometrici) - Updated OMIRL adapter to load knowledge from parameters.yaml - Fixed tests to use get_omirl_knowledge() instead of static OMIRLKnowledge class Results: ✅ Gemini model working without 404 errors ✅ Both routing and insights generation use Gemini successfully ✅ Fallback to OpenAI working when needed ✅ Comune=Genova now returns 10 river stations (was 0) ✅ All configuration centralized in YAML filesa5fe16b -
Merge omirl_refactor: Complete OMIRL refactoring with livelli_idrometrici
This merge brings in a comprehensive refactoring of the OMIRL integration: Architecture improvements: - YAML-based configuration (parameters.yaml, tasks.yaml) - Adapter-level caching for all tasks (unified approach) - Generic web scraping components (browser, table scrapers) - Task-based routing (removed mode parameter) - Response templates and formatting system New features: - livelli_idrometrici task (river water level monitoring) - Async cache support (handles coroutines properly) - LLM summarization node - Geographic resolver with YAML-based data - Comprehensive test suite (15k+ lines of tests) Performance: - 120-40,000x speedup with caching across all OMIRL tasks - Clean separation of concerns (scraping, caching, formatting) - Better error handling and recovery All tests passing ✅54faadd -
feat: Add livelli_idrometrici task with unified adapter-level caching
- Implement complete livelli_idrometrici task with threshold analysis * Scrape 57 hydrometric stations across 5 alert zones (A-E) * Real threshold data from Regione Liguria CSV * Geographic filtering (zona, provincia, comune, bacino, corso_acqua) * Smart query detection (generic vs specific queries) * Status-based alerting (red, yellow, near_yellow, normal) - Refactor caching to adapter level for consistency * Move caching from task-level to OMIRLAdapter.fetch_data() * Single source of truth for ALL OMIRL task caching * Consistent cache keys and TTL management across tasks - Add async cache support * New get_cached_async() method in cache service * Properly handles coroutines with inspect.iscoroutine() * Works seamlessly with both sync and async data functions - Comprehensive test coverage * E2E tests with realistic user queries * Caching performance tests (all 3 tasks) * Integration tests for threshold analysis * Output formatting tests - Performance …b5bd850
-
Fix task output and test infrastructure
- Fixed artifact generation parameter error in tools/omirl/adapter.py - Fixed metadata storage issue in tools/omirl/tables/massimi_precipitazione.py - Added comprehensive full flow test in tests/agent/full/test_full_flow.py - Added configuration viewer and navigator utilities - Added documentation for config-driven architecture - Created test infrastructure for agent refactoring validation - All tests now show formatted task output correctly connecting to LLM processing8bd860c -
feat: Complete OMIRL configuration refactoring - eliminate hardcoded values
This commit implements a comprehensive refactoring of the OMIRL tool to eliminate all hardcoded elements and implement a configuration-driven architecture. ## Changes Made: ### Step 1: Task List Configuration - Added valid_tasks section to parameters.yaml (7 tasks vs 2 hardcoded) - Modified OMIRLValidator.get_valid_tasks() to load from configuration - Updated adapter.py to use configuration-based task validation ### Step 2: Source URLs from Configuration - Added task_urls section to parameters.yaml - Modified OMIRLValidator.get_task_url() to load from configuration - Updated task implementations to use validator for URL retrieval ### Step 3: Time Periods Configuration - Enhanced time_periods section in parameters.yaml (17 variations) - Modified massimi_precipitazione.py to use configuration-based periods - Added validation and fallback mechanisms ### Step 4: Period Mappings Configuration - Added comprehensive period_mappings section (36 normalization rules) - Implemented OMIRLVali…f56aac7 -
feat: remove mode parameter from OMIRL tool - implement direct task-based routing
✨ Major refactoring to simplify OMIRL tool interface: 🔧 OMIRL Tool Changes: - Remove 'mode' parameter from adapter function signature - Update tool specification to remove mode property - Simplify input contract to use task-only routing - Update documentation and examples 🧠 Agent Integration: - Update prompts to generate mode-free routing instructions - Clean up LLM router examples and templates - Maintain backward compatibility in agent workflow 🛠️ Validation & Config: - Disable mode validation logic in YAML validator - Remove mode-related error messages - Update task validation to work without mode dependency - Fix validation calls in task modules 📋 Task Modules: - Update valori_stazioni and massimi_precipitazione - Remove mode parameter from validation calls - Maintain all existing functionality 📚 Documentation: - Update OMIRL specification to reflect task-based architecture - Remove mode references from all examples - Update input/output format documentation 🧪 Tests: - …009cf19
-
feat: Complete agent architecture refactoring and testing framework
## Major Architecture Improvements ### 🏗️ Enhanced ToolCall Structure - Added explicit 'task' field to ToolCall dataclass - Eliminated confusion between tool selection and task selection - Removed deprecated 'subtask' terminology throughout codebase ### ⚙️ Configuration Architecture Refactoring - Created centralized geography.yaml config (provinces, municipalities, alert zones) - Added tool_registry.yaml for tool registration and management - Enhanced llm_router_config.yaml with task-specific prompts - Eliminated legacy services/geographic/ resolver ### 🔧 Tool Interface Standardization - Updated OMIRL adapter to use 'task' parameter (not 'subtask') - Added default period logic: massimi_precipitazione defaults to '1h' when not specified - Enhanced parameter normalization (15m → 15' mapping) - Improved error handling and validation ### 🧪 Comprehensive Testing Framework - Added complete end-to-end flow tests (no mocks) - Tests cover: Query → LLM Router → Tool Execution → Response G…fbd9fda
-
🎯 Complete OMIRL web services refactoring with workflow enhancement
Major changes: • Complete architectural refactoring: separated generic web scraping from OMIRL-specific logic • Fixed geographic filtering bug: corrected filters now properly applied in valori_stazioni.py • Enhanced agent workflow: added LLM summarization step between tool execution and response generation • Fixed LLM client AttributeError: added client property to expose _client attribute • Removed 933 lines of legacy code (browser.py, table_scraper.py) after successful migration • Created comprehensive new architecture with full backward compatibility New Architecture: ✅ services/web/base.py - Abstract interfaces and base classes ✅ services/web/generic_browser.py - Configurable browser management ✅ services/web/generic_table.py - Flexible table extraction ✅ services/web/configs/omirl_config.py - All OMIRL knowledge preserved ✅ services/web/adapters/omirl_adapter.py - OMIRL implementation using generic components ✅ services/web/compat.py - Backward compatibility layer Bug Fixes: 🔧 …36f8fda
-
Phase 4: Implement LLM-based summarization node
🚀 Major Features: - New llm_summarization_node() in agent/nodes.py for intelligent data analysis - Enhanced LLMClient with generate_insights() method for data summarization - Complete Phase 4 architecture: task-specific formatting → LLM insights → response generation 🧪 Comprehensive Testing: - 5/5 unit tests for LLM summarization node with mock LLM clients - End-to-end integration tests for temperature and precipitation workflows - Enhanced test visibility showing complete workflow phases - Mock testing framework for API-free validation 📊 OMIRL Improvements: - Removed task-agnostic summarization (replaced with task-specific formatting) - Enhanced precipitation data parsing and formatting - Improved station data formatting with scenario-based output - Updated adapter to use direct task formatting (no LLM dependency) 🔧 Architecture Enhancements: - Clean separation: LLM summarization adds insights, response generation handles formatting - Graceful LLM failure handling - workflow co…bcda1ac
-
🧹 Major cleanup: Remove obsolete code, modernize task-agnostic architecture
## 🗑️ Removed Obsolete Code - Remove `services/text/summarization.py` (300+ lines) - replaced by task-agnostic service - Remove `tools/omirl/services_tables.py` (300+ lines) - replaced by new task modules - Remove `tests/test_omirl_implementation.py` - replaced by dedicated task tests ## ✨ Modernized Architecture - **Task-Agnostic Summarization**: All tasks now use unified LLM-based summarization - **Station Data Analysis**: Added `analyze_station_data()` for valori_stazioni insights - **Trend Analysis**: Fixed temporal ordering bug in precipitation trend detection - **Cleaner Adapter**: Removed legacy province conversion and complex summary handling ## 🎯 Enhanced Features - **Rich LLM Summaries**: Both tasks generate intelligent operational insights - valori_stazioni: Geographic distribution, temperature ranges, notable stations - massimi_precipitazione: Trend analysis, peak detection, operational recommendations - **Standardized Formats**: TaskSummary and DataInsights across …a34989b -
docs: Update TODO for next development session
🎯 Current Status: - OMIRL Phase 1 refactor complete with commit 7a1055a - All tests passing (7/7 comprehensive test suites) - Real data extraction validated (199 precipitation stations) - Geographic filtering behavior confirmed (AND logic working) 🚀 Next Priorities: 1. Test cleanup and organization (HIGH) 2. Agent state and node updates (HIGH) 3. New OMIRL tasks implementation (MEDIUM) 4. Enhanced services (MEDIUM) 📋 Ready for next development session with solid foundation established.51dab89 -
feat: Complete OMIRL Phase 1 refactor - YAML-based validation architecture
✨ New Architecture Features: - Modular package structure (tables/, maps/, sensori/, shared/) - YAML-based configuration system for flexible validation - Clean separation of concerns with OMIRLFilterSet, OMIRLResult, OMIRLValidator - Comprehensive parameter validation with auto-correction and suggestions - Backward compatibility maintained for existing integrations 🔧 Core Components: - tools/omirl/shared/: Core data types and validation system - tools/omirl/config/: YAML configuration files (parameters, validation rules, mode/tasks) - tools/omirl/tables/valori_stazioni.py: Refactored table extraction using new architecture - tools/omirl/adapter.py: Updated to use new components while maintaining tool interface 📋 Testing & Validation: - Comprehensive test suites (7 new test files) - All tests passing (adapter integration, architecture validation, filtering behavior) - Real data extraction validated (199 precipitation, 184 temperature, 69 Genova stations) - Geographic filtering behavi…7a1055a
-
refactor: Update OMIRL specification with new lean input/output schema
- Replace mode 'radar' with 'sensori' and task 'precipitazione' with 'radar' - Introduce lean, task-agnostic input format with structured filters - Add comprehensive examples for all modes: tables, maps, sensori - Update Tasks section with detailed URLs and behaviors from omirl_site.md - Enhance output format to support multi-mode artifacts (data + images) - Add mode-specific output examples showing format flexibility - Maintain backward compatibility with existing adapter architecturebfc3a79
-
fix: resolve service validation and timeout issues in agent workflow
- Fix LLM router prompts to use correct service name 'station_data' instead of 'table_scraper' - Increase agent timeout from 30s to 60s for web scraping operations - Optimize table scraper wait times (reduce by ~9 seconds total) - Remove redundant tool_planning_node from workflow architecture - Add comprehensive logging with colored output for development - Update LLM configurations to latest model versions (Gemini 1.5, GPT-4o, Claude 3.5) - Add input validation and improved error handling with specific error types - Remove deprecated parsed_intent state field in favor of routing_result - Fix Streamlit CORS configuration and update documentation - Add test scripts for agent validation and debugging Resolves service validation rejection errors and timeout issues when running locally. Agent now successfully processes OMIRL weather queries with proper routing validation. Tested: ✅ Service validation passes ✅ Tool execution completes within timeout8e973ef
-
LLM router and summarization currently working. Fixed agent initialization issues and basic llm-based summarization service
432886f
-
Fix missing get_llm_config import and add comprehensive debugging
- The get_llm_config function was already implemented but missing from some versions - Docker build now succeeds without import errors - Environment debugging shows API keys are being detected correctly - Ready for HF Spaces deploymentb0cebb5 -
Add comprehensive environment debugging for HF Spaces
- Add detailed debugging output for environment variables - Show debug info in Streamlit sidebar - Test direct os.getenv() calls for API keys - Check for HF Space-specific environment variables - Help identify why API keys are not being found in HF Spaces5c1b34a -
Merge branch 'main' of https://github.com/cionny/promptaid-operations
06cf839 -
Fix: Implement lazy agent initialization and improve environment loading
- Add lazy initialization to OperationsAgent (workflow only created on first request) - Update Streamlit app to use proper environment variable loading - Fix CORS warnings in Streamlit config - Add API key status indicators in sidebar - Initialize agent only when user makes their first request - Improve error handling and user feedback This resolves the issues where: 1. Agent workflow was being created immediately on app startup 2. Streamlit was trying to load secrets.toml instead of using environment variables 3. CORS warnings were appearing in HF Spaces deploymentde14028 -
Merge pull request #1 from cionny/simple-llm-router
Simple llm router3f38b5a -
Comprehensive update: LLM Router implementation and Docker fixes
Major Features: - Implemented LLM Router with support for multiple providers (Gemini, OpenAI, Anthropic) - Added LLM router configuration and validation system - New agent architecture with improved state management and nodes - Enhanced geographic services and text summarization capabilities Docker Improvements: - Fixed Playwright installation using 'python -m playwright install chromium' - Added PATH configuration for app user to resolve Streamlit executable issues - Cleaned up system dependencies and removed conflicting environment variables Security & Configuration: - Added pre-commit security hooks for API key protection - Implemented comprehensive secret checking system - Enhanced .gitignore for better security coverage - Added environment configuration management - Fixed API key pattern detection to avoid false positives in code/docs Documentation: - Added deployment guide and progress tracking documents - Documented LLM router progress and integration tasks - Added security s…e45fdd8 -
Fix Docker Playwright installation and Streamlit PATH issues
- Changed playwright installation from 'playwright install' to 'python -m playwright install chromium' - Added /home/app/.local/bin to PATH for app user to make streamlit command available - Removed PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 to allow browser download - Cleaned up system dependencies (removed unavailable packages like libgconf-2-4) - Docker build and container startup now work correctly4b4ef9e
-
Updated the adapter and the agent workflow (node, state, registry etc.). Updated web app, currently supporting omirl scraping
b6145cd -
hard coded the 12 sensor types that were wrong in the table scraper and fixed test that were getting stuck because there was no browser session clean up
5e42519
-
Issues with hf deployment, fixed playright dependencies
e535b57 -
Also updated requirements and docker file. App works locally, need to deploy on hf
89b82c2 -
Set up of the project structure: langgraph and tool based agent. Implemented first tool and task: omirl_snapshot_summary adapter can scrape data from sensorstable omirl. Next step: add tool to agentic framework and deploy to hugging face. Next step: scrape data based on sensor filter.
c7b4c40
-
Add HF space metadata config in readme
17d3b16 -
Initial commit with docker image ready for Hugging Face Spaces deployment
f557cda