Repository: explodinggradients/ragas
Issue: ValueError: Argument 'prompts' is expected to be of type List[str]
Root cause: Interface Contract Mismatch

[x ] I have checked the [documentation](https://docs.ragas.io/) and related resources and couldn't resolve my bug.

**Describe the bug**
`ValueError: Argument 'prompts' is expected to be of type List[str], received argument of type <class 'langchain_core.prompt_values.StringPromptValue'>.` while evaluating metrics. 

Ragas version: 0.2.7
Python version: 3.10.12

**Code to Reproduce**
```
from ragas import SingleTurnSample 
from ragas.metrics import ResponseRelevancy

sample = SingleTurnSample(
        user_input="When was the first super bowl?",
        response="The first superbowl was held on Jan 15, 1967",
        retrieved_contexts=[
            "The First AFL–NFL World Championship Game was an American football game played on January 15, 1967, at the Los Angeles Memorial Coliseum in Los Angeles."
        ]
    )

scorer = ResponseRelevancy(llm=evaluator_llm)
await scorer.single_turn_ascore(sample)
```


**Error trace**
```
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[14], line 13
      4 sample = SingleTurnSample(
      5         user_input="When was the first super bowl?",
      6         response="The first superbowl was held on Jan 15, 1967",
   (...)
      9         ]
     10     )
     12 scorer = ResponseRelevancy(llm=evaluator_llm)
---> 13 await scorer.single_turn_ascore(sample)

File ~/langchain-chatqa/.env/lib/python3.10/site-packages/ragas/metrics/base.py:355, in SingleTurnMetric.single_turn_ascore(self, sample, callbacks, timeout)
    353     if not group_cm.ended:
    354         rm.on_chain_error(e)
--> 355     raise e
    356 else:
    357     if not group_cm.ended:

File ~/langchain-chatqa/.env/lib/python3.10/site-packages/ragas/metrics/base.py:348, in SingleTurnMetric.single_turn_ascore(self, sample, callbacks, timeout)
    341 rm, group_cm = new_group(
    342     self.name,
    343     inputs=sample.to_dict(),
    344     callbacks=callbacks,
    345     metadata={"type": ChainType.METRIC},
    346 )
    347 try:
--> 348     score = await asyncio.wait_for(
    349         self._single_turn_ascore(sample=sample, callbacks=group_cm),
    350         timeout=timeout,
    351     )
    352 except Exception as e:
    353     if not group_cm.ended:

File /usr/lib/python3.10/asyncio/tasks.py:408, in wait_for(fut, timeout)
    405 loop = events.get_running_loop()
    407 if timeout is None:
--> 408     return await fut
    410 if timeout <= 0:
    411     fut = ensure_future(fut, loop=loop)

File ~/langchain-chatqa/.env/lib/python3.10/site-packages/ragas/metrics/_answer_relevance.py:133, in ResponseRelevancy._single_turn_ascore(self, sample, callbacks)
    129 async def _single_turn_ascore(
    130     self, sample: SingleTurnSample, callbacks: Callbacks
    131 ) -> float:
    132     row = sample.to_dict()
--> 133     return await self._ascore(row, callbacks)

File ~/langchain-chatqa/.env/lib/python3.10/site-packages/ragas/metrics/_answer_relevance.py:141, in ResponseRelevancy._ascore(self, row, callbacks)
    139 responses = []
    140 for _ in range(self.strictness):
--> 141     response = await self.question_generation.generate(
    142         data=prompt_input,
    143         llm=self.llm,
    144         callbacks=callbacks,
    145     )
    146     responses.append(response)
    148 return self._calculate_score(responses, row)

File ~/langchain-chatqa/.env/lib/python3.10/site-packages/ragas/prompt/pydantic_prompt.py:125, in PydanticPrompt.generate(self, llm, data, temperature, stop, callbacks, retries_left)
    122 callbacks = callbacks or []
    124 # this is just a special case of generate_multiple
--> 125 output_single = await self.generate_multiple(
    126     llm=llm,
    127     data=data,
    128     n=1,
    129     temperature=temperature,
    130     stop=stop,
    131     callbacks=callbacks,
    132     retries_left=retries_left,
    133 )
    134 return output_single[0]

File ~/langchain-chatqa/.env/lib/python3.10/site-packages/ragas/prompt/pydantic_prompt.py:185, in PydanticPrompt.generate_multiple(self, llm, data, n, temperature, stop, callbacks, retries_left)
    178 prompt_rm, prompt_cb = new_group(
    179     name=self.name,
    180     inputs={"data": processed_data},
    181     callbacks=callbacks,
    182     metadata={"type": ChainType.RAGAS_PROMPT},
    183 )
    184 prompt_value = PromptValue(text=self.to_string(processed_data))
--> 185 resp = await llm.generate(
    186     prompt_value,
    187     n=n,
    188     temperature=temperature,
    189     stop=stop,
    190     callbacks=prompt_cb,
    191 )
    193 output_models = []
    194 parser = RagasOutputParser(pydantic_object=self.output_model)

File ~/langchain-chatqa/.env/lib/python3.10/site-packages/langchain_core/language_models/llms.py:852, in BaseLLM.generate(self, prompts, stop, callbacks, tags, metadata, run_name, run_id, **kwargs)
    847 if not isinstance(prompts, list):
    848     msg = (
    849         "Argument 'prompts' is expected to be of type List[str], received"
    850         f" argument of type {type(prompts)}."
    851     )
--> 852     raise ValueError(msg)
    853 # Create callback managers
    854 if isinstance(metadata, list):

ValueError: Argument 'prompts' is expected to be of type List[str], received argument of type <class 'langchain_core.prompt_values.StringPromptValue'>.
```
**Expected behavior**
The evaluation metric fails with mismatch of expected prompt argument type after the latest release. The Response relevancy metric expects an LLM even if the documentation example code doesn't specify the same. 
1. Fix the metrics failing with ValueError for prompts argument
2. Update documentation for the metrics to be executable


**Additional context**
First time RAGAS user! Let me know if I can help further.

<!-- PS: bugs suck but is also part of the process. We sincerely apologies for breaking your flow because of it, but don't worry, we got your back ❤️. We will get this fixed as fast as we can and thanks for helping us out by reporting it 🙏. -->


Hi @sairampillai,

Are you still facing this issue?
The response answer relevancy metric requires both an LLM and an embedder. Please refer to the code below for reference:

```python
from ragas import SingleTurnSample 
from ragas.metrics import ResponseRelevancy
from ragas.llms import LangchainLLMWrapper
from langchain_openai.embeddings import OpenAIEmbeddings
from langchain_openai import ChatOpenAI

evaluator_llm = LangchainLLMWrapper(ChatOpenAI(model="gpt-4o-mini"))
embeddings = OpenAIEmbeddings(model="text-embedding-3-small")

sample = SingleTurnSample(
        user_input="When was the first super bowl?",
        response="The first superbowl was held on Jan 15, 1967",
        retrieved_contexts=[
            "The First AFL–NFL World Championship Game was an American football game played on January 15, 1967, at the Los Angeles Memorial Coliseum in Los Angeles."
        ]
    )

scorer = ResponseRelevancy(llm=evaluator_llm, embeddings=embeddings)
await scorer.single_turn_ascore(sample)
```

It seems the issue was answered, closing this now.