Repository: explodinggradients/ragas
Issue: TypeError: collections metrics not recognized by evaluate()/aevaluate() isinstance check in v0.4.0
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**
The `evaluate()` and `aevaluate()` functions in RAGAS v0.4.0 fail with a `TypeError` when using metrics from `ragas.metrics.collections` (e.g., `Faithfulness`, `AnswerRelevancy`, `ContextPrecision`, `ContextRecall`). The error message states "All metrics must be initialised. Found uninitialized metrics."

The root cause is an `isinstance()` check on line 124 of `ragas/evaluation.py` that checks if metrics are instances of the old `Metric` class from `ragas.metrics`, but the new collections metrics inherit from `BaseMetric` in `ragas.metrics.collections.base`, causing the validation to fail.

This makes the v0.4.0 collections metrics unusable with the evaluation functions, despite the migration guide recommending their use.

Ragas version: 0.4.0
Python version: 3.12

**Code to Reproduce**
```
python
import os
from ragas import evaluate
from ragas.llms import llm_factory
from ragas.embeddings import embedding_factory
from ragas.metrics.collections import Faithfulness, AnswerRelevancy, ContextPrecision, ContextRecall
from datasets import Dataset

# Azure OpenAI setup
os.environ["AZURE_OPENAI_ENDPOINT"] = "https://your-endpoint.openai.azure.com/"
os.environ["AZURE_OPENAI_API_KEY"] = "your-api-key"
os.environ["OPENAI_API_VERSION"] = "2025-08-07"

# Create LLM and embeddings using v0.4 factories
llm = llm_factory(
    model="azure/your-deployment-name",
    temperature=1.0
)

embeddings = embedding_factory(
    model="azure/your-embeddings-deployment"
)

# Initialize metrics with llm and embeddings
metrics = [
    Faithfulness(llm=llm),
    AnswerRelevancy(llm=llm, embeddings=embeddings),
    ContextPrecision(llm=llm),
    ContextRecall(llm=llm)
]

# Sample dataset
data = {
    "question": ["What is the capital of France?"],
    "answer": ["The capital of France is Paris."],
    "contexts": [["Paris is the capital and largest city of France."]],
    "ground_truth": ["Paris is the capital of France."]
}
dataset = Dataset.from_dict(data)

# This fails with TypeError
result = evaluate(dataset, metrics=metrics) 

Error trace
Traceback (most recent call last):
  File "/app/test_ragas_config.py", line 91, in <module>
    asyncio.run(test_evaluation())
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/app/test_ragas_config.py", line 86, in test_evaluation
    result = evaluate(
             ^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/ragas/evaluation.py", line 124, in evaluate
    raise TypeError(
TypeError: All metrics must be initialised. Found metrics that are not initialised: {'Faithfulness', 'ContextRecall', 'ContextPrecision', 'AnswerRelevancy'}.
```


# Expected behavior
The evaluate() function should recognize metrics from ragas.metrics.collections as valid initialized metrics and proceed with the evaluation, as documented in the migration guide.

# Additional context
The issue is in ragas/evaluation.py line 124:
`if not all(isinstance(m, Metric) for m in metrics):`

This checks for the old Metric class from ragas.metrics, but collections metrics inherit from BaseMetric in ragas.metrics.collections.base. The fix would be to update the isinstance check to:
`if not all(isinstance(m, (Metric, BaseMetric)) for m in metrics):`

This bug completely blocks the v0.4.0 upgrade path for users following the official migration guide, as collections metrics cannot be used with evaluate() or aevaluate().

@bujarinnovationnorway collections metrics don't work with evaluate/aevaluate. Please checkout the latest [docs](https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/).
evaluate/aevaluate will be deprecated and removed soon.

It seems the issue was answered, closing this now.