Repository: confident-ai/deepeval
Issue: Contextual Relevancy is not implemented the way it's documented
Root cause: Documentation Deficiency

**❗BEFORE YOU BEGIN❗**
Are you on discord? 🤗 We'd love to have you asking questions on discord instead: https://discord.com/invite/a3K9c8GRGt

**Describe the bug**
In the deepeval [documentation](https://docs.confident-ai.com/docs/metrics-contextual-relevancy), it is stated that `ContextualRelevancyMetric first uses an LLM to extract all statements made in the retrieval_context instead, before using the same LLM to classify whether each statement is relevant to the input.` However, from [this code](https://github.com/confident-ai/deepeval/blob/0f94fd321fa03e2ef7b66ce0e9ff165940999c9e/deepeval/metrics/contextual_relevancy/contextual_relevancy.py#L222), it is obvious that one verdict is generated on each string of retrieved context and there is no implementation of extracting statements from context with LLM.

Is this something expected? Why?

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
 - OS: [e.g. iOS]
 - Browser [e.g. chrome, safari]
 - Version [e.g. 22]

**Smartphone (please complete the following information):**
 - Device: [e.g. iPhone6]
 - OS: [e.g. iOS8.1]
 - Browser [e.g. stock browser, safari]
 - Version [e.g. 22]

**Additional context**
Add any other context about the problem here.


I think my issue is related with this.

Per the [docs](https://docs.confident-ai.com/docs/metrics-contextual-relevancy), the required arguments are: `input`, `actual_output`, and `retrieval_context`. However, passing that causes an error.

```python
     73 test_case = LLMTestCase(
     74     input=query,
     75     actual_output=response,
     76     retrieval_context=retrieved_contexts,
     77 )
---> 78 metric.measure(test_case)
     79 return metric.score, metric.reason

File /opt/conda/lib/python3.10/site-packages/deepeval/metrics/contextual_relevancy/contextual_relevancy.py:71, in ContextualRelevancyMetric.measure(self, test_case, _show_indicator)
     66 self.verdicts_list: List[ContextualRelevancyVerdicts] = [
     67     (self._generate_verdicts(test_case.input, context))
     68     for context in test_case.retrieval_context
     69 ]
     70 self.score = self._calculate_score()
---> 71 self.reason = self._generate_reason(test_case.input)
     72 self.success = self.score >= self.threshold
     73 self.verbose_logs = construct_verbose_logs(
     74     self,
     75     steps=[
   (...)
     78     ],
     79 )

File /opt/conda/lib/python3.10/site-packages/deepeval/metrics/contextual_relevancy/contextual_relevancy.py:162, in ContextualRelevancyMetric._generate_reason(self, input)
    159         if verdict.verdict.lower() == "no":
    160             irrelevancies.append(verdict.reason)
--> 162 prompt: dict = ContextualRelevancyTemplate.generate_reason(
    163     input=input,
    164     irrelevancies=irrelevancies,
    165     score=format(self.score, ".2f"),
    166 )
    167 if self.using_native_model:
    168     res, cost = self.model.generate(prompt)

TypeError: ContextualRelevancyTemplate.generate_reason() missing 1 required positional argument: 'relevant_statements'
```

I think I may have found the reason why. The async method `_a_generate_reason` has the `relevant_statements`, but the non-async `_generate_reason` has none.

https://github.com/confident-ai/deepeval/blob/15372956566fd3be01da3dd19c476cd89225e73b/deepeval/metrics/contextual_relevancy/contextual_relevancy.py#L119-L137
https://github.com/confident-ai/deepeval/blob/15372956566fd3be01da3dd19c476cd89225e73b/deepeval/metrics/contextual_relevancy/contextual_relevancy.py#L152-L166