def parse_docstring(docstring: str) -> DocstringInfo:
    """
    Parses the docstring to extract the function description, parameter comments,
    and return value description.
    Handles both reStructuredText and Google-style docstrings.
    Args:
        docstring: The docstring to parse.
    Returns:
        DocstringInfo: A dataclass containing the parsed information.
    Raises:
        ValueError: If the docstring is empty or missing a function description.
    """

    if not docstring or not docstring.strip():
        raise ValueError(
            "Docstring is empty. Please provide a docstring with a function description."
        )

    sections = _split_docstring_sections(docstring)
    description = _parse_description(sections["description"])
    params = _parse_params(sections["args"])
    returns = _parse_returns(sections["returns"])

    return DocstringInfo(description=description, params=params, returns=returns)

    Parses the docstring to extract the function description, parameter comments,
    and return value description.
    Handles both reStructuredText and Google-style docstrings.
    Args:
        docstring: The docstring to parse.
    Returns:
        DocstringInfo: A dataclass containing the parsed information.
    Raises:
        ValueError: If the docstring is empty or missing a function description.
    
ai/core/src/unitycatalog/ai/core/utils/docstring_utils.py