Skip to content

Commit df8159a

Browse files
author
Bas Alberts
committed
Fix indentations on Taskflow grammar docs.
1 parent 12ff411 commit df8159a

File tree

1 file changed

+84
-82
lines changed

1 file changed

+84
-82
lines changed

taskflows/GRAMMAR.md

Lines changed: 84 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ Example:
2020
2121
```yaml
2222
- 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.
2727
```
2828
29+
Note: The exception to this rule are `run` shell tasks.
30+
2931
### Agents
3032

3133
Agents are defined through their own YAML grammar as so called personalities.
@@ -52,13 +54,13 @@ Example:
5254

5355
```yaml
5456
- 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+
...
6264
```
6365

6466
### Model
@@ -67,11 +69,11 @@ Tasks can optionally specify which Model to use on the configured inference endp
6769

6870
```yaml
6971
- 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.
7577
```
7678

7779
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:
8486

8587
```yaml
8688
- 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+
...
9294
```
9395

9496
### Repeated Prompts
@@ -103,12 +105,12 @@ Example:
103105
...
104106
# this task can iterate across the iterable
105107
- 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 }}.
112114
```
113115

114116
### Context Exclusion
@@ -119,13 +121,13 @@ Example:
119121

120122
```yaml
121123
- 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
129131
```
130132
131133
### Toolboxes / MCP Servers
@@ -140,13 +142,13 @@ Example:
140142
141143
```yaml
142144
- 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
150152
```
151153
152154
### Environment Variables
@@ -157,16 +159,16 @@ Example:
157159
158160
```yaml
159161
- 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"
170172
```
171173
172174
### Shell Tasks
@@ -177,15 +179,15 @@ Example:
177179
178180
```yaml
179181
- task:
180-
must_complete: true
181-
run: |
182-
echo '["apple", "banana", "orange"]'
182+
must_complete: true
183+
run: |
184+
echo '["apple", "banana", "orange"]'
183185
- 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 }}?
189191
```
190192
191193
Use shell tasks when you want to iterate on results that don't need to be generated via a prompt inferred tool call.
@@ -198,17 +200,17 @@ Example:
198200
199201
```yaml
200202
- task:
201-
must_complete: true
202-
run: |
203-
echo '["apple", "banana", "orange"]'
203+
must_complete: true
204+
run: |
205+
echo '["apple", "banana", "orange"]'
204206
- task:
205-
repeat_prompt: true
206-
async: true
207-
async_limit: 3
208-
agents:
209-
- assistant
210-
user_prompt: |
211-
What kind of fruit is {{ RESULT }}?
207+
repeat_prompt: true
208+
async: true
209+
async_limit: 3
210+
agents:
211+
- assistant
212+
user_prompt: |
213+
What kind of fruit is {{ RESULT }}?
212214
```
213215
214216
### Globals
@@ -236,12 +238,12 @@ Example:
236238
237239
```yaml
238240
- task:
239-
agents:
240-
- fruit_expert
241-
inputs:
242-
fruit: apples
243-
user_prompt: |
244-
Tell me more about {{ INPUTS_fruit }}.
241+
agents:
242+
- fruit_expert
243+
inputs:
244+
fruit: apples
245+
user_prompt: |
246+
Tell me more about {{ INPUTS_fruit }}.
245247
```
246248
247249
### Reusable Prompts
@@ -252,12 +254,12 @@ Example:
252254
253255
```yaml
254256
- task:
255-
agents:
256-
- fruit_expert
257-
user_prompt: |
258-
Tell me more about apples.
257+
agents:
258+
- fruit_expert
259+
user_prompt: |
260+
Tell me more about apples.
259261
260-
{{ PROMPTS_examples/example_prompt }}
262+
{{ PROMPTS_examples/example_prompt }}
261263
```
262264
263265
### Reusable Tasks
@@ -268,6 +270,6 @@ Example:
268270
269271
```yaml
270272
- task:
271-
uses: single_step_taskflow
272-
model: gpt-4o
273+
uses: single_step_taskflow
274+
model: gpt-4o
273275
```

0 commit comments

Comments
 (0)