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
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -340,6 +340,20 @@ taskflow:
340
340
Tell me more about {{ GLOBALS_fruit }}.
341
341
```
342
342
343
+
Global variables can also be set or overridden from the command line using the `-g` or `--global` flag:
344
+
345
+
```sh
346
+
hatch run main -t examples.taskflows.example_globals -g fruit=apples
347
+
```
348
+
349
+
Multiple global variables can be set by repeating the flag:
350
+
351
+
```sh
352
+
hatch run main -t examples.taskflows.example_globals -g fruit=apples -g color=red
353
+
```
354
+
355
+
Command line globals override any globals defined in the taskflow YAML file, allowing you to reuse taskflows with different parameter values without editing the files.
356
+
343
357
### Reusable Tasks
344
358
345
359
Tasks can reuse single step taskflows and optionally override any of its configurations. This is done by setting a `uses` field with a link to the single step taskflow YAML file as its value.
group.add_argument("-p", help="The personality to use (mutex with -t)", required=False)
68
68
group.add_argument("-t", help="The taskflow to use (mutex with -p)", required=False)
69
69
group.add_argument("-l", help="List available tool call models and exit", action='store_true', required=False)
70
+
parser.add_argument("-g", "--global", dest="globals", action='append', help="Set global variable (KEY=VALUE). Can be used multiple times.", required=False)
0 commit comments