def App(self, *args, app: Optional[Any] = None, **kwargs) -> base_app.App:
        """Create an App from the given App constructor arguments by guessing
        which app type they refer to.

        This method intentionally prints out the type of app being created to
        let user know in case the guess is wrong.
        """
        if app is None:
            # If app is not given as a keyword argument, check the positional args.

            if len(args) == 0:
                # Basic app can be specified using the text_to_text key argument.
                if "text_to_text" in kwargs:
                    from trulens.apps import basic

                    return basic.TruBasicApp(
                        *args, connector=self.connector, **kwargs
                    )

                raise ValueError("No app provided.")

            # Otherwise the app must be the first positional arg.
            app, args = args[0], args[1:]

        # Check for optional app types.
        if app.__module__.startswith("langchain"):
            with import_utils.OptionalImports(
                messages=optional_utils.REQUIREMENT_APPS_LANGCHAIN
            ):
                from trulens.apps.langchain import tru_chain

            print(f"{text_utils.UNICODE_SQUID} Instrumenting LangChain app.")
            return tru_chain.TruChain(
                *args, app=app, connector=self.connector, **kwargs
            )

        elif app.__module__.startswith("llamaindex"):
            with import_utils.OptionalImports(
                messages=optional_utils.REQUIREMENT_APPS_LLAMA
            ):
                from trulens.apps.llamaindex import tru_llama

            print(f"{text_utils.UNICODE_SQUID} Instrumenting LlamaIndex app.")
            return tru_llama.TruLlama(
                *args, app=app, connector=self.connector, **kwargs
            )

        elif app.__module__.startswith("nemoguardrails"):
            with import_utils.OptionalImports(
                messages=optional_utils.REQUIREMENT_APPS_NEMO
            ):
                from trulens.apps.nemo import tru_rails

            print(
                f"{text_utils.UNICODE_SQUID} Instrumenting NeMo GuardRails app."
            )

            return tru_rails.TruRails(
                *args, app=app, connector=self.connector, **kwargs
            )

        # Check for virtual. Either VirtualApp or JSON app arg.
        from trulens.apps import virtual
        from trulens.core.utils import serial as serial_utils

        if isinstance(app, virtual.VirtualApp) or serial_utils.is_json(app):
            print(f"{text_utils.UNICODE_SQUID} Instrumenting virtual app.")
            return virtual.TruVirtual(
                *args, app=app, connector=self.connector, **kwargs
            )

        # Check for basic. Either TruWrapperApp or the text_to_text arg. Unsure
        # what we want to do if they provide both. Let's TruBasicApp handle it.
        from trulens.apps import basic

        if isinstance(app, basic.TruWrapperApp) or "text_to_text" in kwargs:
            print(f"{text_utils.UNICODE_SQUID} Instrumenting basic app.")

            return basic.TruBasicApp(
                *args, app=app, connector=self.connector, **kwargs
            )

        # If all else fails, assume it is a custom app.
        print(f"{text_utils.UNICODE_SQUID} Instrumenting custom app.")
        from trulens.apps import custom

        return custom.TruCustomApp(
            *args, app=app, connector=self.connector, **kwargs
        )
Create an App from the given App constructor arguments by guessing
        which app type they refer to.

        This method intentionally prints out the type of app being created to
        let user know in case the guess is wrong.
        
src/core/trulens/core/session.py