refactor: implement review suggestions

- Extract model conversion logic to _get_llm_instance helper method
- Improve error message clarity
- Simplify LLM instance creation in CrewEvaluator

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-02-09 22:52:13 +00:00
parent 0ab66041da
commit f4efdc55e2
2 changed files with 18 additions and 9 deletions

View File

@@ -36,10 +36,7 @@ class CrewEvaluator:
def __init__(self, crew, llm: Union[str, LLM]):
self.crew = crew
if isinstance(llm, str):
self.llm = LLM(model=llm)
else:
self.llm = llm
self.llm = LLM(model=llm) if isinstance(llm, str) else llm
self._telemetry = Telemetry()
self._setup_for_evaluating()