Spaces:
Build error
Build error
Commit History
-
fix: make ingestion and querying robust; add acceptance-test corpus
Shubham Pawar +1: Claude Sonnet 5Issues found while building an end-to-end test corpus and running it against the live API (see docs/fixes/2026-09-05-ingestion-and-event-loop-blocking.md): Ingestion - Markdown ingest returned HTTP 500 in offline / strict-TLS environments: UnstructuredMarkdownLoader downloads a spaCy model at runtime. Switched .md/.markdown to TextLoader (markdown is chunked as plain text anyway). - A single ingest/query froze the whole worker: async handlers ran the synchronous load->chunk->embed->store / retrieve->LLM work on the event loop. Moved it to run_in_threadpool; stream() driven via iterate_in_threadpool. /health now stays ~1ms responsive during a 5.5s ingest (was blocked ~4.75s). - /api/ingest had no upload limits. Added MAX_UPLOAD_FILES / MAX_FILE_SIZE_MB / MAX_TOTAL_UPLOAD_MB, enforced before any work, returning HTTP 413. - Embedding model now warmed in the lifespan startup hook instead of stalling the first request. Querying - Groq model llama-3.3-70b-versatile is decom…c8f7f2e
-
feat: add streaming responses and error handling
- Add ErrorHandlerMiddleware for global error catching - Add RequestLoggingMiddleware for request timing - Add RateLimitMiddleware for abuse prevention - Update /api/query/stream with SSE format350b79e