"""
gnomad_search_variants

Search for variants in gnomAD by free-text query (commonly an rsID like 'rs7412'). Returns matchi...
"""

from typing import Any, Optional, Callable
from ._shared_client import get_shared_client


def gnomad_search_variants(
    query: str,
    dataset: Optional[str] = "gnomad_r3",
    *,
    stream_callback: Optional[Callable[[str], None]] = None,
    use_cache: bool = False,
    validate: bool = True,
) -> dict[str, Any]:
    """
    Search for variants in gnomAD by free-text query (commonly an rsID like 'rs7412'). Returns matchi...

    Parameters
    ----------
    query : str
        Variant search query (e.g., 'rs7412').
    dataset : str
        gnomAD dataset ID. Allowed values: gnomad_r4, gnomad_r4_non_ukb, gnomad_r3, g...
    stream_callback : Callable, optional
        Callback for streaming output
    use_cache : bool, default False
        Enable caching
    validate : bool, default True
        Validate parameters

    Returns
    -------
    dict[str, Any]
    """
    # Handle mutable defaults to avoid B006 linting error

    return get_shared_client().run_one_function(
        {
            "name": "gnomad_search_variants",
            "arguments": {"query": query, "dataset": dataset},
        },
        stream_callback=stream_callback,
        use_cache=use_cache,
        validate=validate,
    )


__all__ = ["gnomad_search_variants"]
