fleet-memory/hindsight-clients/python/hindsight_client_api/models
Nicolò Boschi aefb3fcf4d
fix: improve async batch retain with large payloads (#366)
* fix: improve async batch retain with large payloads

* fix: improve async batch retain with large payloads

* api

* api

* api

* api

* api

* Clean up perf benchmark: keep only Python files

- Remove README.md and PERFORMANCE_FINDINGS.md
- Remove results/ JSON files (gitignored)
- Remove test_data/ directory
- Keep only __init__.py and retain_perf.py

* docs: explain automatic batch optimization for async retain

- Add section explaining Hindsight automatically handles batch sizing
- Users don't need to manually tune batch sizes with async mode
- Hindsight splits large batches (>10k tokens) into optimized sub-batches
- Include example showing best practices

* docs: remove emojis and code example from performance page

* fix: correct OperationDetails type to match API response

- Change optional fields to use | null instead of ?
- Fixes TypeScript compilation error in control plane build

* fix: use discriminated union for OperationDetails type

- Support both success and error states properly
- Fixes TypeScript error when setting error state

* fix: use unique document_ids in batch retain examples

- Each item in a batch must have unique document_id
- Update both Python and JavaScript examples
- Fixes test-doc-examples CI failure

* chore: trigger CI

* fix: test mocking and duplicate document_ids in examples

- Mock _get_pool() in test_async_retain_tags.py to avoid _initialized error
- Set _initialized = True on mocked MemoryEngine instances
- Fix duplicate document_ids in retain.py and retain.mjs examples

* fix: properly mock async pool/connection and fix more duplicate document_ids

- Use AsyncMock for pool.acquire() to fix 'can't be used in await' error
- Fix duplicate document_ids in retain-async examples (retain.py and retain.mjs)
- Remove batch-level document_id parameter that caused duplicates

* ci: collect all doc example failures and show summary

- Run all Python/Node.js/CLI examples regardless of individual failures
- Collect failure list and display summary at the end
- Show pass/fail count and list of failed files
- Exit with failure only after running all examples

* refactor: extract doc example testing to standalone script

- Create scripts/test-doc-examples.sh to run all examples
- Collects logs of failed examples separately
- Shows full error logs only for failures at the end
- Clean summary with pass/fail counts
- Proper exit codes
- Replaces inline bash in CI workflow

* fix: doc examples - duplicate document_ids and error handling

- retain.py: move document_id to item level to avoid duplicates
- documents.mjs: add error handling for getDocument to show clear error message

* fix: update tests for duplicate document_id validation

- test_async_retain_tags: verify operation structure instead of exact UUID
- test_delete_bank: use unique document_ids (team-doc-1, team-doc-2)
2026-02-16 12:51:42 +01:00
..
__init__.py fix: improve async batch retain with large payloads (#366) 2026-02-16 12:51:42 +01:00
add_background_request.py Release v0.4.11 2026-02-13 10:52:14 +01:00
async_operation_submit_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
background_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
bank_config_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
bank_config_update.py Release v0.4.11 2026-02-13 10:52:14 +01:00
bank_list_item.py Release v0.4.11 2026-02-13 10:52:14 +01:00
bank_list_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
bank_profile_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
bank_stats_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
budget.py Release v0.4.11 2026-02-13 10:52:14 +01:00
cancel_operation_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
child_operation_status.py fix: improve async batch retain with large payloads (#366) 2026-02-16 12:51:42 +01:00
chunk_data.py Release v0.4.11 2026-02-13 10:52:14 +01:00
chunk_include_options.py Release v0.4.11 2026-02-13 10:52:14 +01:00
chunk_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
consolidation_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
create_bank_request.py Release v0.4.11 2026-02-13 10:52:14 +01:00
create_directive_request.py Release v0.4.11 2026-02-13 10:52:14 +01:00
create_mental_model_request.py Release v0.4.11 2026-02-13 10:52:14 +01:00
create_mental_model_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
delete_document_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
delete_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
directive_list_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
directive_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
disposition_traits.py Release v0.4.11 2026-02-13 10:52:14 +01:00
document_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
entity_detail_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
entity_include_options.py Release v0.4.11 2026-02-13 10:52:14 +01:00
entity_input.py Release v0.4.11 2026-02-13 10:52:14 +01:00
entity_list_item.py Release v0.4.11 2026-02-13 10:52:14 +01:00
entity_list_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
entity_observation_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
entity_state_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
features_info.py Release v0.4.11 2026-02-13 10:52:14 +01:00
graph_data_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
http_validation_error.py Release v0.4.11 2026-02-13 10:52:14 +01:00
include_options.py Release v0.4.11 2026-02-13 10:52:14 +01:00
list_documents_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
list_memory_units_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
list_tags_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
memory_item.py Release v0.4.11 2026-02-13 10:52:14 +01:00
mental_model_list_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
mental_model_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
mental_model_trigger.py Release v0.4.11 2026-02-13 10:52:14 +01:00
operation_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
operation_status_response.py fix: improve async batch retain with large payloads (#366) 2026-02-16 12:51:42 +01:00
operations_list_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
recall_request.py Release v0.4.11 2026-02-13 10:52:14 +01:00
recall_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
recall_result.py Release v0.4.11 2026-02-13 10:52:14 +01:00
reflect_based_on.py Release v0.4.11 2026-02-13 10:52:14 +01:00
reflect_directive.py Release v0.4.11 2026-02-13 10:52:14 +01:00
reflect_fact.py Release v0.4.11 2026-02-13 10:52:14 +01:00
reflect_include_options.py Release v0.4.11 2026-02-13 10:52:14 +01:00
reflect_llm_call.py Release v0.4.11 2026-02-13 10:52:14 +01:00
reflect_mental_model.py Release v0.4.11 2026-02-13 10:52:14 +01:00
reflect_request.py Release v0.4.11 2026-02-13 10:52:14 +01:00
reflect_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
reflect_tool_call.py Release v0.4.11 2026-02-13 10:52:14 +01:00
reflect_trace.py Release v0.4.11 2026-02-13 10:52:14 +01:00
retain_request.py Release v0.4.11 2026-02-13 10:52:14 +01:00
retain_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00
tag_item.py Release v0.4.11 2026-02-13 10:52:14 +01:00
token_usage.py Release v0.4.11 2026-02-13 10:52:14 +01:00
tool_calls_include_options.py Release v0.4.11 2026-02-13 10:52:14 +01:00
update_directive_request.py Release v0.4.11 2026-02-13 10:52:14 +01:00
update_disposition_request.py Release v0.4.11 2026-02-13 10:52:14 +01:00
update_mental_model_request.py Release v0.4.11 2026-02-13 10:52:14 +01:00
validation_error.py Release v0.4.11 2026-02-13 10:52:14 +01:00
validation_error_loc_inner.py Release v0.4.11 2026-02-13 10:52:14 +01:00
version_response.py Release v0.4.11 2026-02-13 10:52:14 +01:00