def model_dump_json(model: pydantic.BaseModel, **kwargs) -> str:
    """Dump a pydantic model to a JSON string.

    Args:
        model: A pydantic model.
    """
    if PYDANTIC_V2:
        return model.model_dump_json(**kwargs)
    else:
        return model.json(**kwargs)
Dump a pydantic model to a JSON string.

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