Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tags for actions #468

Open
elijahbenizzy opened this issue Dec 11, 2024 · 1 comment
Open

Tags for actions #468

elijahbenizzy opened this issue Dec 11, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@elijahbenizzy
Copy link
Contributor

Is your feature request related to a problem? Please describe.
We should be able to tag actions. In particular, this could be used to do halt_after and halt_before.

Describe the solution you'd like

@action(reads=[...], writes=[...], tags=["requires_human_input"])
def act(state: State, human_input: ...) -> State:
    ...

app.run(halt_before=["requires_human_input"])

Would have to do this at the class-level as well, should be straightforward. Also there's the possibility of name-clashes on halt. I'm OK with that due to the simplicity here.

Could also do this at the action level -- in the builder with_actions(some_action=action.with_tags(["requires_human_input"]). Would have to think about how to do this with function-based actions (TBD).

Describe alternatives you've considered
See above

Additional context
Something I've been mulling over for a while.

@skrawcz
Copy link
Contributor

skrawcz commented Dec 11, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants