💾 Archived View for gmi.bacardi55.io › blog › 2017 › 02 › 17 › kalliope-acting-as-a-reminder captured on 2024-06-16 at 13:06:02. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

Kalliope acting as a reminder

Posted on 2017-02-17

edit: updated on 02/17

Introduction

Yesterday, I wanted to add a feature to Kalliope (my always-on voice controlled personal assistant)[1] : the ability to reminds me of something later on. I have a very selective memory and forget to do a lot of stuff, so when I think about something important, I can gently ask Kalliope to reminds me to do it (:

1: https://github.com/kalliope-project/kalliope

The main use case

The primary use case (there are other things I'd like to do, see the last paragraph about the todolist) is:

Be able to ask Kalliope to reminds me of something in X minutes.

This translate into these actions:

I didn't / couldn't do a neuron, seeing the dependencies with languages and a need for an async script (kalliope needs to be able to answer commands in the meantime), a neuron was too complex.

My solution

I ended up creating:

The repeat neuron

The idea of this neuron is really simple: You send it arguments, and it will send them back as a return value to be used in template or say_template command.

2: http://www.linux-france.org/article/man-fr/man1/at-1.html

As you can see on the sample brain file[3], you can do things like "say hello to {{name}}" or what not :).

3: https://github.com/bacardi55/kalliope-repeat/blob/master/samples/brain.yml

To install the module, as usual:

    kalliope install --git-url https://github.com/bacardi55/kalliope-repeat.git

Then you can configure your brain as usual.

On synapse I created was this one:

      - name: "Repeat-via-api"
        signals:
          - order: "api-repeat-cmd {{ query }}"
        neurons:
          - repeat:
              args:
                - query
              say_template:
                - "{{ query }}"

The idea of this one is just to repeat what is in query when an order is sent that starts with "api-repeat-cmd". It's easy enough as I'm sure i will never pronounce a thing like this.

So basically, any API call that will POST an order starting like this will make Kalliope read the text sent.

For example,

    curl -i --user admin:secret -H "Content-Type: application/json" -X POST -d '{"order":"api-repeat-cmd Hello sir, how are you ?"}' http://kalliope:5000/order/

This command will make Kalliope say "Hello sir, how are you".

So now, I have a neuron than can say anytext needed via API.

So leveraging this neuron, my at command could easily send me the text I asked Kalliope to reminds me (eg: "leave for my appointment")

The python script

The script needs the "at" program to be installed to run

The script can be found here

If you look at the script, you will notice it is heavily dependent on the language (in my case French, sorry), so you can't just take it and use it, you'll have to update the text in it. I kept the code comments in English to help though

And with this, you can know ask Kalliope to remind you stuff (:

The remaining part to do

Keep track of the python script and the example brain file, these features will arrive :).

/gemlog/

Send me a gemini mention

send me an email!