From 01fbf73ce5db52a28be534ea9dc5767619c0f91f Mon Sep 17 00:00:00 2001 From: Vidit-Ostwal Date: Mon, 10 Feb 2025 02:25:29 +0530 Subject: [PATCH] Fixed lint issues --- src/crewai/crew.py | 6 +++++- src/crewai/utilities/evaluators/crew_evaluator_handler.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/crewai/crew.py b/src/crewai/crew.py index 55981fb64..12b0d9aa8 100644 --- a/src/crewai/crew.py +++ b/src/crewai/crew.py @@ -1125,13 +1125,17 @@ class Crew(BaseModel): def test( self, n_iterations: int, - eval_llm: Union[str, InstanceOf[LLM], Any] = Field(description="Language model that will run the agent.", default=None), + eval_llm: Union[str, InstanceOf[LLM]], inputs: Optional[Dict[str, Any]] = None, ) -> None: """Test and evaluate the Crew with the given inputs for n iterations concurrently using concurrent.futures.""" test_crew = self.copy() + eval_llm = create_llm(eval_llm) + if not eval_llm: + raise ValueError("Failed to create LLM instance.") + self._test_execution_span = test_crew._telemetry.test_execution_span( test_crew, n_iterations, diff --git a/src/crewai/utilities/evaluators/crew_evaluator_handler.py b/src/crewai/utilities/evaluators/crew_evaluator_handler.py index 1393cdf56..94a1cd080 100644 --- a/src/crewai/utilities/evaluators/crew_evaluator_handler.py +++ b/src/crewai/utilities/evaluators/crew_evaluator_handler.py @@ -24,7 +24,7 @@ class CrewEvaluator: Attributes: crew (Crew): The crew of agents to evaluate. - openai_model_name (str): The model to use for evaluating the performance of the agents (for now ONLY OpenAI accepted). + eval_llm (LLM): Language model instance to use for evaluations tasks_scores (defaultdict): A dictionary to store the scores of the agents for each task. iteration (int): The current iteration of the evaluation. """