mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-03 08:12:39 +00:00
fixing docs
This commit is contained in:
@@ -265,7 +265,9 @@ analysis_task = Task(
|
||||
|
||||
## Task Guardrails
|
||||
|
||||
Task guardrails provide a way to validate and transform task outputs before they are passed to the next task. This feature helps ensure data quality and provides feedback to agents when their output doesn't meet specific criteria.
|
||||
Task guardrails provide a way to validate and transform task outputs before they
|
||||
are passed to the next task. This feature helps ensure data quality and provides
|
||||
efeedback to agents when their output doesn't meet specific criteria.
|
||||
|
||||
### Using Task Guardrails
|
||||
|
||||
@@ -854,15 +856,6 @@ task = Task(
|
||||
)
|
||||
```
|
||||
|
||||
#### Async Guardrails
|
||||
```python Code
|
||||
async def validate_with_external_service(result: str) -> Tuple[bool, Union[str, str]]:
|
||||
"""Validate data using an external service."""
|
||||
# Example async validation
|
||||
validation_result = await external_service.validate(result)
|
||||
return (True, result) if validation_result.is_valid else (False, validation_result.error)
|
||||
```
|
||||
|
||||
## Creating Directories when Saving Files
|
||||
|
||||
You can now specify if a task should create directories when saving its output to a file. This is particularly useful for organizing outputs and ensuring that file paths are correctly structured.
|
||||
|
||||
Reference in New Issue
Block a user