fleet-memory/hindsight-api/hindsight_api/engine/parsers
Chris Bartholomew 1d17dea2f1
Add on_file_convert_complete extension hook after file-to-markdown conversion (#507)
* Add file upload API with parser selection and conversion hooks

- Add FileRetainRequest.parser field for per-request parser selection
- Add FileConvertResult dataclass and on_file_convert_complete extension hook
- Fire hook after file-to-markdown conversion with output text for metering
- Fix obstore.Bytes incompatibility with httpx in Iris parser (GCS returns
  obstore.Bytes instead of plain bytes)
- Export new types from extensions __init__

* remove parser field from FileRetainRequest API

Parser selection remains server-side only via HINDSIGHT_API_FILE_PARSER config.

* test: add tests for on_file_convert_complete extension hook

Verifies that the hook is called with correct parameters on success,
called once per file for multi-file uploads, and not called when
file conversion fails.

* test: verify tenant_id propagation to on_file_convert_complete hook

---------

Co-authored-by: Nicolò Boschi <boschi1997@gmail.com>
2026-03-06 09:56:53 +01:00
..
__init__.py feat: add iris as file parser (#395) 2026-02-18 14:09:56 +01:00
base.py feat: add iris as file parser (#395) 2026-02-18 14:09:56 +01:00
iris.py Add on_file_convert_complete extension hook after file-to-markdown conversion (#507) 2026-03-06 09:56:53 +01:00
markitdown.py feat: accept pdf, images and office files (#390) 2026-02-17 18:15:03 +01:00