mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +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.tools.base_tool import BaseTool, Tool
|
||||||
from crewai.utilities import I18N, Logger, RPMController
|
from crewai.utilities import I18N, Logger, RPMController
|
||||||
from crewai.utilities.config import process_config
|
from crewai.utilities.config import process_config
|
||||||
from crewai.utilities.converter import Converter
|
|
||||||
from crewai.utilities.string_utils import interpolate_only
|
from crewai.utilities.string_utils import interpolate_only
|
||||||
|
|
||||||
T = TypeVar("T", bound="BaseAgent")
|
T = TypeVar("T", bound="BaseAgent")
|
||||||
@@ -199,7 +198,7 @@ class BaseAgent(ABC, BaseModel):
|
|||||||
)
|
)
|
||||||
return processed_tools
|
return processed_tools
|
||||||
|
|
||||||
@field_validator("allowed_agents")
|
@field_validator("allowed_agents", mode="before")
|
||||||
@classmethod
|
@classmethod
|
||||||
def validate_allowed_agents(cls, allowed_agents: Optional[List[Union[str, "BaseAgent"]]]) -> Optional[List[Union[str, "BaseAgent"]]]:
|
def validate_allowed_agents(cls, allowed_agents: Optional[List[Union[str, "BaseAgent"]]]) -> Optional[List[Union[str, "BaseAgent"]]]:
|
||||||
"""Validate the allowed_agents list."""
|
"""Validate the allowed_agents list."""
|
||||||
|
|||||||
Reference in New Issue
Block a user