-
Notifications
You must be signed in to change notification settings - Fork 257
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
feat(core): add capability to define persistent functionality to a dialogue edge #310
Conversation
…x-default-behaviour
closing and reopening the PR to try to remove the expected Python3.8 check. |
fix: _func type declaration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind giving a bit more context / motivation on why this is needed? We are effectively registering multiple handlers for a dialogue edge here, which we decided not to support in message handlers for protocols. So with this there should be a particular reason why this needs to be supported in Dialogues and not in Protocols. And also, why limit to only 2 handlers for a given edge and not more?
Thanks for adding the context, that definitely helps a lot! I might still not be fully understanding it, but I have a small concern that we are conflating 2 separate concepts here that I think of as an "edge handler" and a "message handler". The edge handler is something that should happen every time the state transition occurs regardless of how the Dialogue is instantiated (what specific message is sent), and the message handler is something that should happen whenever a particular message activates the state transition. We have already added the ability to set a default message handler, which can be overwritten by an instance of the Dialogue, and it sounds like this PR is about adding the ability to add a default edge handler, which is not meant to be overwritten by an instance of the Dialogue. Is that a reasonable way to think about this? |
@jrriehl re: why only 2 handlers: |
Yes, this is where I ended up too, but it took a bit of time to both understand what is going on conceptually and to convince myself that this implementation did what was intended. That's why I think there might be some room for improvement in the implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, very clear now.
By setting the
persist
property toTrue
the defined default behaviour of an edge will not be overwritten when a developer uses the designated decorator.Example in dialogue definition file: