Addresses @kartik-mem0's review on mem0#7340, verified against the live
staging profiles API on a neuron:
- generate_profile / sample_profiles accept a caller-supplied idempotency_key,
so retrying a lost request reuses the job instead of creating a second
billable one (Python sync+async and TS)
- TS uses the uuid dependency instead of the global crypto.randomUUID(), which
throws on the supported Node 18 target
- update_profile_settings distinguishes an omitted argument from an explicit
None, so schema / custom_instructions can be cleared (Python sentinel)
- export ProfileJobResponse and ProfileJobStatus; drop the deprecated
ProfileTriggerResponse / ProfileSamplesResponse aliases and the unpopulated
results field; correct usageUnits -> entityCountReserved; add error to
ProfileResponse
- openapi: nest schema / custom_instructions under entities in the settings
request and response, add capabilities, and mark entity_type required on the
job body
- docs sample example polls to a terminal job status with a timeout, then reads
the create response's entity_ids (status.results raised KeyError)
- notebook: include PARTIALLY_SUCCEEDED in terminal states, raise on timeout,
and snapshot/restore project settings so a shared env is left as found
- tests: real job_id create shape, idempotency-key reuse, and clear-with-None
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>