def main_input(
        self, func: Callable, sig: Signature, bindings: BoundArguments
    ) -> str:  # might have to relax to JSON output
        """
        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 "input" in bindings.arguments:
            temp = bindings.arguments["input"]
            if isinstance(temp, str):
                return temp

            if isinstance(temp, dict):
                vals = list(temp.values())
            elif isinstance(temp, list):
                vals = temp
            else:
                vals = [temp]

            if len(vals) == 0:
                return None

            if len(vals) == 1:
                return vals[0]

            if len(vals) > 1:
                return vals[0]

        if (
            "inputs" in bindings.arguments
            and python_utils.safe_hasattr(self.app, "input_keys")
            and python_utils.safe_hasattr(self.app, "prep_inputs")
        ):
            # langchain specific:
            ins = self.app.prep_inputs(bindings.arguments["inputs"])

            if len(self.app.input_keys) == 0:
                logger.warning(
                    "langchain app has no `input_keys`. `main_input` might not be detected."
                )
                return super().main_input(func, sig, bindings)

            return ins[self.app.input_keys[0]]

        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/langchain/trulens/apps/langchain/tru_chain.py