Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion deepeval/metrics/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,15 @@ def check_arena_test_case_params(


def trimAndLoadJson(
input_string: str,
input_string: Optional[str],
metric: Optional[BaseMetric] = None,
) -> Any:
if input_string is None:
error_str = "Evaluation LLM outputted an invalid JSON. Please use a better evaluation model."
if metric is not None:
metric.error = error_str
raise ValueError(error_str)

start = input_string.find("{")
end = input_string.rfind("}") + 1

Expand Down
Loading