def main_input(
        self, func: Callable, sig: Signature, bindings: BoundArguments
    ) -> str:
        """
        Determine the main input string for the given function `func` with
        signature `sig` if it is to be called with the given bindings
        `bindings`.
        """

        if "messages" in bindings.arguments:
            if len(bindings.arguments["messages"]) == 0:
                raise NotImplementedError(
                    "Cannot handle no messages in TruLens."
                )
            return str(bindings.arguments["messages"])

        if "str_or_query_bundle" in bindings.arguments:
            # llama_index specific
            str_or_bundle = bindings.arguments["str_or_query_bundle"]
            if isinstance(str_or_bundle, QueryBundle):
                return str_or_bundle.query_str
            else:
                return str_or_bundle

        elif "message" in bindings.arguments:
            # llama_index specific
            return bindings.arguments["message"]

        else:
            return core_app.App.main_input(self, func, sig, bindings)

        Determine the main input string for the given function `func` with
        signature `sig` if it is to be called with the given bindings
        `bindings`.
        
src/apps/llamaindex/trulens/apps/llamaindex/tru_llama.py