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: doc/GRAMMAR.md
+22-25Lines changed: 22 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ The task should include the `filekey` in its list of `agents`:
57
57
```yaml
58
58
- task:
59
59
agents:
60
-
- personalities.assistant
60
+
- seclab_taskflow_agent.personalities.assistant
61
61
...
62
62
```
63
63
@@ -108,7 +108,7 @@ Example:
108
108
109
109
### Running templated tasks in a loop
110
110
111
-
Often we may want to iterate through the same tasks with different inputs. For example, we may want to do fetch all the functions from a code base and then analyze each of the function. This can be done using two consecutive task and with the help of the `repeat_prompt` field.
111
+
Often we may want to iterate through the same tasks with different inputs. For example, we may want to fetch all the functions from a code base and then analyze each of the functions. This can be done using two consecutive tasks and with the help of the `repeat_prompt` field.
112
112
113
113
```yaml
114
114
- task:
@@ -124,7 +124,7 @@ Often we may want to iterate through the same tasks with different inputs. For e
124
124
The function has name {{ RESULT_name }} and body {{ RESULT_body }} analyze the function.
125
125
```
126
126
127
-
In the above, the first task fetches functions in the code base and create a json list object, with each entry having a `name` and `body` field. In the next task, `repeat_prompt` is set to true, meaning that a task is created for each individual object in the list and the object fields are referenced in the templated prompt using `{{ RESULT_<fieldname> }}`. In other words, `{{ RESULT_name }}` in the prompt is replaced with the value of the `name` field of the object etc. For example, if the list of functions fetched from the first task is:
127
+
In the above, the first task fetches functions in the code base and creates a json list object, with each entry having a `name` and `body` field. In the next task, `repeat_prompt` is set to true, meaning that a task is created for each individual object in the list and the object fields are referenced in the templated prompt using `{{ RESULT_<fieldname> }}`. In other words, `{{ RESULT_name }}` in the prompt is replaced with the value of the `name` field of the object etc. For example, if the list of functions fetched from the first task is:
128
128
129
129
```javascript
130
130
[{'name' : foo, 'body' : foo(){return 1;}}, {'name' : bar, 'body' : bar(a) {return a + 1;}}]
@@ -189,7 +189,7 @@ An optional limit can be set to limit the number of asynchronous tasks via `asyn
189
189
The function has name {{ RESULT_name }} and body {{ RESULT_body }} analyze the function.
190
190
```
191
191
192
-
Both `async` and `async_limit` have no effect when use outside of a `repeat_prompt`.
192
+
Both `async` and `async_limit` have no effect when used outside of a `repeat_prompt`.
193
193
194
194
At the moment, we do not support nested `repeat_prompt`. So the following is not allowed:
195
195
@@ -207,7 +207,7 @@ At the moment, we do not support nested `repeat_prompt`. So the following is not
207
207
208
208
#### Shell Tasks
209
209
210
-
Tasks can be entirely shell based through the run directive. This simply runs a shell command and pass the result directly to the next task. It is used for creating iterable results for `repeat_prompt`.
210
+
Tasks can be entirely shell based through the run directive. This simply runs a shell command and pass the result directly to the next task. It can be used for creating iterable results for `repeat_prompt`.
211
211
212
212
For example:
213
213
@@ -255,15 +255,15 @@ Toolboxes are MCP server configurations. They can be defined at the Agent level
255
255
- task:
256
256
...
257
257
toolboxes:
258
-
- toolboxes.codeql
258
+
- seclab_taskflow_agent.toolboxes.codeql
259
259
```
260
260
261
261
If no `toolboxes` is specified, then the `toolboxes` defined in the `personality` of the `agent` is used:
262
262
263
263
```yaml
264
264
- task:
265
265
agents:
266
-
- personalities.c_auditer
266
+
- seclab_taskflow_agent.personalities.c_auditer
267
267
user_prompt: |
268
268
List all the files in the codeql database `some/codeql/db`.
269
269
- task:
@@ -276,15 +276,15 @@ Note that when `toolboxes` is defined for a task, it *overwrites* the `toolboxes
276
276
```yaml
277
277
- task:
278
278
agents:
279
-
- personalities.c_auditer
279
+
- seclab_taskflow_agent.personalities.c_auditer
280
280
user_prompt: |
281
281
List all the files in the codeql database `some/codeql/db`.
282
282
toolboxes:
283
-
- toolboxes.echo
283
+
- seclab_taskflow_agent.toolboxes.echo
284
284
285
285
```
286
286
287
-
For this task, the `agent``personalities.c_auditer` will have access to the `toolboxes.echo` tool.
287
+
For this task, the `agent``seclab_taskflow_agent.personalities.c_auditer` will have access to the `seclab_taskflow_agent.toolboxes.echo` tool.
288
288
289
289
### Headless Runs
290
290
@@ -380,11 +380,9 @@ Then the `task` that uses it effectively becomes:
380
380
- some_toolboxes
381
381
```
382
382
383
-
which all settings inherited from `single_step_taskflow` while `model` is overwritten.
384
-
385
383
Any `taskflow` that contains only a single step can be used as a reusable taskflow.
386
384
387
-
A reusable taskflow can also have templated prompt that takes inputs from its user. This is specified with the `inputs` field from the user.
385
+
A reusable taskflow can also have a templated prompt that takes inputs from its user. This is specified with the `inputs` field from the user.
388
386
389
387
```yaml
390
388
- task:
@@ -413,7 +411,7 @@ In this case, the template parameter `{{ INPUTS_fruit }}` is replaced by the val
413
411
414
412
### Reusable Prompts
415
413
416
-
Reusable prompts are defined in files of `filetype` `prompts`. These are like macros that gets replaced when a templated parameter of the form `{{ PROMPTS_<filekey> }}` is encountered.
414
+
Reusable prompts are defined in files of `filetype` `prompts`. These are like macros that get replaced when a templated parameter of the form `{{ PROMPTS_<filekey> }}` is encountered.
417
415
418
416
Tasks can incorporate templated prompts which are then replaced by the actual prompt. For example:
419
417
@@ -422,13 +420,13 @@ Example:
422
420
```yaml
423
421
- task:
424
422
agents:
425
-
- fruit_expert
423
+
- examples.personalities.fruit_expert
426
424
user_prompt: |
427
425
Tell me more about apples.
428
-
429
-
{{ PROMPTS_prompts.examples.example_prompt }}
426
+
427
+
{{ PROMPTS_examples.prompts.example_prompt }}
430
428
```
431
-
and `prompts.examples.example_prompt` is the following:
429
+
and `examples.prompts.example_prompt` is the following:
432
430
433
431
```yaml
434
432
seclab-taskflow-agent:
@@ -444,7 +442,7 @@ Then the actual task becomes:
444
442
```yaml
445
443
- task:
446
444
agents:
447
-
- fruit_expert
445
+
- examples.personalities.fruit_expert
448
446
user_prompt: |
449
447
Tell me more about apples.
450
448
@@ -453,15 +451,14 @@ Then the actual task becomes:
453
451
454
452
### Model config
455
453
456
-
LLM models can be configured in a taskflow by setting the `model_config` field to the `filekey` of a file of `filetype` `model_config`:
454
+
LLM models can be configured in a taskflow by setting the `model_config` field to the `filekey` of a file of `filetype` `model_config`:
457
455
458
456
```yaml
459
457
seclab-taskflow-agent:
460
458
version: 1
461
459
filetype: taskflow
462
460
463
-
model_config: configs.model_config
464
-
461
+
model_config: examples.model_configs.model_config
465
462
```
466
463
467
464
The variables defined in the `model_config` file can then be used throughout the taskflow, e.g.
@@ -471,7 +468,7 @@ seclab-taskflow-agent:
471
468
version: 1
472
469
filetype: model_config
473
470
models:
474
-
gpt_latest: gpt-5
471
+
gpt_latest: gpt-5
475
472
```
476
473
477
474
When `gpt_latest` is used in the taskflow to specify a model, the value `gpt-5` is used:
@@ -481,9 +478,9 @@ When `gpt_latest` is used in the taskflow to specify a model, the value `gpt-5`
481
478
model: gpt_latest
482
479
must_complete: false
483
480
agents:
484
-
- personalities.c_auditer
481
+
- seclab_taskflow_agent.personalities.c_auditer
485
482
user_prompt: |
486
483
487
484
```
488
485
489
-
This provides a easy way to update model versions in a taskflow.
486
+
This provides a easy way to update model versions in a taskflow.
0 commit comments