Spaces:
Sleeping
Sleeping
Commit History
-
Migrate to Ruff for linting/formatting and add comprehensive import tests
ming- Replace black, isort, and flake8 with ruff (Rust-based, 10-100x faster) - Add ruff.toml configuration with appropriate rules and ignores - Update pre-commit hook to run ruff check --fix and ruff format before tests - Update CLAUDE.md documentation with new ruff commands - Fix code style issues (nested if statements, formatting) - Add comprehensive import tests (test_imports.py) to catch import errors early - Fix config.py to ignore extra environment variables (prevents build failures) - Format all code with ruff (18 files reformatted) - Auto-fix 32 linting issues - Fix remaining test linting issues (B017, SIM117, B023) Benefits: - Single tool instead of three (black/isort/flake8) - Faster pre-commit hooks - Better CI/CD performance - Automatic import validation before deployment29ed661
-
feat: Implement V3 Web Scraping + Summarization API
ming✨ New Features: - Add V3 API endpoint: POST /api/v3/scrape-and-summarize/stream - Backend web scraping with trafilatura (95%+ success rate) - In-memory TTL-based caching (1 hour default, configurable) - User-agent rotation to avoid anti-scraping measures - Metadata extraction (title, author, date, site_name) - SSRF protection (blocks localhost and private IPs) - Streaming SSE response with metadata + content chunks 📦 New Components: - ArticleScraperService: High-quality article extraction - SimpleCache: In-memory cache with TTL and max size - V3 Router: Complete API implementation with validation - V3 Schemas: Request/response models with security validators 🧪 Testing: - 30 new tests (100% passing) - Cache tests: TTL, expiration, thread safety - Scraper tests: Success, timeouts, validation - API tests: Security (SSRF), error handling, streaming format 📝 Documentation: - Updated CLAUDE.md with V3 details - Updated README.md with V3 usage examples - Added V3_SCRAPING_IMPLEMENTATION…2ed2bd7
-
Fix all remaining test failures - 100% test success
ming- Fixed timeout calculation timing (calculated before truncation, not after) - Updated config defaults to match actual implementation - Fixed log message format expectations - Corrected test environment variables - All 97 tests now pass successfully Key fixes: - Timeout calculations use original text length before truncation - Server host default corrected to 0.0.0.0 - Model name consistency across tests - Log format expectations aligned with actual implementation8ca285d
-
feat: Add text streaming support with SSE
ming- Add summarize_text_stream() async generator method to OllamaService - Implement /api/v1/summarize/stream endpoint with Server-Sent Events - Add StreamChunk schema for streaming response documentation - Comprehensive test coverage with TDD approach (11 new tests) - Android-friendly SSE format for real-time text streaming - Maintains backward compatibility with existing non-streaming endpoint - Proper error handling with SSE error events - Manual verification with curl confirms working implementation Closes: Streaming text summarization feature request6e01ea3
-
Optimize timeout configuration for better performance
ming🚀 Timeout Optimizations: - Reduced base timeout from 120s to 60s - Reduced scaling factor from +10s to +5s per 1000 chars - Reduced maximum cap from 300s to 120s - Updated all tests to reflect new timeout values ✅ Benefits: - Faster failure detection for stuck requests - More reasonable timeout values for typical use cases - Still provides dynamic scaling for large text - Prevents extremely long waits (100+ seconds) 📊 New Timeout Formula: - Base: 60 seconds - Scaling: +5 seconds per 1000 characters over 1000 - Maximum: 120 seconds (2 minutes) - Example: 10,000 chars = 60 + (9 * 5) = 105 seconds This addresses the 100+ second timeout issue while maintaining the dynamic timeout system for large text processing.2c658eb -
Add comprehensive unit tests for all production-ready features
ming✅ Dynamic Timeout System Tests: - Test timeout scaling based on text length - Test maximum timeout cap (300s) - Test base timeout for small text - Test logging of timeout calculations - Test improved error messages ✅ Better Error Handling Tests: - Test 504 Gateway Timeout for timeout errors (not 502) - Test 502 Bad Gateway for HTTP errors - Test 500 Internal Server Error for unexpected errors - Test helpful error messages with guidance ✅ 502 Bad Gateway Prevention Tests: - Test that timeout errors return 504 instead of 502 - Test dynamic timeout calculation formula - Test large text processing with extended timeouts - Test timeout capping for very large text - Test successful processing of large text ✅ Robust Startup Script Tests: - Test script existence and executability - Test .env file creation with defaults - Test Ollama service health checks - Test model availability validation - Test process cleanup functionality - Test port verification - Test helpful user feedback ✅ Service…0497d92
-
chore: initialize FastAPI backend project structure and testing setup
ming9024ad9