def set_filter_text(self, query: str) -> None:
        """
        Filter the list of available items by captions matching `query`.
        """
        self.beginResetModel()
        self._filter_text = query
        if query == "":
            self._filtered_items = self._available_items
        else:
            self._filtered_items = [item for _, _, item in process.extract(query, self._item_to_caption, limit=50)]
        self.endResetModel()

        Filter the list of available items by captions matching `query`.
        
angrmanagement/ui/dialogs/command_palette.py