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
-
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 -
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: 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
-
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 -
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 -
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
-
Updated the adapter and the agent workflow (node, state, registry etc.). Updated web app, currently supporting omirl scraping
b6145cd
-
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
-
Initial commit with docker image ready for Hugging Face Spaces deployment
f557cda