mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 23:58:34 +00:00
fix: add mode='before' to allowed_agents validator to fix validation order
Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
@@ -25,7 +25,6 @@ from crewai.security.security_config import SecurityConfig
|
||||
from crewai.tools.base_tool import BaseTool, Tool
|
||||
from crewai.utilities import I18N, Logger, RPMController
|
||||
from crewai.utilities.config import process_config
|
||||
from crewai.utilities.converter import Converter
|
||||
from crewai.utilities.string_utils import interpolate_only
|
||||
|
||||
T = TypeVar("T", bound="BaseAgent")
|
||||
@@ -199,7 +198,7 @@ class BaseAgent(ABC, BaseModel):
|
||||
)
|
||||
return processed_tools
|
||||
|
||||
@field_validator("allowed_agents")
|
||||
@field_validator("allowed_agents", mode="before")
|
||||
@classmethod
|
||||
def validate_allowed_agents(cls, allowed_agents: Optional[List[Union[str, "BaseAgent"]]]) -> Optional[List[Union[str, "BaseAgent"]]]:
|
||||
"""Validate the allowed_agents list."""
|
||||
|
||||
Reference in New Issue
Block a user