mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 16:48:30 +00:00
feat: renaming GuardrailTask to TaskGuardrail
This commit is contained in:
@@ -322,9 +322,9 @@ blog_task = Task(
|
||||
- On success: it returns a tuple of `(bool, Any)`. For example: `(True, validated_result)`
|
||||
- On Failure: it returns a tuple of `(bool, str)`. For example: `(False, "Error message explain the failure")`
|
||||
|
||||
### GuardrailTask
|
||||
### TaskGuardrail
|
||||
|
||||
The `GuardrailTask` class provides a sophisticated way to generate and execute validation code for task outputs. Here's how it works:
|
||||
The `TaskGuardrail` class provides a sophisticated way to generate and execute validation code for task outputs. Here's how it works:
|
||||
|
||||
#### Code Execution
|
||||
|
||||
@@ -800,7 +800,7 @@ from crewai.llm import LLM
|
||||
task = Task(
|
||||
description="Generate JSON data",
|
||||
expected_output="Valid JSON object",
|
||||
guardrail=GuardrailTask(
|
||||
guardrail=TaskGuardrail(
|
||||
description="Ensure the response is a valid JSON object",
|
||||
llm=LLM(model="gpt-4o-mini"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user