feat(memory): expose expiration controls in client docs (#5874)

Co-authored-by: Soumil Rathi <soumilrathi@gmail.com>
This commit is contained in:
soumil-rathi
2026-06-25 17:14:33 -07:00
committed by GitHub
parent 818c2981b7
commit 0fbbb2f525
19 changed files with 519 additions and 57 deletions
+27
View File
@@ -167,6 +167,33 @@ class TestAsyncUpdate:
"test_id", "Updated memory", {"Updated memory": [0.1, 0.2, 0.3]}, {}
)
@pytest.mark.asyncio
async def test_async_update_can_change_expiration_date_without_changing_text(self, mock_async_memory, mocker):
mock_async_memory.embedding_model.embed = Mock(return_value=[0.1, 0.2, 0.3])
mock_async_memory.vector_store.get = Mock(
return_value=Mock(
payload={
"data": "Existing memory",
"user_id": "test_user",
"created_at": "2026-01-01T00:00:00+00:00",
"expiration_date": "2026-12-31",
}
)
)
mock_async_memory.vector_store.update = Mock()
mock_async_memory.db.add_history = Mock()
mock_async_memory._remove_memory_from_entity_store = mocker.AsyncMock()
mock_async_memory._link_entities_for_memory = mocker.AsyncMock()
result = await mock_async_memory.update("test_id", expiration_date="2999-01-01")
assert result["message"] == "Memory updated successfully!"
payload = mock_async_memory.vector_store.update.call_args.kwargs["payload"]
assert payload["data"] == "Existing memory"
assert payload["expiration_date"] == "2999-01-01"
mock_async_memory._remove_memory_from_entity_store.assert_not_called()
mock_async_memory._link_entities_for_memory.assert_not_called()
@pytest.mark.asyncio
class TestAsyncAddToVectorStoreErrors: