Repository: explodinggradients/ragas
Issue: ExceptionInRunner and RuntimeWarning Issues with Ragas Library
Root cause: External Dependency Breakage

I am encountering an issue while using the Ragas library. Has anyone encountered a similar problem?
Environment: Python 3.10, latest version of Ragas library

![image](https://github.com/explodinggradients/ragas/assets/162958549/39126bb5-eb67-4a55-a17b-6a9cbd50b4c7)
![image (1)](https://github.com/explodinggradients/ragas/assets/162958549/06387cc4-ccbe-460d-90f0-e1cb0a3d891f)

<!-- Greeting -->
Hey @Elena4750! I'm here to help you with any bugs, questions, or contributions you have in mind. Let's work together to tackle this issue!

<!-- Answer -->
Yes, the `RuntimeError` indicating that an event loop is already running can occur when using the `evaluate` function from the `ragas` package in Python 3.10. This is likely due to the `is_async` parameter being set to `True` by default, which attempts to run the evaluation asynchronously.

To resolve this issue, you can set the `is_async` parameter to `False` when calling the `evaluate` function. Here is an example:

```python
from ragas import evaluate

# Assuming `dataset` and `metrics` are already defined
result = evaluate(dataset, metrics=metrics, is_async=False)
df = result.to_pandas()
print(df)
```

This will run the evaluation in synchronous mode and should avoid the `RuntimeError` related to the event loop <sup>[[1]](https://github.com/explodinggradients/ragas/blob/main/src/ragas/evaluation.py)</sup><sup>[[2]](https://github.com/explodinggradients/ragas/blob/main/src/ragas/executor.py)</sup>.

Additionally, for the `ExceptionInRunner` issue, you can pass `raise_exceptions=False` in the `evaluate` function to show only a warning message instead of raising an exception:

```python
result = evaluate(dataset, metrics=metrics, is_async=False, raise_exceptions=False)
df = result.to_pandas()
print(df)
```

This will prevent the runner thread from raising an exception and will only show a warning message instead <sup>[[3]](https://github.com/explodinggradients/ragas/issues/934)</sup>.


<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*


Sad. Have tried, not worked.

Getting a similar issue on Python 3.11 - latest version of RAGAS library, but when trying to generate a syntetic dataset with ".generate_with_langchain_docs".

Here is my traceback:
RuntimeWarning: coroutine 'as_completed.<locals>.sema_coro' was never awaited
  await self._event_pipe_gc()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

I am also getting a similar issue while generating a synthetic dataset.  

Traceback:
File "/home/ubuntu/.local/lib/python3.10/site-packages/ragas/executor.py", line 37, in sema_coro
    return await coro
  File "/home/ubuntu/.local/lib/python3.10/site-packages/ragas/executor.py", line 109, in wrapped_callable_async
    raise e
  File "/home/ubuntu/.local/lib/python3.10/site-packages/ragas/executor.py", line 104, in wrapped_callable_async
    result = await callable(*args, **kwargs)
TypeError: object list can't be used in 'await' expression

As additional info, I installed version 0.1.9 and the error disappeared. 

Hello, I have encountered the same situation, which has been successfully solved by the following methods.

https://github.com/explodinggradients/ragas/issues/1073

> Hello, I have encountered the same situation, which has been successfully solved by the following methods.
> 
> #1073

what python version did you use?