"""
proteins_api_search

Search proteins in Proteins API by gene name, protein name, or accession. The search intelligentl...
"""

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


def proteins_api_search(
    query: str,
    size: Optional[int] = 25,
    offset: Optional[int] = 0,
    format: Optional[str] = "json",
    *,
    stream_callback: Optional[Callable[[str], None]] = None,
    use_cache: bool = False,
    validate: bool = True,
) -> list[Any]:
    """
    Search proteins in Proteins API by gene name, protein name, or accession. The search intelligentl...

    Parameters
    ----------
    query : str
        Search query. Can be: gene name (e.g., 'BRCA1', 'TP53'), protein name (e.g., ...
    size : int
        Maximum number of results to return (default: 25, max: 100)
    offset : int
        Offset for pagination (default: 0)
    format : str
        Response format. JSON is recommended for most use cases.
    stream_callback : Callable, optional
        Callback for streaming output
    use_cache : bool, default False
        Enable caching
    validate : bool, default True
        Validate parameters

    Returns
    -------
    list[Any]
    """
    # Handle mutable defaults to avoid B006 linting error

    return get_shared_client().run_one_function(
        {
            "name": "proteins_api_search",
            "arguments": {
                "query": query,
                "size": size,
                "offset": offset,
                "format": format,
            },
        },
        stream_callback=stream_callback,
        use_cache=use_cache,
        validate=validate,
    )


__all__ = ["proteins_api_search"]
