Skip to content

Commit

Permalink
Merge pull request #474 from parea-ai/PAI-701-enable-returning-none-f…
Browse files Browse the repository at this point in the history
…or-eval-function-to-be-ignored

feat: enable skipping eval functions
  • Loading branch information
joschkabraun committed Feb 16, 2024
2 parents 19a2cd5 + 0c5207f commit b222825
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion parea/utils/trace_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ def call_eval_funcs_then_log(trace_id: str, eval_funcs: list[Callable] = None):
scores = []
for func in eval_funcs:
try:
scores.append(NamedEvaluationScore(name=func.__name__, score=func(data)))
score = func(data)
if score is not None:
scores.append(NamedEvaluationScore(name=func.__name__, score=score))
except Exception as e:
logger.exception(f"Error occurred calling evaluation function '{func.__name__}', {e}", exc_info=e)
parea_logger.update_log(data=UpdateLog(trace_id=trace_id, field_name_to_value_map={"scores": scores}))
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "parea-ai"
packages = [{ include = "parea" }]
version = "0.2.75"
version = "0.2.76"
description = "Parea python sdk"
readme = "README.md"
authors = ["joel-parea-ai <[email protected]>"]
Expand Down

0 comments on commit b222825

Please sign in to comment.