kalliope icon indicating copy to clipboard operation
kalliope copied to clipboard

Multiple triggers

Open bacardi55 opened this issue 8 years ago • 13 comments

Hi, I played a bit more with Kalliope (created some custom brains and a couple of neurons) and was wondering if it would be possible to have multiple triggers that would load different brains ?

Why: I created a neurons to check my upcoming agenda events and have other neurons in mind like this to retrieve personal data. If I want my gf to be able to use the same capabilities, i would either have to:

  • Create a different order (eg with the name in it)
  • Have multiple triggers that open per trigger brains.
  • (Voice recognition … But that's another story :P)

I like the second option as it means having commons brains and per personne brains so the same order (eg: what are my next meetings) can bring the right calendar depending on the trigger (eg: I would trigger via "kalliope" and she would trigger by "jarviss"). It would be easier than adding in each "personal" order our name (eg: what are <Name> next meetings).

Other way of doing so is to launch different instances of kalliope with different loaded brains but I don't like this option (means also that you have 2 APIs etc).

thoughts?

bacardi55 avatar Nov 26 '16 19:11 bacardi55

Hi, that is not in our scope. The trigger is only used to wake up kalliope and then the brain will take un charge different orders. The philosophy is to change the input order from one synapse to another if you want different behavior.

Sispheor avatar Nov 26 '16 20:11 Sispheor

Hi @bacardi55 ,

Thanks for your review !

Yes we don't manage the multiple trigger to handle different brains. Actually, It is not in our scope in a short term. But you are right we need to investigate this in the futur ! I keep the issue as a reminder.

Also, don't hesitate to share your neurons with the community, we can reference them :)

LaMonF avatar Nov 26 '16 20:11 LaMonF

Hi @LaMonF My kalliope neurons are here: https://github.com/bacardi55/kalliope_config/tree/master/neurons

Not sure it's worth sharing though, as these are my first lines of python i'm not sure of the quality (and no tests coverage as well) but at least they do the job :)

Thanks for the awesome works btw :)

bacardi55 avatar Nov 26 '16 21:11 bacardi55

If you add a clean doc and unit tests you can PR us. We will take a look. I can see some hard coded stuff in French that need to be removed but the rest seems not bad at all. Maybe replacing the old http lib by "requests" can be a good enhancement too.

Sispheor avatar Nov 26 '16 21:11 Sispheor

Ok your can improve your neurons as @Sispheor suggests.

Then, you can follow the contributing doc for neuron to provide a complete doc and tests of your neurons.

Also, the idea is to provide each neuron in a different repo, so anyone from the community can easily clone it, and use it in their brain :)

When it is done, we will reference them in the neuron list directly to your repo.

LaMonF avatar Nov 26 '16 21:11 LaMonF

Hi, Thanks for the feedback! I've updated my repo with readme files for the 3 neurons and removed the hardcoded french text in the googlecalendar neuron :).

For the tests, I'll need more time as I need to learn how to write python unit test (as not all neurons have tests atm, I'll need to look deeper into this to understand how it works^^)

I'll move them to separate repos if you prefer.

bacardi55 avatar Nov 26 '16 23:11 bacardi55

About this issue, even a Rpi 3 seems laggy with only one instance of Snowboy. I can't imagine if we run multiple one.

Sispheor avatar Jan 24 '17 12:01 Sispheor

I've checked this a little on my Rpi3 - I didn't have the impression that snowboy is the reason for slowing down and as far as I understood one instance of Snowboy can handle more than one trigger word.

andweber avatar Mar 18 '17 09:03 andweber

Indeed snowboy can handle multiple models. It will be a big refactor to handle multiple brains for each user but not impossible technically.

Sispheor avatar Mar 18 '17 10:03 Sispheor

Hi Sispheor,

Seriously, only because my post was in French ? It's discrimination :o)

OK, I would make an effort next time.

ngoales avatar Aug 02 '17 07:08 ngoales

Sorry but yes. You are on Github. It's how it works. Developers come from around the world and they don't speak French. But you are free to talk in French in the Gitter chat.

Sispheor avatar Aug 02 '17 07:08 Sispheor

OK - A little intellectual laziness ...

So, I have coded the one user - one trigger management.

In my solution, it is not necessary to refactor the code, just add a few code lines and some classes in core.

I would be delighted to discuss with you on the subject

ngoales avatar Aug 02 '17 08:08 ngoales

You can submit a pull request if you want (in dev branch). But we have in mind the refactoring of the trigger part anyway to use Snowboy as python dependency. See #278

Sispheor avatar Aug 02 '17 08:08 Sispheor