fleet-memory/hindsight-clients/python
Nicolò Boschi f903948a26
feat: support timestamp="unset" to retain content without a date (#465)
* feat: support timestamp="unset" to retain content without a date

When callers retain timeless content (e.g. fictional documents, static
reference material), passing timestamp="unset" now skips the utcnow()
default so mentioned_at is stored as NULL instead of an artificial date.

- HTTP: validate_timestamp recognises "unset" sentinel and threads it
  through api_retain as event_date=None (key present, value None), which
  the orchestrator distinguishes from key-absent (still defaults to now)
- Orchestrator: new branching logic separates "key absent" → utcnow()
  from "key present but None" → no date
- types.py: RetainContent.event_date and ProcessedFact.mentioned_at are
  now datetime | None; removed the unused _now_utc factory
- fact_extraction.py: all event_date params accept datetime | None;
  _build_user_message emits "Event Date: Unknown" when None; removed
  mentioned_at from the Fact LLM response model (LLM never sets it)
- embedding_processing: skip date suffix when fact_date is None
- entity_resolver: COALESCE(event_date, now()) for first_seen/last_seen
  so entities table NOT NULL constraint is preserved
- link_utils: skip temporal linking for units without event_date
- Migration aa2b3c4d5e6f: DROP NOT NULL on memory_units.event_date
- Tests: test_retain_no_timestamp and test_retain_omit_timestamp_defaults_to_now
- Docs + OpenAPI + TypeScript client updated

* refactor: replace _TIMESTAMP_UNKNOWN sentinel with plain string comparison

The sentinel object() was only needed to distinguish "unset" from None
at the boundary — but since the field type is datetime | str | None,
"unset" can pass through the validator unchanged and be compared directly.

* chore: regenerate OpenAPI spec and clients after timestamp type change

timestamp field is now datetime | str | None to accept the "unset" sentinel value.
2026-03-02 12:03:23 +01:00
..
.openapi-generator feat: support timestamp="unset" to retain content without a date (#465) 2026-03-02 12:03:23 +01:00
hindsight_client feat: enable bank config API by default (#426) 2026-02-24 08:52:42 +01:00
hindsight_client_api feat: support timestamp="unset" to retain content without a date (#465) 2026-03-02 12:03:23 +01:00
tests fix(python-client): async method parity and server keepalive timeout (#387) 2026-02-17 16:00:14 +01:00
.openapi-generator-ignore rename to hindsight (#2) 2025-11-25 19:28:26 +01:00
openapi-generator-config.yaml doc: changelog for 0.2.0 (and regenerate clients) (#99) 2026-01-05 12:36:29 +01:00
pyproject.toml Release v0.4.14 2026-02-26 18:03:14 +01:00
README.md fix py client 2025-12-05 01:03:07 +01:00

Hindsight Python Client