fixing docs

This commit is contained in:
João Moura
2024-12-12 01:48:06 -03:00
parent a3944dabed
commit 06a3cf3002

View File

@@ -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.