You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: taskflows/GRAMMAR.md
+84-82Lines changed: 84 additions & 82 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,12 +20,14 @@ Example:
20
20
21
21
```yaml
22
22
- task:
23
-
agents:
24
-
- assistant
25
-
user_prompt: |
26
-
This is a user prompt.
23
+
agents:
24
+
- assistant
25
+
user_prompt: |
26
+
This is a user prompt.
27
27
```
28
28
29
+
Note: The exception to this rule are `run` shell tasks.
30
+
29
31
### Agents
30
32
31
33
Agents are defined through their own YAML grammar as so called personalities.
@@ -52,13 +54,13 @@ Example:
52
54
53
55
```yaml
54
56
- task:
55
-
agents:
56
-
- primary_agent
57
-
- handoff_agent1
58
-
- ...
59
-
- handoff_agentN
60
-
user_prompt: |
61
-
...
57
+
agents:
58
+
- primary_agent
59
+
- handoff_agent1
60
+
- ...
61
+
- handoff_agentN
62
+
user_prompt: |
63
+
...
62
64
```
63
65
64
66
### Model
@@ -67,11 +69,11 @@ Tasks can optionally specify which Model to use on the configured inference endp
67
69
68
70
```yaml
69
71
- task:
70
-
model: gpt-4.1
71
-
agents:
72
-
- assistant
73
-
user_prompt: |
74
-
This is a user prompt.
72
+
model: gpt-4.1
73
+
agents:
74
+
- assistant
75
+
user_prompt: |
76
+
This is a user prompt.
75
77
```
76
78
77
79
Note that model identifiers may differ between OpenAI compatible endpoint providers, make sure you change your model identifier accordingly when switching providers.
@@ -84,11 +86,11 @@ Example:
84
86
85
87
```yaml
86
88
- task:
87
-
must_complete: true
88
-
agents:
89
-
- assistant
90
-
user_prompt: |
91
-
...
89
+
must_complete: true
90
+
agents:
91
+
- assistant
92
+
user_prompt: |
93
+
...
92
94
```
93
95
94
96
### Repeated Prompts
@@ -103,12 +105,12 @@ Example:
103
105
...
104
106
# this task can iterate across the iterable
105
107
- task:
106
-
agents:
107
-
- assistant
108
-
repeat_prompt: true
109
-
user_prompt: |
110
-
This is a templated prompt. It can iterate the results in a list via {{ RESULT }},
111
-
if the result is a dict you access its keys via {{ RESULT_key }}.
108
+
agents:
109
+
- assistant
110
+
repeat_prompt: true
111
+
user_prompt: |
112
+
This is a templated prompt. It can iterate the results in a list via {{ RESULT }},
113
+
if the result is a dict you access its keys via {{ RESULT_key }}.
112
114
```
113
115
114
116
### Context Exclusion
@@ -119,13 +121,13 @@ Example:
119
121
120
122
```yaml
121
123
- task:
122
-
exclude_from_context: true
123
-
agents:
124
-
- assistant
125
-
user_prompt: |
126
-
List all the files in the codeql database `some/codeql/db`.
127
-
toolboxes:
128
-
- codeql
124
+
exclude_from_context: true
125
+
agents:
126
+
- assistant
127
+
user_prompt: |
128
+
List all the files in the codeql database `some/codeql/db`.
129
+
toolboxes:
130
+
- codeql
129
131
```
130
132
131
133
### Toolboxes / MCP Servers
@@ -140,13 +142,13 @@ Example:
140
142
141
143
```yaml
142
144
- task:
143
-
headless: true
144
-
agents:
145
-
- assistant
146
-
user_prompt: |
147
-
Clear the memory cache.
148
-
toolboxes:
149
-
- memcache
145
+
headless: true
146
+
agents:
147
+
- assistant
148
+
user_prompt: |
149
+
Clear the memory cache.
150
+
toolboxes:
151
+
- memcache
150
152
```
151
153
152
154
### Environment Variables
@@ -157,16 +159,16 @@ Example:
157
159
158
160
```yaml
159
161
- task:
160
-
headless: true
161
-
agents:
162
-
- assistant
163
-
user_prompt: |
164
-
Store `hello` in the memory key `world`.
165
-
toolboxes:
166
-
- memcache
167
-
env:
168
-
MEMCACHE_STATE_DIR: "example_taskflow/"
169
-
MEMCACHE_BACKEND: "dictionary_file"
162
+
headless: true
163
+
agents:
164
+
- assistant
165
+
user_prompt: |
166
+
Store `hello` in the memory key `world`.
167
+
toolboxes:
168
+
- memcache
169
+
env:
170
+
MEMCACHE_STATE_DIR: "example_taskflow/"
171
+
MEMCACHE_BACKEND: "dictionary_file"
170
172
```
171
173
172
174
### Shell Tasks
@@ -177,15 +179,15 @@ Example:
177
179
178
180
```yaml
179
181
- task:
180
-
must_complete: true
181
-
run: |
182
-
echo '["apple", "banana", "orange"]'
182
+
must_complete: true
183
+
run: |
184
+
echo '["apple", "banana", "orange"]'
183
185
- task:
184
-
repeat_prompt: true
185
-
agents:
186
-
- assistant
187
-
user_prompt: |
188
-
What kind of fruit is {{ RESULT }}?
186
+
repeat_prompt: true
187
+
agents:
188
+
- assistant
189
+
user_prompt: |
190
+
What kind of fruit is {{ RESULT }}?
189
191
```
190
192
191
193
Use shell tasks when you want to iterate on results that don't need to be generated via a prompt inferred tool call.
0 commit comments