def test_llamaindex_constructors(self):
        """
        Test TruLlama class that require optional packages.
        """
        from trulens.apps.llamaindex.tru_llama import TruLlama

        with self.subTest(type="TruLlama"):
            app = self._create_llama()

            TruLlama(app)

            TruLlama(app=app)

            # Not specifying an engine should be an error.
            with self.assertRaises(Exception):
                TruLlama()

            with self.assertRaises(Exception):
                TruLlama(None)

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

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