def model_dump(model: pydantic.BaseModel, **kwargs) -> dict[str, Any]:
    """Dump a pydantic model to a dictionary.

    Args:
        model: A pydantic model.
    """
    if PYDANTIC_V2:
        return model.model_dump(**kwargs)
    else:
        return model.dict(**kwargs)
Dump a pydantic model to a dictionary.

    Args:
        model: A pydantic model.
    
lanarky/utils.py