def _validate_request_schema()

in dell_ai/models.py [0:0]


def _validate_request_schema(model_id, platform_id, engine, num_gpus, num_replicas):
    """
    Validate the basic schema of the request parameters.

    Args:
        model_id: The model ID
        platform_id: The platform SKU ID
        engine: The deployment engine
        num_gpus: Number of GPUs
        num_replicas: Number of replicas

    Raises:
        ValidationError: If the parameters don't match the expected schema
    """
    try:
        # Let Pydantic handle all validation
        _ = SnippetRequest(
            model_id=model_id,
            platform_id=platform_id,
            engine=engine,
            num_gpus=num_gpus,
            num_replicas=num_replicas,
        )
    except ValueError as e:
        # Simply convert to our custom ValidationError while preserving the original error
        # This maintains a consistent error hierarchy without losing Pydantic's detailed info
        raise ValidationError(str(e), original_error=e)