-
Notifications
You must be signed in to change notification settings - Fork 17
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
create framework to allow for bot "dialogs" #149
Comments
so a couple of ideas i have around the functionality and the implementation (<< gulp) .. functionality :: wouldn't it be cool if i, a normal user, could create a "dialog" using commands ?? so this would be a runtime dialog vs code-base .. obviously the end result would have to be useful, and i think a multi-stepped collection of user input that is then sent off to some "external" API could be valuable .. the final "send" action might be code-based -- but the collection of that user input could be defined by users .. THE PROBLEM i see with this is would i, the user, be able to assemble a meaningful payload that i can then send off to the "external" API .. if i can't then all of this work might not be of value .. so just guessing at a user flow ::
ugh -- even typing that tho seems it might limit the usefulness of this tool .. i wonder if there was a well defined EDN or YAML schema, a user could show up with said schema and just post that to YB and YB would know what to do .. let's guess what that might look like in YAML :: dialog:
questions:
- text: what is your name?
var: name
- text: what is your age?
var: age
actions:
- command: http-post
args:
url: https://example.com/api/v1/update-user-info
# the dialog_payload in this example would/could look like {"name":"Greg","age": 45}
data: {{ dialog_payload }}
headers:
token: <secret> ^^ that makes me cringe a little because of my token reference, but typically you need some kind of auth to be able to post somewhere .. maybe that could be something that could be an "admin only" capability, and the YB user would have to ask said admin to set said secret in some var that can be referenced by these anyhoo -- onto implementation .. i was thinking of that nasty nested pseudo code example i posted before, and it made me cringe a little .. so i was thinking that any "dialog API" that would allow me to easily implement multi-methods i think would be great .. that way i could easily loop on said multi-method and my code remains nice and flat and easy to reason about .. (defmulti collect-user-info
...
(defmethod collect-user-info "name" [dialog-data]
...
(defmethod collect-user-info "age" [dialog-data]
...
(defmethod collect-user-info "update-user-info" [dialog-data]
...
(loop [dialog-data {:command "name"}]
(if (empty? (dialog-data :command))
dialog-data
(recur (collect-user-info dialog-data)))) ok -- i promise this is my last cup of ☕ -- will stop now .. |
EMAIL could be a final action for a user defined dialog ..
ok -- i promise now -- no more ☕ -- last comment of the day |
Thanks for kicking this off @gkspranger!
Would be awesome. I want to explore this direction. I'm wondering if we could utilize yb's pipeline capabilities to compose a dialog flow out of primitives.
Between every Now obviously this is linear without branching or logic. But I'm wondering if yb's pipelines should have generic logic capabilities (currently we do have an Your YAML/EDN idea is interesting. Kind of reminds me of StackStorm.
if posting via a configured command, e.g. to GitHub or JIRA, the auth would already be configured on the YB. But it does bring up a good question of how to do generic secrets in YB (have thought about this a bit before). I could see using a parameterized template that consumes configured secrets without exposing them.. kind of a separate topic though.
great idea if we end up wanting to bake dialogs in via code instead of configuring them at runtime. I want to push on runtime config a bit to see how far we could take it, or determine whether it's just too unwieldy.
YB does have a
🤣 😂 😆 ☕ Good stuff!! 💯 Hope you refill your ☕ stores for the next round 😂 |
i really like the idea of using pipelines .. i can see where i would create an THAT SAID -- it would be sweet if we can somehow create a this would be really neat if i could do this (simplistic, yes, but oh-so-powerful) ::
|
a hacky example at how we might add
|
as a YB dev,
i would like the ability to code multi-step dialogs,
so that my users can interact with YB in a "deeper" manner ..
right now, my user interactions with YB are very "shallow" -- meaning :: a command is issued (with or without args), YB does the thing, task complete .. this is great for 80% of the commands i create ..
that said, i would like for my users to have the ability to have "deeper", multi-step dialogs with YB, such that ::
-- a USER-response may invoke additional YB-questions
--
IF response =~ YES; THEN do X; ELSE do Y ENDIF;
STOP
the dialog-- that said, maybe it is possible to "save" a dialog that a YB user can restart ??
i don't expect this to be easy, and am willing to help however i can .. if i have any say on the impl details, it is that i have used both the HUBOT version of this (https://www.npmjs.com/package/hubot-conversation) and the ERRBOT version of this (https://github.com/errbotio/err-guess-a-number) -- and i much prefer the HUBOT approach ..
please forgive my pseudo code, but it would be great if the flow of the dialog could follow something like you see below .. ONE GLARING omission is being able to have nested questions based on responses .. for example ::
anyway -- just wanted to open this and get the ball rolling .. thanks !!
The text was updated successfully, but these errors were encountered: