leon-ai / leon

🧠 Leon is your open-source personal assistant.
https://getleon.ai
MIT License
15.3k stars 1.26k forks source link

Introducing widgets #336

Open louistiti opened 2 years ago

louistiti commented 2 years ago

Feature Use Case

When a module supports widgets, it can return a beautiful output based on some templates made by the module creator.

Feature Proposal

As humans, we like visual things. The idea of widgets is to return answers with some styles. Let's imagine a Weather module, if the answer is about rain, we could display the name of the city and cloud with rain, etc. If we ask Leon to flip a coin or roll a dice, then we could add a coin or dice with an animation that will flip or roll according to the module that has been executed.

Also, some widgets should be interactive, which means we should be able to input some data in it via text input, radio, checkbox, etc.

To stay consistent, I may create components <Input>, <Toggle>, <Button>, etc. with a unified style. Then handlers will need to be added to understand inputs from the widgets. Those may be to communicate with the core of Leon directly, with an external API, or with the module itself. This part is still a bit blurry at the moment.

A widget could be embed inside the interface at the same level as the answers, but it could also be a full overlay of the whole app. So a type should be defined somewhere.

The how to do this still need to be determined. But that's the fun part right? :smile:

louistiti commented 2 years ago

✨ [1.0.0-beta.6] Introducing widgets

louistiti commented 10 months ago

✨ [1.0.0-beta.10] Introducing Widgets

louistiti commented 10 months ago

✨ [1.0.0-beta.10] Introducing Widgets

louistiti commented 10 months ago

✨ [1.0.0-beta.10] Introducing Widgets

louistiti commented 10 months ago

✨ [1.0.0-beta.10] Introducing Widgets

louistiti commented 10 months ago

✨ [1.0.0-beta.10] Introducing Widgets