mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +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
|
# Check if the normalized annotation matches any valid pattern
|
||||||
is_valid = (
|
is_valid = normalized_annotation == 'tuple[bool,any]'
|
||||||
normalized_annotation == 'tuple[bool,any]' or
|
if not is_valid:
|
||||||
any(normalized_annotation == pattern for pattern in VALID_RETURN_TYPES)
|
is_valid = normalized_annotation in VALID_RETURN_TYPES
|
||||||
)
|
|
||||||
|
|
||||||
if not is_valid:
|
if not is_valid:
|
||||||
raise GuardrailValidationError(
|
raise GuardrailValidationError(
|
||||||
|
|||||||
Reference in New Issue
Block a user