Skip to content

Commit ba4ffbd

Browse files
authored
Merge branch 'main' into api-spec-bot-270f036
2 parents 3720157 + c984097 commit ba4ffbd

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

langfuse/_client/datasets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def answer_questions(*, item, **kwargs):
286286
287287
def accuracy_evaluator(*, input, output, expected_output=None, **kwargs):
288288
if not expected_output:
289-
return {"name": "accuracy", "value": None, "comment": "No expected output"}
289+
return {"name": "accuracy", "value": 0, "comment": "No expected output"}
290290
291291
is_correct = output.strip().lower() == expected_output.strip().lower()
292292
return {

langfuse/experiment.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ def __call__(
719719
```python
720720
def accuracy_evaluator(*, input, output, expected_output=None, **kwargs):
721721
if expected_output is None:
722-
return {"name": "accuracy", "value": None, "comment": "No expected output"}
722+
return {"name": "accuracy", "value": 0, "comment": "No expected output"}
723723
724724
is_correct = output.strip().lower() == expected_output.strip().lower()
725725
return {
@@ -773,7 +773,7 @@ async def llm_judge_evaluator(*, input, output, expected_output=None, **kwargs):
773773
except ValueError:
774774
return {
775775
"name": "llm_judge_quality",
776-
"value": None,
776+
"value": 0,
777777
"comment": "Could not parse LLM judge score"
778778
}
779779
```
@@ -867,7 +867,7 @@ def average_accuracy(*, item_results, **kwargs):
867867
accuracy_values.append(evaluation.value)
868868
869869
if not accuracy_values:
870-
return {"name": "avg_accuracy", "value": None, "comment": "No accuracy evaluations found"}
870+
return {"name": "avg_accuracy", "value": 0, "comment": "No accuracy evaluations found"}
871871
872872
avg = sum(accuracy_values) / len(accuracy_values)
873873
return {

0 commit comments

Comments
 (0)