Skip to content

Commit

Permalink
Fixing evaluator reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomdmoura committed Aug 11, 2024
1 parent c2d12b2 commit ed5d81f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/crewai/telemetry/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ def individual_test_result_span(
self._add_attribute(span, "quality", str(quality))
self._add_attribute(span, "exec_time", str(exec_time))
self._add_attribute(span, "model_name", model_name)
return span
span.set_status(Status(StatusCode.OK))
span.end()
except Exception:
pass

Expand Down Expand Up @@ -338,7 +339,8 @@ def test_execution_span(
span, "inputs", json.dumps(inputs) if inputs else None
)

return span
span.set_status(Status(StatusCode.OK))
span.end()
except Exception:
pass

Expand Down
2 changes: 1 addition & 1 deletion src/crewai/utilities/evaluators/crew_evaluator_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def evaluate(self, task_output: TaskOutput):

if isinstance(evaluation_result.pydantic, TaskEvaluationPydanticOutput):
self._test_result_span = self._telemetry.individual_test_result_span(
self,
self.crew,
evaluation_result.pydantic.quality,
current_task._execution_time,
self.openai_model_name,
Expand Down

0 comments on commit ed5d81f

Please sign in to comment.