|
10 | 10 |
|
11 | 11 | from ragas._analytics import EvaluationEvent, track |
12 | 12 | from ragas.callbacks import new_group |
13 | | -from ragas.embeddings.base import BaseRagasEmbeddings, LangchainEmbeddingsWrapper, embedding_factory |
| 13 | +from ragas.embeddings.base import ( |
| 14 | + BaseRagasEmbeddings, |
| 15 | + LangchainEmbeddingsWrapper, |
| 16 | + embedding_factory, |
| 17 | +) |
14 | 18 | from ragas.llms import llm_factory |
15 | 19 | from ragas.exceptions import ExceptionInRunner |
16 | 20 | from ragas.executor import Executor |
|
36 | 40 | def evaluate( |
37 | 41 | dataset: Dataset, |
38 | 42 | metrics: list[Metric] | None = None, |
39 | | - llm: t.Optional[BaseRagasLLM] = None, |
40 | | - embeddings: t.Optional[BaseRagasEmbeddings] = None, |
| 43 | + llm: t.Optional[BaseRagasLLM | LangchainLLM] = None, |
| 44 | + embeddings: t.Optional[BaseRagasEmbeddings | LangchainEmbeddings] = None, |
41 | 45 | callbacks: Callbacks = [], |
42 | 46 | is_async: bool = False, |
43 | 47 | max_workers: t.Optional[int] = None, |
@@ -79,7 +83,7 @@ def evaluate( |
79 | 83 | run_config: RunConfig, optional |
80 | 84 | Configuration for runtime settings like timeout and retries. If not provided, |
81 | 85 | default values are used. |
82 | | - raise_exceptions: bool, optional |
| 86 | + raise_exceptions: True |
83 | 87 | Whether to raise exceptions or not. If set to True then the evaluation will |
84 | 88 | raise an exception if any of the metrics fail. If set to False then the |
85 | 89 | evaluation will return `np.nan` for the row that failed. Default is True. |
|
0 commit comments