def listener(
    dataset: str,
    query: Optional[str] = None,
    metrics: Optional[List[str]] = None,
    condition: Optional[ListenerCondition] = None,
    with_records: bool = True,
    execution_interval_in_seconds: int = 30,
    **query_params,
):
    """
    Configures the decorated function as an argilla listener.

    Args:
        dataset: The dataset name.
        query: The query string.
        metrics: Required metrics for listener condition.
        condition: Defines condition over search and metrics that launch action when is satisfied.
        with_records: Include records as part of action arguments. If ``False``,
            only the listener context ``RGListenerContext`` will be passed. Default: ``True``.
        execution_interval_in_seconds: Define the execution interval in seconds when listener
            iteration will be executed.
        **query_params: Dynamic parameters used in the query. These parameters will be available
            via the listener context and can be updated for subsequent queries.
    """

    def inner_decorator(func):
        return RGDatasetListener(
            dataset=dataset,
            action=func,
            condition=condition,
            query=query,
            query_params=query_params,
            metrics=metrics,
            query_records=with_records,
            interval_in_seconds=execution_interval_in_seconds,
        )

    return inner_decorator

    Configures the decorated function as an argilla listener.

    Args:
        dataset: The dataset name.
        query: The query string.
        metrics: Required metrics for listener condition.
        condition: Defines condition over search and metrics that launch action when is satisfied.
        with_records: Include records as part of action arguments. If ``False``,
            only the listener context ``RGListenerContext`` will be passed. Default: ``True``.
        execution_interval_in_seconds: Define the execution interval in seconds when listener
            iteration will be executed.
        **query_params: Dynamic parameters used in the query. These parameters will be available
            via the listener context and can be updated for subsequent queries.
    
argilla-v1/src/argilla_v1/listeners/listener.py