feat: support to define a task guardrail using YAML config

This commit is contained in:
Lucas Gomide
2025-04-24 12:11:38 -03:00
parent e5d0cc8ac1
commit 50b603d3d2
8 changed files with 2350 additions and 4 deletions

View File

@@ -791,6 +791,29 @@ task = Task(
)
```
##### Using YAML
```yaml
research_task:
...
guardrail: make sure each bullet contains a minimum of 100 words
...
```
```python Code
@CrewBase
class InternalCrew:
agents_config = "config/agents.yaml"
tasks_config = "config/tasks.yaml"
...
@task
def research_task(self):
return Task(config=self.tasks_config["research_task"]) # type: ignore[index]
...
```
#### Use custom models for code generation
```python Code