Skip to content

datarobot_genai.drtools.core.utils

utils

Shared utilities for drtools and drmcp.

is_valid_url

is_valid_url(url: str) -> bool

Check if a string is a valid URL.

Source code in datarobot_genai/drtools/core/utils.py
def is_valid_url(url: str) -> bool:
    """Check if a string is a valid URL."""
    try:
        result = urlparse(url)
        return bool(result.scheme and result.netloc)
    except Exception:
        return False