def _compute_feedback(
    record_root: RecordGraphNode,
    feedback_name: str,
    feedback_function: Callable[
        [Any], Union[float, Tuple[float, Dict[str, Any]]]
    ],
    higher_is_better: bool,
    selector_function: Callable[[RecordGraphNode], List[Dict[str, Any]]],
) -> None:
    """
    Compute feedback for a record. This is a utility function that can compute
    feedback functions quite arbitrarily and so is quite powerful.

    Args:
        record_root: Record root of record to compute feedback for.
        feedback_name: Name of feedback.
        feedback_function: Function to compute feedback.
        higher_is_better: Whether higher values are better.
        selector_function:
            Function to select inputs for feedback computation. Given a record
            in graph form, it returns a list of inputs to the feedback
            function. Each entry in the list is a dictionary that represents
            the kwargs to the feedback function.
    """
    feedback_inputs = selector_function(record_root)
    record_root_attributes = record_root.current_span.attributes
    record_root_resource_attributes = (
        record_root.current_span.resource_attributes
    )
    for curr in feedback_inputs:
        curr = {k: FeedbackFunctionInput(value=v) for k, v in curr.items()}
        _call_feedback_function(
            feedback_name,
            feedback_function,
            higher_is_better,
            None,
            curr,
            record_root_attributes,
            record_root_resource_attributes,
        )

    Compute feedback for a record. This is a utility function that can compute
    feedback functions quite arbitrarily and so is quite powerful.

    Args:
        record_root: Record root of record to compute feedback for.
        feedback_name: Name of feedback.
        feedback_function: Function to compute feedback.
        higher_is_better: Whether higher values are better.
        selector_function:
            Function to select inputs for feedback computation. Given a record
            in graph form, it returns a list of inputs to the feedback
            function. Each entry in the list is a dictionary that represents
            the kwargs to the feedback function.
    
src/feedback/trulens/feedback/computer.py