supermemory/packages/cartesia-sdk-python/tests
Agnik47 b65c10bb47 fix(cartesia): keep plain-string search results and skip malformed messages
`utils.py` in cartesia-sdk-python and pipecat-sdk-python are copies of the
same file. #1434 hardened two spots in the pipecat copy and missed cartesia.

`unique_search` calls `_field(r, ...)` on every search result. For a plain
string that finds no attribute, falls back to `""`, and the entry is dropped
before it reaches the prompt. `format_memories_to_text` in the same file has
an `isinstance(item, str)` branch for search results, so that branch is
currently unreachable.

`get_last_user_message` indexed `msg["role"]` and `msg["content"]`
positionally, so a tool-call turn or provider event missing either key raised
KeyError instead of being skipped, and non-string content was returned
verbatim despite the `str | None` annotation.

Both hunks now match the pipecat implementation.
2026-09-18 22:15:17 +05:30
..
__init__.py fix(cartesia-sdk): treat empty profile as no memories, not a retrieval error (#1164) 2026-07-10 19:14:49 -07:00
test_empty_profile.py feat(python-sdks): SDK-level cross-source memory deduplication (#1532) 2026-09-01 06:10:36 +00:00
test_utils.py fix(cartesia): keep plain-string search results and skip malformed messages 2026-09-18 22:15:17 +05:30