mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-07 03:49:15 +08:00
* feat: integrate liteparse as a document parsing engine * feat: implement background task dispatching for knowledge base processing - Added `_dispatch_background_task` to run long-running tasks on a separate daemon thread, preventing blocking of the main event loop during knowledge base ingestion. - Updated `upload_files` and `create_knowledge_base` functions to utilize the new background task dispatching method. - Implemented rollback functionality for partially created knowledge bases in case of failures during file saving. - Enhanced tests to verify the correct offloading of file saving and background task execution. * update * docs: add Open Source Partners section with PageIndex * docs: replace partner blurb with PageIndex promo code * docs: link PageIndex subscription to developer portal * docs: point PageIndex logo at its GitHub repo * fix: harden Responses stream parsing (#825) * fix: remove obsolete Typer extra (#817) * fix: normalize RAG citation payloads (#808) * fix: decouple mastery paths from chat sessions (#810) * fix(parsing): hold LiteParse to the workdir contract The engine landed with three knobs that could not work as written: - ``extract_images`` was gated on a user-supplied ``image_output_dir`` that defaulted to empty, so image extraction never ran. Even when set, images landed outside ``images/`` and the Markdown kept LiteParse's bare ```` names, so the cache loader saw neither. Images now go to the workdir's ``images/`` like the PyMuPDF4LLM engine, links are rewritten to ``images/<name>``, and an empty dir is removed. - ``output_format`` was selectable, but the parse always writes ``.md``; picking JSON or text produced a mislabelled document. Pinned to Markdown and dropped from the settings slice. - ``image_output_dir`` was a free-text path joined onto the workdir. Removed with the rest. Also: normalize the slice with the shared coercers (a bare ``bool()`` reads the string ``"false"`` as True), allow-list ``image_mode``, pass ``quiet`` and ``ocr_failure_fatal=False`` so a systemic OCR failure degrades to recovered text instead of losing the document, pin the extra to ``<3.0``, and keep the engine lists in the three tests that assert them exactly. Excludes the unrelated background-task/rollback/off-loop changes this branch carried in ``api/routers/knowledge.py``: dev already routes uploads through ``_save_uploaded_files_off_loop``, and the rest is a separate change that deserves its own review. --------- Co-authored-by: chenhj <hanjiang.chen@1stcs.cn> Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>