Repository: truera/trulens
Issue: NameError: name 'RESPONSE_TYPE' is not defined
Root cause: Validation Gap

I was trying to get some evaluations using TruLens.
When i tried to import Truchain it gave me the following error
Trulens version - 0.13.4
Trulens-eval version - 0.20.3
`from trulens_eval import TruChain
`

The error: NameError: name 'RESPONSE_TYPE' is not defined

Here  is the entire traceback.
NameError                                 Traceback (most recent call last)
[<ipython-input-2-d0571f0a7d4b>](https://localhost:8080/#) in <cell line: 11>()
      9 from langchain.llms import GooglePalm
     10 from langchain.chat_models import ChatOpenAI
---> 11 from trulens_eval import TruChain
     12 
     13 full_prompt = HumanMessagePromptTemplate(

5 frames
[/usr/local/lib/python3.10/dist-packages/trulens_eval/__init__.py](https://localhost:8080/#) in <module>
    101     from trulens_eval.feedback import Bedrock
    102 
--> 103 with OptionalImports(messages=REQUIREMENT_LLAMA):
    104     from trulens_eval.tru_llama import TruLlama
    105 

[/usr/local/lib/python3.10/dist-packages/trulens_eval/utils/imports.py](https://localhost:8080/#) in __exit__(self, exc_type, exc_value, exc_tb)
    348 
    349         else:
--> 350             raise exc_value
    351 
    352         # Will re-raise exception unless True is returned.

[/usr/local/lib/python3.10/dist-packages/trulens_eval/__init__.py](https://localhost:8080/#) in <module>
    102 
    103 with OptionalImports(messages=REQUIREMENT_LLAMA):
--> 104     from trulens_eval.tru_llama import TruLlama
    105 
    106 with OptionalImports(messages=REQUIREMENT_LITELLM):

[/usr/local/lib/python3.10/dist-packages/trulens_eval/utils/imports.py](https://localhost:8080/#) in __import__(self, name, globals, locals, fromlist, level)
    273     def __import__(self, name, globals=None, locals=None, fromlist=(), level=0):
    274         try:
--> 275             mod = self.imp(name, globals, locals, fromlist, level)
    276 
    277             # NOTE(piotrm): commented block attempts to check module contents

[/usr/local/lib/python3.10/dist-packages/trulens_eval/tru_llama.py](https://localhost:8080/#) in <module>
    183 
    184 
--> 185 class TruLlama(App):
    186     """
    187     Instantiates the LLama Index Wrapper.

[/usr/local/lib/python3.10/dist-packages/trulens_eval/tru_llama.py](https://localhost:8080/#) in TruLlama()
    419     # TODEP
    420     # llama_index.indices.query.base.BaseQueryEngine
--> 421     def query(self, *args, **kwargs) -> RESPONSE_TYPE:
    422 
    423         assert isinstance(self.app, BaseQueryEngine)

NameError: name 'RESPONSE_TYPE' is not defined

Any help is appreciated

I believe this broke in trulens-eval-0.20.3 with the addition of 
`with OptionalImports(messages=REQUIREMENT_LLAMA):` - https://github.com/truera/trulens/blob/cd96d3d74743c676a437a0f86ed7dd6deab094f1/trulens_eval/trulens_eval/tru_llama.py#L27

which makes the import of RESPONSE_TYPE from llama_index conditonal

Could you help me with how to solve it or should I wait for the team to fix this


@piotrm0 can you take a look at this?

@vanshgupta7 - can you create a fresh environment and re-install trulens? I'm unable to reproduce this issue.