mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 16:18:30 +00:00
fix: improve type validation logic to fix type checker error
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -232,10 +232,9 @@ class Task(BaseModel):
|
||||
}
|
||||
|
||||
# Check if the normalized annotation matches any valid pattern
|
||||
is_valid = (
|
||||
normalized_annotation == 'tuple[bool,any]' or
|
||||
any(normalized_annotation == pattern for pattern in VALID_RETURN_TYPES)
|
||||
)
|
||||
is_valid = normalized_annotation == 'tuple[bool,any]'
|
||||
if not is_valid:
|
||||
is_valid = normalized_annotation in VALID_RETURN_TYPES
|
||||
|
||||
if not is_valid:
|
||||
raise GuardrailValidationError(
|
||||
|
||||
Reference in New Issue
Block a user