mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-04 16:52:37 +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
|
raise e # Re-raise the exception after emitting the event
|
||||||
|
|
||||||
def _process_guardrail(self, task_output: TaskOutput) -> GuardrailResult:
|
def _process_guardrail(self, task_output: TaskOutput) -> GuardrailResult:
|
||||||
if self._guardrail is None:
|
assert self._guardrail is not None
|
||||||
raise ValueError("Guardrail is not set")
|
|
||||||
|
|
||||||
from crewai.utilities.events import (
|
from crewai.utilities.events import (
|
||||||
TaskGuardrailCompletedEvent,
|
TaskGuardrailCompletedEvent,
|
||||||
|
|||||||
Reference in New Issue
Block a user