def test_langchain_constructors(self):
        """
        Test TruChain class that require optional packages.
        """
        from trulens.apps.langchain.tru_chain import TruChain

        with self.subTest(type="TruChain"):
            app = self._create_chain()

            with self.subTest(argname=None):
                TruChain(app)

            with self.subTest(argname="app"):
                TruChain(app=app)

            # Not specifying chain should be an error.
            with self.assertRaises(Exception):
                TruChain()
            with self.assertRaises(Exception):
                TruChain(None)

            # Specifying the chain using any of these other argument names
            # should be an error.
            wrong_args = ["engine", "text_to_text"]
            for arg in wrong_args:
                with self.subTest(argname=arg):
                    with self.assertRaises(Exception):
                        TruChain(**{arg: app})

        Test TruChain class that require optional packages.
        
tests/e2e/test_tru_session.py