add a config to reducer, to enable custom ish reducers

This commit is contained in:
lda
2026-05-17 17:11:19 +07:00 Verified
parent 32bcba9b35
commit 9d45c59fdc
14 changed files with 238 additions and 38 deletions
+11 -2
View File
@@ -197,8 +197,17 @@ Reducers are a capability family, similar to reusable node specs:
- inspectable
- dependency-trackable
State fields reference reducers declaratively. Workflow artifacts do not embed
arbitrary Python callables.
State fields reference reducers declaratively. String reducer names are accepted
as shorthand for unconfigured reducers; configured reducers use a `name` plus
JSON-compatible `config`. Workflow artifacts do not embed arbitrary Python
callables.
```python
StateField(
type="integer",
reducer={"name": "wf.std.modulo_add", "config": {"modulus": 10}},
)
```
Reducers should be pure: