Repository: explodinggradients/ragas
Issue: likely #563 issue emerged again 
Root cause: External Dependency Breakage

**Describe the bug**

As I mentioned title, It seems the  "IndexError: list index out of range" came back.


Ragas version: 3.10
Python version: 1.1 - 1.1.2



Exception in thread Thread-6:
Traceback (most recent call last):
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\threading.py", line 1045](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/threading.py#line=1044), in _bootstrap_inner
    self.run()
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\site-packages\ragas\executor.py", line 75](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/site-packages/ragas/executor.py#line=74), in run
    results = self.loop.run_until_complete(self._aresults())
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\asyncio\base_events.py", line 654](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/asyncio/base_events.py#line=653), in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\site-packages\ragas\executor.py", line 63](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/site-packages/ragas/executor.py#line=62), in _aresults
    raise e
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\site-packages\ragas\executor.py", line 58](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/site-packages/ragas/executor.py#line=57), in _aresults
    r = await future
        ^^^^^^^^^^^^
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\asyncio\tasks.py", line 615](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/asyncio/tasks.py#line=614), in _wait_for_one
    return f.result()  # May raise f.exception().
           ^^^^^^^^^^
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\site-packages\ragas\executor.py", line 91](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/site-packages/ragas/executor.py#line=90), in wrapped_callable_async
    return counter, await callable(*args, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\site-packages\ragas\testset\extractor.py", line 49](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/site-packages/ragas/testset/extractor.py#line=48), in extract
    results = await self.llm.generate(prompt=prompt, is_async=is_async)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\site-packages\ragas\llms\base.py", line 92](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/site-packages/ragas/llms/base.py#line=91), in generate
    return await agenerate_text_with_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\site-packages\tenacity\_asyncio.py", line 88](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/site-packages/tenacity/_asyncio.py#line=87), in async_wrapped
    return await fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\site-packages\tenacity\_asyncio.py", line 47](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/site-packages/tenacity/_asyncio.py#line=46), in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\site-packages\tenacity\__init__.py", line 325](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/site-packages/tenacity/__init__.py#line=324), in iter
    raise retry_exc.reraise()
          ^^^^^^^^^^^^^^^^^^^
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\site-packages\tenacity\__init__.py", line 158](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/site-packages/tenacity/__init__.py#line=157), in reraise
    raise self.last_attempt.result()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\concurrent\futures\_base.py", line 449](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/concurrent/futures/_base.py#line=448), in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\concurrent\futures\_base.py", line 401](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/concurrent/futures/_base.py#line=400), in __get_result
    raise self._exception
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\site-packages\tenacity\_asyncio.py", line 50](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/site-packages/tenacity/_asyncio.py#line=49), in __call__
    result = await fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\site-packages\ragas\llms\base.py", line 177](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/site-packages/ragas/llms/base.py#line=176), in agenerate_text
    result = await self.langchain_llm.agenerate_prompt(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\site-packages\langchain_core\language_models\llms.py", line 578](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/site-packages/langchain_core/language_models/llms.py#line=577), in agenerate_prompt
    return await self.agenerate(
           ^^^^^^^^^^^^^^^^^^^^^
  File "[C:\Users\TOTORO\anaconda3\envs\llm-work-space\Lib\site-packages\langchain_core\language_models\llms.py", line 853](file:///C:/Users/TOTORO/anaconda3/envs/llm-work-space/Lib/site-packages/langchain_core/language_models/llms.py#line=852), in agenerate
    isinstance(callbacks[0], (list, BaseCallbackManager))
               ~~~~~~~~~^^^
IndexError: list index out of range
---------------------------------------------------------------------------
ExceptionInRunner                         Traceback (most recent call last)
Cell In[4], line 1
----> 1 testset = test_generator.generate_with_llamaindex_docs(documents_list,
      2 test_size=10,distributions={simple: 0.5, reasoning: 0.25, multi_context: 0.25})

File [~\anaconda3\envs\llm-work-space\Lib\site-packages\ragas\testset\generator.py:124](http://localhost:8888/lab/tree/OneDrive/Masa%C3%BCst%C3%BC/LLM%20Application/Chat-with-docs-pdfs-csvs/~/anaconda3/envs/llm-work-space/Lib/site-packages/ragas/testset/generator.py#line=123), in TestsetGenerator.generate_with_llamaindex_docs(self, documents, test_size, distributions, with_debugging_logs, is_async, raise_exceptions, run_config)
    113 def generate_with_llamaindex_docs(
    114     self,
    115     documents: t.Sequence[LlamaindexDocument],
   (...)
    122 ):
    123     # chunk documents and add to docstore
--> 124     self.docstore.add_documents(
    125         [Document.from_llamaindex_document(doc) for doc in documents]
    126     )
    128     return self.generate(
    129         test_size=test_size,
    130         distributions=distributions,
   (...)
    134         raise_exceptions=raise_exceptions,
    135     )

File [~\anaconda3\envs\llm-work-space\Lib\site-packages\ragas\testset\docstore.py:210](http://localhost:8888/lab/tree/OneDrive/Masa%C3%BCst%C3%BC/LLM%20Application/Chat-with-docs-pdfs-csvs/~/anaconda3/envs/llm-work-space/Lib/site-packages/ragas/testset/docstore.py#line=209), in InMemoryDocumentStore.add_documents(self, docs, show_progress)
    204 # split documents with self.splitter into smaller nodes
    205 nodes = [
    206     Node.from_langchain_document(d)
    207     for d in self.splitter.transform_documents(docs)
    208 ]
--> 210 self.add_nodes(nodes, show_progress=show_progress)

File [~\anaconda3\envs\llm-work-space\Lib\site-packages\ragas\testset\docstore.py:250](http://localhost:8888/lab/tree/OneDrive/Masa%C3%BCst%C3%BC/LLM%20Application/Chat-with-docs-pdfs-csvs/~/anaconda3/envs/llm-work-space/Lib/site-packages/ragas/testset/docstore.py#line=249), in InMemoryDocumentStore.add_nodes(self, nodes, show_progress, desc)
    248 results = executor.results()
    249 if results == []:
--> 250     raise ExceptionInRunner()
    252 for i, n in enumerate(nodes):
    253     if i in nodes_to_embed.keys():

ExceptionInRunner: The runner thread which was running the jobs raised an exeception. Read the traceback above to debug it. You can also pass `raise_exception=False` incase you want to show only a warning message instead.