Repository: explodinggradients/ragas
Issue: Code example for DiscreteMetric in the docs fails
Root cause: Documentation Deficiency

[x] I have checked the [documentation](https://docs.ragas.io/) and related resources and couldn't resolve my bug.

**Describe the bug**
Running this DiscreteMetric code snippet from [the docs](https://docs.ragas.io/en/latest/concepts/metrics/available_metrics/general_purpose/#simple-criteria-scoring) throws an error:
<img width="860" height="397" alt="Image" src="https://github.com/user-attachments/assets/4c92fb69-7c7d-46e5-923f-87f1861f387f" />

Not sure why this is happening since it seems `DiscreteMetric`'s docstrings expects an `llm` passed in: https://github.com/vibrantlabsai/ragas/blob/d55c22da231746ec5491418be85404c576a5a9ed/src/ragas/metrics/discrete.py#L20
If I take out the `llm` argument:
<img width="935" height="382" alt="Image" src="https://github.com/user-attachments/assets/86513b1d-8fbf-4bfa-9037-733620e91c4c" />

It works when I pass the llm into the `ascore` call:
<img width="750" height="535" alt="Image" src="https://github.com/user-attachments/assets/d24a006c-1a16-4528-849d-630176dd0977" />

Is this expected?

Ragas version: 0.4.1
Python version: 3.10.13

**Code to Reproduce**
```python
from openai import AsyncOpenAI
from ragas.llms import llm_factory
from ragas.metrics import DiscreteMetric
from ragas.dataset_schema import SingleTurnSample

# Setup
client = AsyncOpenAI()
llm = llm_factory("gpt-4o-mini", client=client)

# Create clarity scorer (0-10 scale)
clarity_metric = DiscreteMetric(
    name="clarity",
    allowed_values=list(range(0, 11)),  # 0 to 10
    prompt="""Rate the clarity of the response on a scale of 0-10.
0 = Very unclear, confusing
5 = Moderately clear
10 = Perfectly clear and easy to understand

Response: {response}

Respond with only the number (0-10).""",
    llm=llm
)

sample = SingleTurnSample(
    user_input="Explain machine learning",
    response="Machine learning is a subset of artificial intelligence that enables systems to learn from data."
)

result = await clarity_metric.ascore(response=sample.response)
print(f"Clarity Score: {result.value}")  # Output: e.g., 8
```

**Error trace**

**Expected behavior**
I should be able to initialize `DiscreteMetric` with an llm, or there should be a docs update.

<!-- 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 @SomtochiUmeh

I tried to reproduce this on `ragas==0.4.2` (Python 3.13) using OpenRouter, and yes, `DiscreteMetric(..., llm=llm)` throws:

`TypeError: DiscreteMetric.__init__() got an unexpected keyword argument 'llm'`.

If I create it without `llm` and pass `llm=...` into `ascore(...)`, it works fine (I got a score like `9`).

If I don’t pass `llm` anywhere, it fails with `KeyError('llm')`.

Also checked `ragas.metrics.discrete.py`: `DiscreteMetric` is a dataclass but it only defines `allowed_values` (no `llm` field), even though the docstring/example mentions `llm` in the constructor.

@anistark 
do you want this fixed by updating the docs to always pass `llm` at `ascore(...)` time, or should `DiscreteMetric` be changed to accept/store `llm` like the other LLM-based metrics?