Skip to content

Commit d11155e

Browse files
committed
docs: Evaluation score cannot be None
1 parent cf653e9 commit d11155e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

langfuse/experiment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class Evaluation:
124124
125125
def accuracy_evaluator(*, input, output, expected_output=None, **kwargs):
126126
if not expected_output:
127-
return Evaluation(name="accuracy", value=None, comment="No expected output")
127+
return Evaluation(name="accuracy", value=0, comment="No expected output")
128128
129129
is_correct = output.strip().lower() == expected_output.strip().lower()
130130
return Evaluation(
@@ -170,7 +170,7 @@ def external_api_evaluator(*, input, output, **kwargs):
170170
except Exception as e:
171171
return Evaluation(
172172
name="external_score",
173-
value=None,
173+
value=0,
174174
comment=f"API unavailable: {e}",
175175
metadata={"error": str(e), "retry_count": 3}
176176
)

0 commit comments

Comments
 (0)