Repository: truera/trulens
Issue: trulens doesn't work with llama 0.7.5
Root cause: External Dependency Breakage

The code below:

```
import os
os.environ["OPENAI_API_KEY"] = "sk-***"
os.environ["HUGGINGFACE_API_KEY"] = "hf_***"

# Imports main tools:
from trulens_eval import TruLlama, Feedback, Tru, feedback
tru = Tru()

from llama_index import VectorStoreIndex, SimpleDirectoryReader

documents = SimpleDirectoryReader('data').load_data()
index = VectorStoreIndex.from_documents(documents)

query_engine = index.as_query_engine()

response = query_engine.query("What did the author do growing up?")
print(response)

import numpy as np



# Initialize Huggingface-based feedback function collection class:
hugs = feedback.Huggingface()
openai = feedback.OpenAI()

# Define a language match feedback function using HuggingFace.
f_lang_match = Feedback(hugs.language_match).on_input_output()
# By default this will check language match on the main app input and main app
# output.

# Question/answer relevance between overall question and answer.
f_qa_relevance = Feedback(openai.relevance).on_input_output()

# Question/statement relevance between question and each context chunk.
f_qs_relevance = Feedback(openai.qs_relevance).on_input().on(
    TruLlama.select_source_nodes().node.text
).aggregate(np.min)

tru_query_engine = TruLlama(query_engine,
    app_id='LlamaIndex_App1',
    feedbacks=[f_lang_match, f_qa_relevance, f_qs_relevance])
```
generates:

```
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[/mnt/llm/trulens/1.py](https://vscode-remote+ssh-002dremote-***.vscode-resource.vscode-cdn.net/mnt/llm/trulens/1.py) in line 33
     [27](file:///mnt/llm/trulens/1.py?line=26) # Question/statement relevance between question and each context chunk.
     [29](file:///mnt/llm/trulens/1.py?line=28) f_qs_relevance = Feedback(openai.qs_relevance).on_input().on(
     [30](file:///mnt/llm/trulens/1.py?line=29)     TruLlama.select_source_nodes().node.text
     [31](file:///mnt/llm/trulens/1.py?line=30) ).aggregate(np.min)
---> [33](file:///mnt/llm/trulens/1.py?line=32) tru_query_engine = TruLlama(query_engine,
     [34](file:///mnt/llm/trulens/1.py?line=33)     app_id='LlamaIndex_App1',
     [35](file:///mnt/llm/trulens/1.py?line=34)     feedbacks=[f_lang_match, f_qa_relevance, f_qs_relevance])

File [~/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py:134](https://vscode-remote+ssh-002dremote***.vscode-resource.vscode-cdn.net/mnt/llm/trulens/~/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py:134), in TruLlama.__init__(self, app, **kwargs)
    [132](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=131) kwargs['app'] = app
    [133](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=132) kwargs['root_class'] = Class.of_object(app)  # TODO: make class property
--> [134](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=133) kwargs['instrument'] = LlamaInstrument()
    [136](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=135) super().__init__(**kwargs)

File [~/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py:101](https://vscode-remote+ssh-002dremote-***.vscode-resource.vscode-cdn.net/mnt/llm/trulens/~/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py:101), in LlamaInstrument.__init__(self)
     [97](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=96) def __init__(self):
     [98](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=97)     super().__init__(
     [99](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=98)         root_method=TruLlama.query_with_record,
    [100](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=99)         modules=LlamaInstrument.Default.MODULES,
--> [101](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=100)         classes=LlamaInstrument.Default.CLASSES(),  # was thunk
    [102](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=101)         methods=LlamaInstrument.Default.METHODS
    [103](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=102)     )

File [~/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py:55](https://vscode-remote+ssh-002dremote-***.vscode-resource.vscode-cdn.net/mnt/llm/trulens/~/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py:55), in LlamaInstrument.Default.()
     [42](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=41) MODULES = {"llama_index."}.union(
     [43](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=42)     LangChainInstrument.Default.MODULES
     [44](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=43) )  # NOTE: llama_index uses langchain internally for some things
     [46](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=45) # Putting these inside thunk as llama_index is optional.
     [47](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=46) CLASSES = lambda: {
     [48](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=47)     llama_index.indices.query.base.BaseQueryEngine,
     [49](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=48)     llama_index.indices.base_retriever.BaseRetriever,
     [50](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=49)     llama_index.indices.base.BaseIndex,
     [51](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=50)     llama_index.chat_engine.types.BaseChatEngine,
     [52](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=51)     llama_index.prompts.base.Prompt,
     [53](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=52)     # llama_index.prompts.prompt_type.PromptType, # enum
     [54](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=53)     llama_index.question_gen.types.BaseQuestionGenerator,
---> [55](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=54)     llama_index.indices.query.response_synthesis.ResponseSynthesizer,
     [56](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=55)     llama_index.indices.response.refine.Refine,
     [57](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=56)     llama_index.llm_predictor.LLMPredictor,
     [58](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=57)     llama_index.llm_predictor.base.LLMMetadata,
     [59](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=58)     llama_index.llm_predictor.base.BaseLLMPredictor,
     [60](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=59)     llama_index.vector_stores.types.VectorStore,
     [61](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=60)     llama_index.question_gen.llm_generators.BaseQuestionGenerator,
     [62](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=61)     llama_index.indices.service_context.ServiceContext,
     [63](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=62)     llama_index.indices.prompt_helper.PromptHelper,
     [64](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=63)     llama_index.embeddings.base.BaseEmbedding,
     [65](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=64)     llama_index.node_parser.interface.NodeParser
     [66](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=65) }.union(LangChainInstrument.Default.CLASSES())
     [68](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=67) # Instrument only methods with these names and of these classes. Ok to
     [69](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=68) # include llama_index inside methods.
     [70](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=69) METHODS = dict_set_with(
     [71](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=70)     {
     [72](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=71)         "get_response":
   (...)
     [94](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=93)     }, LangChainInstrument.Default.METHODS
     [95](file:///home/wodecki/.conda/envs/llamaindex/lib/python3.10/site-packages/trulens_eval/tru_llama.py?line=94) )

AttributeError: module 'llama_index.indices.query' has no attribute 'response_synthesis'
```

Thanks for catching this.
The upgrade fix is here: https://github.com/truera/trulens/pull/290

Until then, the current trulens-eval will only work with `llama_index>=0.6.24,<0.7.0`

Released in 0.6.0: https://pypi.org/project/trulens-eval/