Skip to content

Commit 4d854ed

Browse files
author
Andrei Bratu
committed
Rebase changes
1 parent cdbe070 commit 4d854ed

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/humanloop/eval_utils/run.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
from logging import INFO
2525
from typing import Callable, Dict, List, Literal, Optional, Sequence, Tuple, TypeVar, Union
2626

27-
from pydantic import ValidationError
28-
2927
from humanloop import EvaluatorResponse, FlowResponse, PromptResponse, ToolResponse
3028
from humanloop.core.api_error import ApiError
3129
from humanloop.eval_utils.context import EvaluationContext
@@ -59,6 +57,7 @@
5957
from humanloop.types.datapoint_response_target_value import DatapointResponseTargetValue
6058
from humanloop.types.evaluation_run_response import EvaluationRunResponse
6159
from humanloop.types.run_stats_response import RunStatsResponse
60+
from humanloop.types.validation_error import ValidationError
6261

6362
if typing.TYPE_CHECKING:
6463
from humanloop.client import BaseHumanloop
@@ -305,7 +304,6 @@ def run_eval(
305304
file_dict = {**file_, **version}
306305
hl_file: Union[PromptResponse, FlowResponse, ToolResponse, EvaluatorResponse]
307306

308-
# NOTE: This could be cleaner, use polymorphism to avoid the if-else
309307
if type_ == "flow":
310308
# Be more lenient with Flow versions as they are arbitrary json
311309
try:
@@ -716,7 +714,7 @@ def _check_evaluation_improvement(
716714
return True, 0, 0
717715

718716
previous_evaluator_stats_by_path = _get_evaluator_stats_by_path(
719-
stat=stats.run_stats[1],
717+
stat=stats.run_stats[1], # Latest Run is at index 0; previous Run is at index 1
720718
evaluation=evaluation,
721719
)
722720
if evaluator_path in latest_evaluator_stats_by_path and evaluator_path in previous_evaluator_stats_by_path:

0 commit comments

Comments
 (0)