async def test_delete_messages(chat_store: SQLAlchemyChatStore):
    """Test deleting all messages for a key."""
    # Add messages for multiple users
    await chat_store.add_message(
        "delete_all_user1", ChatMessage(role="user", content="user1_message")
    )
    await chat_store.add_message(
        "delete_all_user2", ChatMessage(role="user", content="user2_message")
    )

    # Delete messages for user1
    await chat_store.delete_messages("delete_all_user1")

    # Verify deletion
    user1_messages = await chat_store.get_messages("delete_all_user1")
    user2_messages = await chat_store.get_messages("delete_all_user2")

    assert len(user1_messages) == 0
    assert len(user2_messages) == 1
Test deleting all messages for a key.
llama-index-core/tests/storage/chat_store/test_sql.py