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

CLI based interface through simple dict configuration #93

Closed
wants to merge 5 commits into from

Conversation

IvanBrasilico
Copy link

@IvanBrasilico IvanBrasilico commented Oct 15, 2017

#76
A collection of classes and Patterns that allow to use bottery to do a "rule based" user interface in the command line way, mapping "commands"(sequence of words) to "actions" (http urls for JSON APIs) and parsing parameters also. All with basic unit tests, and an example of implementation on the '/patterns.py' file.

Reads the configuration from a simple dict and makes all the context and flow management.

It is a initial idea, but I have already easily implemented access to a Telegram bot to 3 diferent JSON APIs with it.

Although fancy chatbots do "Natural Language Processing", to do real actions, in the end of the NLP flow we will always have a Softmax classificator that will map "I wanna shop", "I want stuf", "Browse your clothes", and whatever to "catalog list", for example. So im most chatbots the "NLP layer" probably will be on top of a "rule based" layer. I think this could be very useful if improved a litle. In fact, for me, it is already useful.

Needed litle changes on plataform/ that havent breaked back compatibility.

Improvements needed:

  1. An async http request. (Since asyncio needs a chain of async method calls, this improvement needs to be made in the core) Problem already reported in Async handlers #77

  2. The view probably would be better as an object than a function, with an interface defined so the developer can personalize the parsing of the response (like doing json_to_md or some manual parsing), overriding a "parse_response" method.

Patterns and views to do "rule" based chat
User can simply define two dicts, one with the routings of commands until a url, other with the parameters of the url, if needed.
@rougeth
Copy link
Owner

rougeth commented Oct 16, 2017

Hi @IvanBrasilico, thanks for the pull request. I would like to ask you to break it in small PRs. In this one, you're suggesting not only new patterns but also changes in the internal behavior of bottery itself. The smallest PR, the better.

Also, I believe you have commited your bot together width the changes you proposed.

Again, thank you very much!

@rougeth
Copy link
Owner

rougeth commented Oct 18, 2017

I'm closing this since you're breaking this PR in smaller ones.

@rougeth rougeth closed this Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants