def _current_lucene_query(self) -> str:
    """Flattens the `action tree` into a query for the environment."""

    adjustments = self.state.tree.to_adjustments()
    return state_tree.to_lucene_query(
        self.state.original_query.query,
        adjustments,
        escape_query=common_flags.RETRIEVAL_MODE.value.startswith('LUCENE'))
Flattens the `action tree` into a query for the environment.
language/search_agents/muzero/env.py