Deepeval
DeepEval Metric Integration.
DeepEvalMetric(metric, name)
Bases: BaseMetric
DeepEval Metric.
A wrapper for DeepEval metrics.
Available Fields
- query (str): The query to evaluate the metric. Similar to
inputinLLMTestCaseParams. - generated_response (str | list[str], optional): The generated response to evaluate the metric. Similar to
actual_outputinLLMTestCaseParams. If the generated response is a list, the responses are concatenated into a single string. - expected_response (str | list[str], optional): The expected response to evaluate the metric. Similar to
expected_outputinLLMTestCaseParams. If the expected response is a list, the responses are concatenated into a single string. - expected_retrieved_context (str | list[str], optional): The expected retrieved context to evaluate the metric.
Similar to
contextinLLMTestCaseParams. If the expected retrieved context is a str, it will be converted into a list with a single element. - retrieved_context (str | list[str], optional): The list of retrieved contexts to evaluate the metric. Similar
to
retrieval_contextinLLMTestCaseParams. If the retrieved context is a str, it will be converted into a list with a single element.
Scoring
- 0.0-1.0 (Continuous): Or Boolean depending on the DeepEval metric.
Initializes the DeepEvalMetric class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metric
|
BaseMetric
|
The DeepEval metric to wrap. |
required |
name
|
str
|
The name of the metric. |
required |
DeepEvalMetricFactory(name, model, model_credentials, model_config, batch_status_check_interval=DefaultValues.BATCH_STATUS_CHECK_INTERVAL, batch_max_iterations=DefaultValues.BATCH_MAX_ITERATIONS, **kwargs)
Bases: DeepEvalMetric, ABC
DeepEval Metric Factory.
Abstract base class for creating DeepEval metrics with a shared model invoker.
Available Fields
- (Dynamic): Depends on the specific DeepEval metric being created.
Scoring
- (Dynamic): Depends on the specific DeepEval metric.
Initializes the metric, handling common model invoker creation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name for the metric. |
required |
model
|
Union[str, ModelId, BaseLMInvoker]
|
The model identifier or an existing LM invoker instance. |
required |
model_credentials
|
Optional[str]
|
Credentials for the model, required if |
required |
model_config
|
Optional[Dict[str, Any]]
|
Configuration for the model. |
required |
batch_status_check_interval
|
float
|
Time between batch status checks in seconds. Defaults to 30.0. |
BATCH_STATUS_CHECK_INTERVAL
|
batch_max_iterations
|
int
|
Maximum number of status check iterations before timeout. Defaults to 120. |
BATCH_MAX_ITERATIONS
|
**kwargs
|
Additional arguments for the specific DeepEval metric constructor. |
{}
|