mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 17:18:29 +00:00
refactor: replace if/raise with assert
For this use case `assert` is more appropriate choice
This commit is contained in:
@@ -488,8 +488,7 @@ class Task(BaseModel):
|
||||
raise e # Re-raise the exception after emitting the event
|
||||
|
||||
def _process_guardrail(self, task_output: TaskOutput) -> GuardrailResult:
|
||||
if self._guardrail is None:
|
||||
raise ValueError("Guardrail is not set")
|
||||
assert self._guardrail is not None
|
||||
|
||||
from crewai.utilities.events import (
|
||||
TaskGuardrailCompletedEvent,
|
||||
|
||||
Reference in New Issue
Block a user