Spaces:
Sleeping
Sleeping
Commit History
-
Remove outlines library and all related code
ming- Remove outlines dependency from requirements.txt (NumPy compatibility issue) - Remove outlines import validation from Dockerfile - Remove /stream-json endpoint from V4 API (outlines-based) - Remove all outlines-related code from structured_summarizer.py - Remove outlines import tests - Delete test_v4_live.py (outlines integration tests) - Remove all stream-json endpoint tests from test_v4_api.py This resolves the Hugging Face build failure caused by outlines==0.0.44 incompatibility with newer NumPy versions (ModuleNotFoundError: numpy.lib.function_base). V4 API now only supports /stream and /stream-ndjson endpoints using NDJSON patch-based structured summarization (no external dependencies).d25a17f -
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
-
Add comprehensive unit tests for V4 stream-json endpoint
ming +1: Claude- Added 12 new unit tests for /api/v4/scrape-and-summarize/stream-json endpoint - Created live integration test file (test_v4_live.py) to verify Outlines library - All 24 V4 API tests now passing (previously 13 tests) Test Coverage: Success Cases: - URL mode with metadata - Text mode with metadata - Metadata disabled (include_metadata=false) - Different summarization styles (skimmer, executive, eli5) - Custom max_tokens parameter Error Cases: - Scraping failure (network errors) - Content too short (<100 chars) - SSRF protection (localhost/private IPs blocked) - Input validation (missing/both url+text, invalid style, short text) Additional Tests: - SSE response headers validation - Request ID tracking Outlines Library Investigation: - Discovered Outlines v1.2.9+ has breaking API changes - Installed compatible version (0.0.44) for testing - Documented API compatibility issues - Verified server compiles and starts successfully despite Outlines issues All tests pass with proper mockin…fdb8925
-
feat: Add V4 NDJSON patch-based structured summarization
ming- Refactor StructuredSummarizer with new NDJSON streaming protocol - Add summarize_structured_stream_ndjson() method for patch-based streaming - Implement state management with _empty_state() and _apply_patch() - Update system prompt to instruct model to output NDJSON patches - Add new /api/v4/scrape-and-summarize/stream-ndjson endpoint - Support incremental state updates via delta/state events - Use deterministic decoding (greedy) for consistent results - Maintain backwards compatibility with existing stream endpoint Event structure: - delta: JSON patch object (set/append/done operations) - state: Current accumulated state - done: Completion flag - tokens_used: Token count - latency_ms: Final latency metric Test suite: - test_v4_ndjson_mock.py: Protocol logic validation (PASSED ✅) - test_v4_ndjson_http.py: HTTP endpoint test - test_v4_ndjson_url.py: URL scraping test (PASSED ✅) - test_v4_ndjson.py: Direct service test Documentation: - NDJSON_REFACTOR_SUMMARY.md:…93c9664