def main_input(func: Callable, sig: Signature, bindings: BoundArguments) -> str:
    """Determine (guess) the main input string for a main app call.

    Args:
        func: The main function we are targeting in this determination.

        sig: The signature of the above.

        bindings: The arguments to be passed to the function.

    Returns:
        The main input string.
    """

    if bindings is None:
        raise RuntimeError(
            f"Cannot determine main input of unbound call to {func}: {sig}."
        )

    # ignore self
    all_args = list(
        v for k, v in bindings.arguments.items() if k not in ["self", "_self"]
    )  # llama_index is using "_self" in some places

    # If there is only one string arg, it is a pretty good guess that it is
    # the main input.

    # if have only containers of length 1, find the innermost non-container
    focus = all_args

    while not isinstance(focus, serial_utils.JSON_BASES) and len(focus) == 1:
        focus = focus[0]
        focus = _extract_content(focus, content_keys=["content", "input"])

        if not isinstance(focus, Sequence):
            logger.warning("Focus %s is not a sequence.", focus)
            break

    if isinstance(focus, serial_utils.JSON_BASES):
        return str(focus)

    # Otherwise we are not sure.
    logger.warning(
        "Unsure what the main input string is for the call to %s with args %s.",
        python_utils.callable_name(func),
        bindings,
    )

    # After warning, just take the first item in each container until a
    # non-container is reached.
    focus = all_args
    while not isinstance(focus, serial_utils.JSON_BASES) and len(focus) >= 1:
        focus = focus[0]
        focus = _extract_content(focus)

        if not isinstance(focus, Sequence):
            logger.warning("Focus %s is not a sequence.", focus)
            break

    if isinstance(focus, serial_utils.JSON_BASES):
        return str(focus)

    logger.warning(
        "Could not determine main input/output of %s.", str(all_args)
    )

    return "TruLens: Could not determine main input from " + str(all_args)
Determine (guess) the main input string for a main app call.

    Args:
        func: The main function we are targeting in this determination.

        sig: The signature of the above.

        bindings: The arguments to be passed to the function.

    Returns:
        The main input string.
    
src/core/trulens/core/utils/signature.py