CLI based interface through simple dict configuration #93
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#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:
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
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.