covidbot icon indicating copy to clipboard operation
covidbot copied to clipboard

Move core to a multi-platform Chatbot library

Open eknoes opened this issue 3 years ago • 10 comments

After #117, it would be easy to extract the core of that bot and create a Python Library for Multi-Platform Chatbots.

eknoes avatar Mar 12 '21 17:03 eknoes

Is there anything new here, @eknoes ?

Lukas2112 avatar Jul 02 '21 13:07 Lukas2112

Unfortunately not, sorry. I am currently quite busy.

eknoes avatar Jul 03 '21 08:07 eknoes

Okay. Is there any guidance on how to combine the programmed into a library? Because maybe I could have a look at it.

Lukas2112 avatar Jul 03 '21 10:07 Lukas2112

Not really, one has to make some architectural decisions. Currently, all the functionality is in main.py and the different platforms are in interfaces/. It would be nice to have a library with a common interface and decorators for the chatbot.

eknoes avatar Jul 03 '21 11:07 eknoes

https://medium.com/analytics-vidhya/how-to-create-a-python-library-7d5aea80cc3f

I found this post which seems to be quite helpful. What do you think, @eknoes ? This method seems to me (without having actively tested it) to be quite simple to transfer the programmed contents into a bibliohtek.

Lukas2112 avatar Jul 03 '21 16:07 Lukas2112

Yes, the question is not really how it could be put into a library, but how the library API should be designed.

eknoes avatar Jul 04 '21 19:07 eknoes

Yes, the question is not really how it could be put into a library, but how the library API should be designed.

Would much have to be changed structurally?

Lukas2112 avatar Jul 05 '21 16:07 Lukas2112

Yes! Honestly, I am not sure if you can help a lot regarding this issue, but of course you can give it a try. One must decide how to e.g. annotate a bot who would use this library: Obviously, the functions would return BotResponses (https://github.com/eknoes/covidbot/blob/main/covidbot/interfaces/bot_response.py) and some kind of general structure for all messenger messages. Furthermore, it should provide hooks, so that prior to receiving a general state might be saved. Basically the setup and this function must be extracted (https://github.com/eknoes/covidbot/blob/2d4f1e43124090a3c5d23aa623554b813835f504/covidbot/bot.py#L111). The setup should be replaced through decorators.

eknoes avatar Jul 05 '21 19:07 eknoes

Have cleanups or similar changes to the code base changed anything in the initial situation, @eknoes ?

Lukas2112 avatar Jul 13 '22 23:07 Lukas2112

No, there was no progress or heavy changes here. If you still want to help, you could come up with a suggestion for a general API and we can discuss it. I currently do even not have enough spare time to handle the core issues of the bot.

eknoes avatar Jul 17 '22 10:07 eknoes