mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 15:48:29 +00:00
fix: address type-checker and lint issues
- Add proper type hints in Crew.test() - Fix import sorting in test file Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -1163,7 +1163,7 @@ class Crew(BaseModel):
|
||||
if not llm and not openai_model_name:
|
||||
raise ValueError("Either llm or openai_model_name must be provided")
|
||||
|
||||
model_to_use = llm or openai_model_name
|
||||
model_to_use: Union[str, LLM] = llm if llm is not None else openai_model_name
|
||||
if isinstance(model_to_use, str):
|
||||
model_to_use = LLM(model=model_to_use)
|
||||
|
||||
@@ -1173,8 +1173,8 @@ class Crew(BaseModel):
|
||||
test_crew,
|
||||
n_iterations,
|
||||
inputs,
|
||||
str(model_to_use.model), # type: ignore[arg-type]
|
||||
) # type: ignore[arg-type]
|
||||
str(model_to_use.model),
|
||||
)
|
||||
evaluator = CrewEvaluator(test_crew, model_to_use)
|
||||
|
||||
for i in range(1, n_iterations + 1):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
from crewai.agent import Agent
|
||||
from crewai.crew import Crew
|
||||
from crewai.llm import LLM
|
||||
|
||||
Reference in New Issue
Block a user