burr
burr copied to clipboard
Hamilton action improvements for taking state in/out
Problems with Hamilton integration:
- [ ] We can't modify inputs from state
- [ ] We can't modify outputs to state
Idea:
h = Hamilton(
inputs={"most_recent_item": from_state("all_items", process=lambda x: x[-1]) # get the last one
outputs={"count": update_state("count", process=lambda count: count + 1)} # increments it
)
Also:
h = Hamilton(
inputs=...,
outputs=...,
extra_updates=lambda result, state: ...
)