Repository: truera/trulens
Issue: Llama Index quick start - str object has no attribute query_str
Root cause: External Dependency Breakage

Am following the Llama-index quick start for trulens from here -> https://www.trulens.org/trulens_eval/llama_index_quickstart/#setup

Running the code with the following versions of llama-index and trulens gives me the error below 
**Versions** 

```
trulens-eval==0.23.0
llama-index==0.10.7

```
**Error**

```
Traceback (most recent call last):
  File "/Users/colwin.fernandes/Documents/Projects/open_ai/code/research/.trulens/lib/python3.11/site-packages/trulens_eval/utils/asynchro.py", line 120, in sync
    loop = asyncio.get_running_loop()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/colwin.fernandes/Documents/Projects/open_ai/code/research/docs_sample.py", line 65, in <module>
    with tru_query_engine_recorder as recording:
  File "/Users/colwin.fernandes/Documents/Projects/open_ai/code/research/.trulens/lib/python3.11/site-packages/trulens_eval/app.py", line 842, in __exit__
    raise exc_value
  File "/Users/colwin.fernandes/Documents/Projects/open_ai/code/research/docs_sample.py", line 66, in <module>
    query_engine.query("What did the author do growing up?")
  File "/Users/colwin.fernandes/Documents/Projects/open_ai/code/research/.trulens/lib/python3.11/site-packages/trulens_eval/instruments.py", line 633, in tru_wrapper
    return sync(tru_awrapper, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/colwin.fernandes/Documents/Projects/open_ai/code/research/.trulens/lib/python3.11/site-packages/trulens_eval/utils/asynchro.py", line 125, in sync
    return loop.run_until_complete(awaitable)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/colwin.fernandes/Documents/Projects/open_ai/code/research/.trulens/lib/python3.11/site-packages/nest_asyncio.py", line 98, in run_until_complete
    return f.result()
           ^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/futures.py", line 203, in result
    raise self._exception.with_traceback(self._exception_tb)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/tasks.py", line 277, in __step
    result = coro.send(None)
             ^^^^^^^^^^^^^^^
  File "/Users/colwin.fernandes/Documents/Projects/open_ai/code/research/.trulens/lib/python3.11/site-packages/trulens_eval/instruments.py", line 609, in tru_awrapper
    ctx.app._on_add_record(
  File "/Users/colwin.fernandes/Documents/Projects/open_ai/code/research/.trulens/lib/python3.11/site-packages/trulens_eval/app.py", line 885, in _on_add_record
    record = ctx.finish_record(build_record)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/colwin.fernandes/Documents/Projects/open_ai/code/research/.trulens/lib/python3.11/site-packages/trulens_eval/app.py", line 410, in finish_record
    record = calls_to_record(self.calls, self.record_metadata)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/colwin.fernandes/Documents/Projects/open_ai/code/research/.trulens/lib/python3.11/site-packages/trulens_eval/app.py", line 869, in build_record
    main_in = self.main_input(func, sig, bindings)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/colwin.fernandes/Documents/Projects/open_ai/code/research/.trulens/lib/python3.11/site-packages/trulens_eval/tru_llama.py", line 310, in main_input
    return str_or_bundle.query_str
           ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'query_str'

```

The code at https://github.com/truera/trulens/blob/main/trulens_eval/trulens_eval/tru_llama.py#L307 is currently not working. QueryBundle is a str class underneath it all.

Changing 

`if isinstance(str_or_bundle, QueryBundle):`

To 

`if hasattr(str_or_bundle, 'query_str'):`

Lets me run the sample code successfully. 

We're currently working on supporting the newest llama-index release. Currently supported llama-index versions are: llama-index >= 0.9.26, <0.10.0

Support for Llama-Index > 0.10 is merged to main and will be released in 0.24 today or tomorrow. Thanks for reporting @colwin-cds !

Hi @joshreini1 I get that u have sorted this issue.....
I was also facing the same error, so I tried to go through the code to try solve it but was unable to do so.
So just out of curiosity could you tell me where was the issue and how did you solve it?
Thank you for the help. 

@vanshgupta7 Llama-Index made many breaking changes in their 0.10 release. You can see their migration guide here: https://docs.llamaindex.ai/en/latest/getting_started/v0_10_0_migration.html

If you're running into issues with TruLens, please try the latest release (0.24.0) which now supports llama-index > 0.10