fix: improve type validation logic to fix type checker error

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-02-20 17:03:22 +00:00
parent 5f3eb3605a
commit 6a59194e6f

View File

@@ -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(