def METHOD_NAME(engine: ClientEngineInternalSpec):
    if not isinstance(engine, ClientEngineInternalSpec):
        raise ValueError("engine must be ClientEngineInternalSpec, but got {}".format(type(engine)))
    resource_consumer = engine.get_component(SystemComponents.RESOURCE_CONSUMER)
    if not isinstance(resource_consumer, ResourceConsumerSpec):
        raise ValueError(
            f"resource_consumer should be of type ResourceConsumerSpec, but got {type(resource_consumer)}."
        )
    return resource_consumer