fleet-memory/hindsight-api/hindsight_api/extensions
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
..
builtin doc: prepare doc for 0.4.10 (#325) 2026-02-09 11:42:37 +01:00
__init__.py Add on_file_convert_complete extension hook after file-to-markdown conversion (#507) 2026-03-06 09:56:53 +01:00
base.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
context.py fix: run schema migrations in thread to prevent event loop deadlock (#500) 2026-03-05 17:19:51 +01:00
http.py feat: add extension hooks for root routing and error headers (#470) 2026-03-03 10:50:03 +01:00
loader.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
mcp.py feat: add TenantExtension auth to MCP endpoint (#286) 2026-02-06 12:28:05 -07:00
operation_validator.py Add on_file_convert_complete extension hook after file-to-markdown conversion (#507) 2026-03-06 09:56:53 +01:00
tenant.py feat: add extension hooks for root routing and error headers (#470) 2026-03-03 10:50:03 +01:00