async def adelete_message(self, key: str, idx: int) -> Optional[ChatMessage]:
        """Async version of Delete specific message for a key."""
        async with self._async_session() as session:
            # First, retrieve message
            result = (
                await session.execute(
                    select(self._table_class.value).where(
                        self._table_class.key == key, self._table_class.id == idx
                    )
                )
            ).scalar_one_or_none()

            if result is None:
                return None

            await session.execute(
                delete(self._table_class).where(
                    self._table_class.key == key, self._table_class.id == idx
                )
            )
            await session.commit()

            return ChatMessage.model_validate(result)
Async version of Delete specific message for a key.
llama-index-integrations/storage/chat_store/llama-index-storage-chat-store-sqlite/llama_index/storage/chat_store/sqlite/base.py