def _validate_str_not_empty(value: str):
    """Pydantic validator to ensure a string is not empty."""

    if isinstance(value, str) and len(value) == 0:
        raise ValueError("String must contain at least one character.")
    return value