Coder Social home page Coder Social logo

kalliope-project / kalliope Goto Github PK

View Code? Open in Web Editor NEW
1.7K 81.0 230.0 21.39 MB

Kalliope is a framework that will help you to create your own personal assistant.

Home Page: https://kalliope-project.github.io/

License: GNU General Public License v3.0

Python 97.31% Shell 1.23% Dockerfile 1.28% Jinja 0.19%
raspberry bot-creation jarvis personal-assistant linux speech-to-text speech-recognition speech-synthesis bot home-automation

kalliope's Introduction

Kalliope

Build Status Coverage Status Gitter PyPI version PyPI Beerpay

Kalliope is a framework that will help you to create your own personal assistant.

The concept is to create the brain of your assistant by attaching an input signal (vocal order, scheduled event, MQTT message, GPIO event, etc..) to one or multiple actions called neurons.

You can create your own Kalliope bot, by simply choosing and composing the existing neurons without writing any code. But, if you need a particular module, you can write it by yourself, add it to your project and propose it to the community.

Kalliope can run on all Linux Debian based distribution including a Raspberry Pi and it's multi-lang. The only thing you need is a microphone.

Kalliope is easy-peasy to use, see the hello world

  - name: "Hello-world"
    signals:
      - order: "say hello"
    neurons:
      - say:
          message: "Hello world!"

If you want an idea of what you can do with Kalliope, click on the image below ENGLISH DEMO

Links

Credits

Meaning of Kalliope Kalliope means "beautiful voice" from Greek καλλος (kallos) "beauty" and οψ (ops) "voice". In Greek mythology she was a goddess of epic poetry and eloquence, one of the nine Muses.

  • kə-LIE-ə-pee (English)
  • Ka-li-o-pé (French)
  • каллиопа (Russian)

License

Copyright (c) 2018. All rights reserved.

Kalliope is covered by the GNU GENERAL PUBLIC LICENSE v3.0. Permissions of this strong copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. For the full license text see the LICENSE.md file.

kalliope's People

Contributors

aleneum avatar alexena avatar andweber avatar bacardi55 avatar corus87 avatar daniego avatar dvelascoa avatar foxkyong avatar fpytloun avatar joshuaboniface avatar jpeters avatar jschueller avatar juergenpabel avatar lamonf avatar lapin-blanc avatar pjz avatar plfort avatar royto avatar sblondon avatar sispheor avatar thomasdevilliers avatar thomaspierson avatar ultchad avatar unkier avatar williamdclt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kalliope's Issues

Kalliopé bug after one use

Hello,
When I use the hotword Kalliopé the first time, it's working, but then if I try to use it again it fail.

I launch Kalliopé in debug mode and we can see an error related to threads.

I'm on Debian 8, with Python 2.7.9 and I install Kalliopé with pip.

Log :
gui@laptop:~/kalliope_starter_fr$ kalliope --debug start
2017-01-03 23:47:57,020 :: DEBUG :: Logger ready
2017-01-03 23:47:57,020 :: DEBUG :: kalliope args: Namespace(action='start', brain_file=None, debug=True, git_url=None, run_synapse=None)
2017-01-03 23:47:57,020 :: DEBUG :: Try to load file from 1: /home/gui/kalliope_starter_fr/brain.yml
2017-01-03 23:47:57,020 :: DEBUG :: File found in /home/gui/kalliope_starter_fr/brain.yml
2017-01-03 23:47:57,021 :: DEBUG :: File path to load: /home/gui/kalliope_starter_fr/brain.yml
2017-01-03 23:47:57,035 :: DEBUG :: File path to load: /home/gui/kalliope_starter_fr/brain.yml
2017-01-03 23:47:57,050 :: DEBUG :: Try to load file from 1: /home/gui/kalliope_starter_fr/settings.yml
2017-01-03 23:47:57,050 :: DEBUG :: File found in /home/gui/kalliope_starter_fr/settings.yml
2017-01-03 23:47:57,051 :: DEBUG :: File path to load: /home/gui/kalliope_starter_fr/settings.yml
2017-01-03 23:47:57,065 :: DEBUG :: File path to load: /home/gui/kalliope_starter_fr/settings.yml
2017-01-03 23:47:57,078 :: DEBUG :: Default STT: google
2017-01-03 23:47:57,078 :: DEBUG :: Default TTS: pico2wave
2017-01-03 23:47:57,078 :: DEBUG :: Default Trigger name: snowboy
2017-01-03 23:47:57,079 :: DEBUG :: Default synapse: default-synapse
2017-01-03 23:47:57,079 :: DEBUG :: Resource directory synapse: {'stt': 'resources/stt', 'tts': 'resources/tts', 'neuron': 'resources/neurons'}
Starting event manager
Events loaded
Starting Kalliope
Press Ctrl+C for stopping
Starting REST API Listening port: 5000
2017-01-03 23:47:57,137 :: DEBUG :: TriggerLauncher: Start trigger snowboy with parameters: {'callback': <bound method MainController.callback of <kalliope.core.MainController.MainController instance at 0x7f9e342f6ea8>>, 'pmdl_file': 'trigger/kalliope-FR.pmdl'}
2017-01-03 23:47:57,137 :: DEBUG :: Run plugin snowboy with parameter {'callback': <bound method MainController.callback of <kalliope.core.MainController.MainController instance at 0x7f9e342f6ea8>>, 'pmdl_file': 'trigger/kalliope-FR.pmdl'}
2017-01-03 23:47:57,144 :: DEBUG :: Try to load file from 1: /home/gui/kalliope_starter_fr/trigger/kalliope-FR.pmdl
2017-01-03 23:47:57,145 :: DEBUG :: File found in /home/gui/kalliope_starter_fr/trigger/kalliope-FR.pmdl
2017-01-03 23:47:57,209 :: DEBUG :: detecting...
2017-01-03 23:47:59,994 :: INFO :: Keyword 1 detected at time: 2017-01-03 23:47:59
2017-01-03 23:47:59,995 :: DEBUG :: Pausing snowboy process
2017-01-03 23:47:59,995 :: DEBUG :: Run plugin Google with parameter {'callback': <bound method MainController.analyse_order of <kalliope.core.MainController.MainController instance at 0x7f9e342f6ea8>>, 'language': 'fr-FR'}
2017-01-03 23:48:00,010 :: DEBUG :: NeuronModule called from class Say with parameters: {'message': ['Oui monsieur?', u'Je vous \xe9coute', 'Monsieur?', 'Que puis-je faire pour vous?', u"J'\xe9coute", 'Oui?']}
2017-01-03 23:48:00,011 :: DEBUG :: NeuronModule Say() called with message: ['Oui monsieur?', u'Je vous \xe9coute', 'Monsieur?', 'Que puis-je faire pour vous?', u"J'\xe9coute", 'Oui?']
2017-01-03 23:48:00,011 :: DEBUG :: message is list
2017-01-03 23:48:00,011 :: DEBUG :: tts_message to say: Que puis-je faire pour vous?
2017-01-03 23:48:00,012 :: DEBUG :: NeuroneModule: TTS args: Tts name: pico2wave, parameters: {'cache': True, 'language': 'fr-FR'}
2017-01-03 23:48:00,021 :: DEBUG :: Run plugin pico2wave with parameter {'cache': True, 'language': 'fr-FR'}
2017-01-03 23:48:00,023 :: DEBUG :: Class TTSModule called from module Pico2wave, cache: True, language: fr-FR, voice: default
2017-01-03 23:48:00,023 :: DEBUG :: get_path_to_store_audio return: /tmp/kalliope_tts_cache/Pico2wave/fr-FR/default/318d2af18343ed4d104e3259fa7ea866.tts
2017-01-03 23:48:00,024 :: DEBUG :: TTSModule, File already in cache: /tmp/kalliope_tts_cache/Pico2wave/fr-FR/default/318d2af18343ed4d104e3259fa7ea866.tts
2017-01-03 23:48:00,024 :: DEBUG :: Mplayer cmd: ['/usr/bin/mplayer', '-slave', '-quiet', '/tmp/kalliope_tts_cache/Pico2wave/fr-FR/default/318d2af18343ed4d104e3259fa7ea866.tts']
Say something!
Google Speech Recognition thinks you said quelle heure est-il
2017-01-03 23:48:07,062 :: DEBUG :: OrderAnalyser, Received order: quelle heure est-il
2017-01-03 23:48:07,067 :: DEBUG :: [orderAnalyser.start]-> No Synapse provided, let's find one
2017-01-03 23:48:07,086 :: DEBUG :: Order found! Run neurons: [<kalliope.core.Models.Neuron.Neuron object at 0x7f9e34366990>]
Order matched in the brain. Running synapse "say-local-date"
2017-01-03 23:48:07,098 :: DEBUG :: [orderAnalyser.start]-> Grab the params
2017-01-03 23:48:07,126 :: DEBUG :: Run plugin "systemdate" with parameters {'say_template': ['il est {{ hours }} heure et {{ minutes }} minute']}
2017-01-03 23:48:07,174 :: DEBUG :: Run plugin systemdate with parameter {'say_template': ['il est {{ hours }} heure et {{ minutes }} minute']}
2017-01-03 23:48:07,261 :: DEBUG :: NeuronModule called from class Systemdate with parameters: {'cache': False, 'say_template': ['il est {{ hours }} heure et {{ minutes }} minute']}
2017-01-03 23:48:07,266 :: DEBUG :: NeuronModule Say() called with message: {'day_month': '03', 'month': '01', 'hours': '23', 'weekday': '2', 'year': '2017', 'minutes': '48'}
2017-01-03 23:48:07,318 :: DEBUG :: message is dict
2017-01-03 23:48:07,334 :: DEBUG :: tts_message to say: il est 23 heure et 48 minute
2017-01-03 23:48:07,417 :: DEBUG :: args for TTS plugin before update: {'cache': True, 'language': 'fr-FR'}
2017-01-03 23:48:07,418 :: DEBUG :: args for TTS plugin after update: {'cache': False, 'language': 'fr-FR'}
2017-01-03 23:48:07,550 :: DEBUG :: NeuroneModule: TTS args: Tts name: pico2wave, parameters: {'cache': False, 'language': 'fr-FR'}
2017-01-03 23:48:07,590 :: DEBUG :: Run plugin pico2wave with parameter {'cache': False, 'language': 'fr-FR'}
2017-01-03 23:48:07,596 :: DEBUG :: Class TTSModule called from module Pico2wave, cache: False, language: fr-FR, voice: default
2017-01-03 23:48:07,596 :: DEBUG :: get_path_to_store_audio return: /tmp/kalliope_tts_cache/Pico2wave/fr-FR/default/7e67e7c5163ea7b9b7c9b49ef1ec70ba.tts
2017-01-03 23:48:07,609 :: DEBUG :: Pico2wave command: ['/usr/bin/pico2wave', '-l=fr-FR', '-w=/tmp/kalliope_tts_cache/Pico2wave/fr-FR/default/7e67e7c5163ea7b9b7c9b49ef1ec70ba.tts.wav', u'il est 23 heure et 48 minute']
2017-01-03 23:48:07,828 :: DEBUG :: Mplayer cmd: ['/usr/bin/mplayer', '-slave', '-quiet', '/tmp/kalliope_tts_cache/Pico2wave/fr-FR/default/7e67e7c5163ea7b9b7c9b49ef1ec70ba.tts']
Waiting for trigger detection
2017-01-03 23:48:10,844 :: DEBUG :: Unpausing snowboy process
2017-01-03 23:48:11,001 :: INFO :: Keyword 1 detected at time: 2017-01-03 23:48:11
2017-01-03 23:48:11,003 :: DEBUG :: Pausing snowboy process
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/dist-packages/kalliope/trigger/snowboy/snowboydecoder.py", line 153, in run
callback()
File "/usr/local/lib/python2.7/dist-packages/kalliope/core/MainController.py", line 53, in callback
self.order_listener.start()
File "/usr/lib/python2.7/threading.py", line 739, in start
raise RuntimeError("threads can only be started once")
RuntimeError: threads can only be started once

^C

Ctrl+C pressed. Killing Kalliope

Thank you,
Guillaume.

Neurons directory path

Add in setting file a path to define neuron path directory.

  • Use the common order selection path defined in #96

Settings/brain/templates (user config) loaded from /etc/kalliope

In order to have an installation performed by pip, the project will be placed in /usr/lib/python/dist-packages like other python lib. The user will not have an access to this part anymore. We need o export user data outside the source code.

We cannot use a local folder (like ansible-playbook do) as Kalliope is designed to run in daemon mode.

We need to ask the user to setup his own Kalliope in /etc/kalliope like all Linux daemon.

After doc about settings, should have a doc about starting

  • OS: Debian stretch
  • Language: French from France
  • Audio tested with rec and mplayer: working fine
  • git checkout 3aa67fb

I found no doc about starting kalliope. I infered that ./kallipe.py start was the right answer, but as it does not work for me (no reaction my voice), so a whole lots of questoins arises.

I tried with --debug too, and last line is:

2016-11-23 21:22:31,834 :: DEBUG :: detecting...

But whatever I say, there's nothing more.

I think we're missing some documentation about "what is snowboy", "what is the wake up word" and how to configure it (I inferred from the video that it may default to "kalliopé" but was not able to find it/change it),

I also think we may need an option to see more debug information about the microphone used, my laptop typically has two input devices, but I was not able to find configuration of input devices in kalliope. Oh I'm using Debian stretch.

I still not read the code, willingly proof-testing the documentation þ

Hello New here...

Hi..
First great work... thank you ...

Second I install the kalliope everything seems to be ok but when i start it i get this..

pi@raspberrypi:~ $ kalliope start Traceback (most recent call last): File "/usr/local/bin/kalliope", line 5, in <module> from pkg_resources import load_entry_point File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2876, in <module> working_set = WorkingSet._build_master() File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 451, in _build_master return cls._build_from_requirements(__requires__) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 464, in _build_from_requirements dists = ws.resolve(reqs, Environment()) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 644, in resolve raise VersionConflict(dist, req) pkg_resources.VersionConflict: (setuptools 5.5.1 (/usr/lib/python2.7/dist-packages), Requirement.parse('setuptools>=11.3'))

Any help ... thank you...

default neuron response

Hi,

Firstable, thanks for this great app, I started playing with it yesterday and i'm having fun with it :)
(I'm trying to write my first neurons, but this is my 1st python attempt ^^).

My question:
Is it possible to have a "default" neurons being selected when kalliope doesn't understand (eg: Google Speech Recognition could not understand audio) or when the recognition is not right and thus kalliope doesn't have any neurons to trigger (No synapse match the captured order …)?

A default optional neurons could be trigger for those who want to know why kalliope is not responding back

Again, thanks guys!

Crash on install @ubuntu 16.04

Requirement already satisfied: MarkupSafe in /usr/lib/python3/dist-packages (from jinja2->ansible==2.1.1.0)
SUDO password:
[WARNING]: Host file not found: /etc/ansible/hosts

[WARNING]: provided hosts list is empty, only localhost is available

ERROR! Unexpected Exception: name 'urllib2' is not defined
to see the full traceback, use -vvv

1st) I don't have the folder /etc/ansible/...
2nd) The urllib2 are only available in Python 2, right?

What should I do ?

install a neuron from git repo

Add un kalliope command to allow users to install a neuron repository using a git url

kalliope neuron-install --url=<git_url>

Can't execute install_kalliope.sh failed

I can't execute successfully the install_kalliope.sh
I'm on debian stretch.
I don't know if it's the normal behavior but it's look like it use my cowsay .

This is my log. I can translate it if needed but you look french in the YT video.

$./kalliope/install/install_kalliope.sh
sudo: impossible de déterminer le nom de l'hôte debian
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
libssl-dev is already the newest version (1.0.2j-1).
python-pip is already the newest version (8.1.2-3).
0 mis à jour, 0 nouvellement installés, 0 à enlever et 89 non mis à jour.
sudo: impossible de déterminer le nom de l'hôte debian
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
E: Impossible de trouver le paquet libportaudio0
sudo: impossible de déterminer le nom de l'hôte debian
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
apt-transport-https is already the newest version (1.3.1).
libffi-dev is already the newest version (3.2.1-6).
python-markupsafe is already the newest version (0.23-2+b2).
python-paramiko is already the newest version (2.0.0-1).
python-pycparser is already the newest version (2.14+dfsg-2).
python-yaml is already the newest version (3.12-1).
0 mis à jour, 0 nouvellement installés, 0 à enlever et 89 non mis à jour.
sudo: impossible de déterminer le nom de l'hôte debian
Requirement already satisfied: ansible==2.1.1.0 in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: PyYAML in /usr/lib/python2.7/dist-packages (from ansible==2.1.1.0)
Requirement already satisfied: setuptools in /usr/lib/python2.7/dist-packages (from ansible==2.1.1.0)
Requirement already satisfied: jinja2 in /usr/lib/python2.7/dist-packages (from ansible==2.1.1.0)
Requirement already satisfied: paramiko in /usr/lib/python2.7/dist-packages (from ansible==2.1.1.0)
Requirement already satisfied: pycrypto>=2.6 in /usr/lib/python2.7/dist-packages (from ansible==2.1.1.0)
Requirement already satisfied: MarkupSafe in /usr/lib/python2.7/dist-packages (from jinja2->ansible==2.1.1.0)
SUDO password:
[WARNING]: provided hosts list is empty, only localhost is available


< PLAY [localhost] >

    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            ||----w |
            ||     ||

< TASK [Install packages] >

    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            ||----w |
            ||     ||

failed: [localhost] (item=[u'python-pip', u'python-dev', u'libsmpeg0', u'libttspico-utils', u'libsmpeg0', u'flac', u'dialog', u'libffi-dev', u'libffi-dev', u'libssl-dev', u'portaudio19-dev', u'build-essential', u'libssl-dev', u'libffi-dev', u'sox', u'libatlas3-base', u'mplayer']) => {"failed": true, "item": ["python-pip", "python-dev", "libsmpeg0", "libttspico-utils", "libsmpeg0", "flac", "dialog", "libffi-dev", "libffi-dev", "libssl-dev", "portaudio19-dev", "build-essential", "libssl-dev", "libffi-dev", "sox", "libatlas3-base", "mplayer"], "msg": "Could not fetch updated apt files"}


< NO MORE HOSTS LEFT >

    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            ||----w |
            ||     ||

[WARNING]: Could not create retry file 'install.retry'. [Errno 2] No
such file or directory: ''


< PLAY RECAP >

    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            ||----w |
            ||     ||

localhost : ok=0 changed=0 unreachable=0 failed=1

crontab manager review

Currently we load a new instance of Kalliope when a event is raised by the Linux crontab.

We need that an "event" ask the current living process to load the synapse.

Options we have:

  • make the crontab line call the rest api of kalliope (force the user to have an active Rest api).
  • add a TCP socket to the alive instance and create a python script that will push a message into this socket. The python script will be the one called by the current crontab manager.
  • base the event on celery (http://docs.celeryproject.org/en/master/userguide/periodic-tasks.html)
  • ?

Use Python setuptools for installation and distribution

Hi there,

Nice project but I think that the installation procedure using ansible is a bit overkill and unfriendly to Python users and developers.
I suggest migrating to a classical setup.py script and layout using the Python setuptools standard.

Here is the official documentation and recommendation:

It could also be a good thing in the future for the integration in other distributions like Debian where package builder auto-detect Python setup systems like setuptools or distutils.

Cheers! :)

Problem with CLI

Hello,
Thanks for this project.
Fresh install 1 hour ago, Ubuntu 14.04 - python 2. 7.5
Gui OK; TTS, STT , synapse Say-hello OK;

But problem with the cli:
python kalliope.py start --debug
2016-11-22 19:05:37,240 :: DEBUG :: Logger ready
2016-11-22 19:05:37,245 :: DEBUG :: kalliope args: Namespace(action='start', brain_file=None, debug=True, run_synapse=None)
2016-11-22 19:05:37,246 :: DEBUG :: Loading brain with file path: None
2016-11-22 19:05:37,246 :: DEBUG :: Real brain.yml path: /home/thierry/projets/kalliope/brain.yml
2016-11-22 19:05:37,247 :: DEBUG :: Current dir: /home/thierry/projets/kalliope/core/ConfigurationManager
2016-11-22 19:05:37,247 :: DEBUG :: Root dir: /home/thierry/projets/kalliope
2016-11-22 19:05:37,248 :: DEBUG :: File path to load: /home/thierry/projets/kalliope/brain.yml
2016-11-22 19:05:37,427 :: DEBUG :: Real brain.yml path: /home/thierry/projets/kalliope/brain.yml
2016-11-22 19:05:37,428 :: DEBUG :: Current dir: /home/thierry/projets/kalliope/core/ConfigurationManager
2016-11-22 19:05:37,428 :: DEBUG :: Root dir: /home/thierry/projets/kalliope
2016-11-22 19:05:37,428 :: DEBUG :: File path to load: /home/thierry/projets/kalliope/brain.yml
2016-11-22 19:05:38,072 :: DEBUG :: Real brain.yml path: /home/thierry/projets/kalliope/brain.yml
2016-11-22 19:05:38,086 :: DEBUG :: Real Kalliope.py path: /home/thierry/projets/kalliope/kalliope.py
Events loaded in crontab
Starting Kalliope
Press Ctrl+C for stopping
2016-11-22 19:05:38,155 :: DEBUG :: Loading settings with file path: None
2016-11-22 19:05:38,155 :: DEBUG :: Current dir: /home/thierry/projets/kalliope/core/ConfigurationManager
2016-11-22 19:05:38,155 :: DEBUG :: Root dir: /home/thierry/projets/kalliope
2016-11-22 19:05:38,156 :: DEBUG :: File path to load: /home/thierry/projets/kalliope/settings.yml
2016-11-22 19:05:38,202 :: DEBUG :: Current dir: /home/thierry/projets/kalliope/core/ConfigurationManager
2016-11-22 19:05:38,203 :: DEBUG :: Root dir: /home/thierry/projets/kalliope
2016-11-22 19:05:38,203 :: DEBUG :: File path to load: /home/thierry/projets/kalliope/settings.yml
2016-11-22 19:05:38,248 :: DEBUG :: Default STT: google
2016-11-22 19:05:38,249 :: DEBUG :: Default TTS: pico2wave
2016-11-22 19:05:38,249 :: DEBUG :: Default Trigger name: snowboy
Starting REST API Listening port: 5000
2016-11-22 19:05:38,353 :: DEBUG :: TriggerLauncher: Start trigger snowboy with parameters: {'callback': <bound method MainController.callback of <core.MainController.MainController instance at 0xb5dfdfac>>, 'pmdl_file': 'trigger/snowboy/resources/kalliope-FR-6samples.pmdl'}
2016-11-22 19:05:38,354 :: DEBUG :: Run plugin Snowboy with parameter {'callback': <bound method MainController.callback of <core.MainController.MainController instance at 0xb5dfdfac>>, 'pmdl_file': 'trigger/snowboy/resources/kalliope-FR-6samples.pmdl'}
Traceback (most recent call last):
File "kalliope.py", line 117, in
main()
File "kalliope.py", line 88, in main
MainController(brain=brain)
File "/home/thierry/projets/kalliope/core/MainController.py", line 41, in init
self.trigger_instance = self._get_default_trigger()
File "/home/thierry/projets/kalliope/core/MainController.py", line 84, in _get_default_trigger
return TriggerLauncher.get_trigger(trigger, callback=self.callback)
File "/home/thierry/projets/kalliope/core/TriggerLauncher.py", line 27, in get_trigger
trigger.parameters)
File "/home/thierry/projets/kalliope/core/Utils.py", line 77, in get_dynamic_class_instantiation
mod = import(module_name_with_path, fromlist=[module_name])
File "/home/thierry/projets/kalliope/trigger/snowboy/init.py", line 1, in
from snowboy import Snowboy
File "/home/thierry/projets/kalliope/trigger/snowboy/snowboy.py", line 4, in
from trigger.snowboy import snowboydecoder
File "/home/thierry/projets/kalliope/trigger/snowboy/snowboydecoder.py", line 7, in
import snowboydetect
File "/home/thierry/projets/kalliope/trigger/snowboy/snowboydetect.py", line 30, in
_snowboydetect = swig_import_helper()
File "/home/thierry/projets/kalliope/trigger/snowboy/snowboydetect.py", line 22, in swig_import_helper
import _snowboydetect
ImportError: No module named _snowboydetect

Try to rename snowboydetect.py and snowboydetect.pyc with _ before, but after, it's another error..

Can you help ?
Thanks in advance.
Thierry
Regards

cffi Package Version Mismatch Error

I'm running Ubuntu 16.04.

I installed Kalliope, but when I go to start it I get a version mismatch error. Do I have to install that specific version of the cffi package, or is that version check too specific?

$ python kalliope.py start
Events loaded in crontab
Starting Kalliope
Press Ctrl+C for stopping
Starting REST API Listening port: 5000
Traceback (most recent call last):
  File "kalliope.py", line 117, in <module>
    main()
  File "kalliope.py", line 88, in main
    MainController(brain=brain)
  File "/home/jwright/Downloads/kalliope/core/MainController.py", line 39, in __init__
    self.order_listener = OrderListener(self.analyse_order)
  File "/home/jwright/Downloads/kalliope/core/OrderListener.py", line 39, in __init__
    self._ignore_stderr()
  File "/home/jwright/Downloads/kalliope/core/OrderListener.py", line 67, in _ignore_stderr
    ffi = _FFI()
  File "/home/jwright/.local/lib/python2.7/site-packages/cffi/api.py", line 59, in __init__
    "version mismatch, %s != %s" % (backend.__version__, __version__)
AssertionError: version mismatch, 1.5.2 != 1.9.1

YML -> DB

import our brain.yml format to the DB

Kalliope update config

A cool feature would be the ability to reload kalliope settings/brains while running.
Eg: you add a brains or modify one via ssh while kalliope is running, ask kalliope to reload config, and your brains are updated so you can use latest modification

Not Free Package

Package libttspico-data libttspico-utils libttspico0 on debian are in not free repository , can you provide an alternative ?

community module update

I didn't see (but might be wrong) a way to update a community module (if the repo has been updated), is there one ?

Re-using the install --git-url git://… command return an error message indicating depo is already in the directory so maybe the command can update the repo when install command is run against an existing repo in the resources/neuron dir?

Rest API response is not right

I'm on the dev branch.
When I do a GET on /synapses/ , the json in return send a list of includes (all brains files loaded) which shouldn't be in the response.
Below is an extract of the current response

{
  "synapses": [
    {
      "includes": [
        "brains/google_calendar.yml",
        "brains/google_news_reader.yml",
        ...
      ]
    },
    {
      "name": "Take-pictures",
      "neurons": [
        {
          "camera": {
            "directory": "/home/pi/Desktop/PIctures/",
            "number_of_picture": 3,
            "timer": 1
          }
        },
        {
          "say": {
            "message": "C'est fait Monsieur"
          }
        }
      ],
      "signals": [
        {
          "order": "prends une photo"
        }
      ]
    },
    {...}
  ]
}

Impossible to give an order to Kalliope - Errno -9985

Hi !

I'm trying to run Kalliope since yesterday, after an issue with the headset (some right issue as I've created a new user under Raspbian Jessie with Pixel on Pi3).

Now my headset is working, I can launch and test successfully STT, TTS and "say-hello". STT is long to respond (5-10s after my speech) but it works.

When I start Kalliope, the hot-word "kalliope" is recognize (and not slow as in STT test) but after i got the below error message and I cannot give Kalliope any order.

Any idea on how to solve it?

2016-11-29 22:00:25,873 :: INFO :: Keyword 1 detected at time: 2016-11-29 22:00:25
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File   ##"/home/pi/kalliope/core/OrderListener.py", line 49, in run
    self.load_stt_plugin()
  File "/home/pi/kalliope/core/OrderListener.py", line 60, in load_stt_plugin
    parameters=stt_object.parameters)
  File "/home/pi/kalliope/core/Utils.py", line 89, in get_dynamic_class_instantiation
    return klass(**parameters)
  File "/home/pi/kalliope/stt/google/google.py", line 21, in __init__
    with sr.Microphone() as source:
  File "/usr/local/lib/python2.7/dist-packages/speech_recognition/__init__.py", line 116, in __enter__
    input = True, # stream is an input stream
  File "/usr/local/lib/python2.7/dist-packages/pyaudio.py", line 750, in open
    stream = Stream(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pyaudio.py", line 441, in __init__
    self._stream = pa.open(**arguments)
IOError: [Errno -9985] Device unavailable

Case sensitive Orders

Improvement to make sure orders are no case sensitive.

Why ?

  • No reason to make a difference between "what time is it" and "What time is it"
  • Easier to configure
  • Depending of the STT, outputs can be upper or lower cases.

Add eSpeak TTS

Hello,

Sorry for my bad English (I'm french)
I wrote a new TTS for eSpeak ( kalliope-espeak )

I wanted to propose its integration to kalliope

Kalliopé voice issue

Hello there,

I do not know if it is a alsamixer, raspberry, microphone, headphone or kalliopé issue but when Kalliopé is talking, she is "stutting" (I did not change tts or stt conf).

"BonBonjour MonMonsieur,"

Any idea ?

Entry points

When using PIP install, entry points are used in two case:

  • from the dev, currently kalliope.py
  • from the /usr/bin/kalliope entry automatically created by the pip install

We have two entry points, one for dev and one for pip (/usr/bin).
Can be the same but we need to keep the dev one

wikipedia neuron conflict with python wikipedia module

Inside wikipedia neuron, line 3, the

import wikipedia

imports the neuron itself (as it is a module named wikipedia) instead of the python-wikipedia module. So the neurons does not work when calling python-wikipedia functions.

This could help to avoid name conflicts between neurons and python modules.

The (very dirty) trick i used to make it work was to copy the python-wikipedia module inside the wikipedia neuron directory and change its name and then adapt the import in the neuron.

OpenSSL fatal error

Kalliope crash during wikipedia neuron request.

Gmail and Weather works, OpenSSL packet is installed
(raspberry pi 2, python 2.7)

logs.txt

DB -> YML

Add command to export DB schema to brain.yml format.

Stuck on "Say something"

Merci beaucoup pour ce projet ! Ça fait longtemps que je cherchais un équivalent.

French
J'ai suivi toutes les instructions pour l'installation (dev) sur une raspberry pi.
J'ai cependant un souci : l'application reste bloqué sur "Say something" et ne semble pas reconnaître ce que je dis.
Pourtant, j'arrive bien a récupéré le son par mon micro avec rec puis à l'écouter avec play.
Comme le mode debug n'indique rien de plus, je ne sais pas trop comment résoudre cela.
Auriez-vous une piste ?

English
I followed the instructions for the installation on a raspberry pi.
But i have an issue : the application gets stuck on "Say something" and it does not seem to recognize what i am saying.
However, I can recover a sound with rec then play.
Debug mode indicates nothing more and I don't know how to resolve this.
Can you help me ?

ImportError: No module named espeak.espeak

Hey guys,

I am testing Kalliope and I must be doing something wrong because i cannot use the eSpeak (community) module, it installed well with kalliope install in the correct directory but when i try to use it all i get is:

raceback (most recent call last):
  File "/usr/local/bin/kalliope", line 9, in <module>
    load_entry_point('kalliope==0.4.0', 'console_scripts', 'kalliope')()
  File "/usr/local/lib/python2.7/dist-packages/kalliope-0.4.0-py2.7.egg/kalliope/__init__.py", line 95, in main
    ShellGui(brain=brain)
  File "/usr/local/lib/python2.7/dist-packages/kalliope-0.4.0-py2.7.egg/kalliope/core/ShellGui.py", line 54, in __init__
    self.show_main_menu()
  File "/usr/local/lib/python2.7/dist-packages/kalliope-0.4.0-py2.7.egg/kalliope/core/ShellGui.py", line 71, in show_main_menu
    self.show_tts_test_menu()
  File "/usr/local/lib/python2.7/dist-packages/kalliope-0.4.0-py2.7.egg/kalliope/core/ShellGui.py", line 132, in show_tts_test_menu
    self._run_tts_test(tag, sentence_to_test)
  File "/usr/local/lib/python2.7/dist-packages/kalliope-0.4.0-py2.7.egg/kalliope/core/ShellGui.py", line 147, in _run_tts_test
    Say(message=sentence_to_test, tts=tts_name)
  File "/usr/local/lib/python2.7/dist-packages/kalliope-0.4.0-py2.7.egg/kalliope/neurons/say/say.py", line 11, in __init__
    self.say(self.message)
  File "/usr/local/lib/python2.7/dist-packages/kalliope-0.4.0-py2.7.egg/kalliope/core/NeuronModule.py", line 134, in say
    parameters=tts_object.parameters)
  File "/usr/local/lib/python2.7/dist-packages/kalliope-0.4.0-py2.7.egg/kalliope/core/Utils/Utils.py", line 115, in get_dynamic_class_instantiation
    mod = __import__(package_path, fromlist=[module_name.capitalize()])
ImportError: No module named espeak.espeak

This is the part from settings.yml about the resources

resource_directory:
  neuron: "resources/neurons"
  stt: "resources/stt"
  tts: "resources/tts"

And the espeak module is in the resources/tts/espeak folder.

Am i doing something wrong?

multiple order with brackets not working

E.g

- name: "wikipedia-search"
    signals:
      - order: "cherche sur Wikipédia {{ query }}"
      - order: "cherche sur wikipédia {{ query }}"
    neurons:
      - wikipedia_searcher:
          language: "fr"
          sentences: 1
          args:
            - query
          file_template: "templates/wikipedia_returned_value.j2"

Improve API

Improvement of the API in view to add requests from GUI.

Suggested entry points :

- /synapses : 
   - GET : return all synapses (active in a brain or not)

- /synapse/start/order : 
   - POST: run a synapse from a text order

- /synapse/start/id/<id> : 
   - POST: run the synapse by its ID

- /synapse/start/audio : 
   - POST: run the synapse via an uploaded audio

- /neurons :
   - GET : list of all available neurons

- /neurons/<name>:
   - GET : return the neuron infos (params : <neuron-name>)

- /settings/
   - GET : return the corresponding values


TO BE IMPROVED & CONTINUED ...

Multiple triggers

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 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?

CI support

Please add CI support (Travis ...) to run some automated tests (is there some kind of unit-tests somewhere ? how to run them ?).

No synapse found

Hello,

Do you know why I have this message, what I need to do to solve it please

Say something!
Google Speech Recognition thinks you said Quelle heure est-il
No synapse match the captured order: Quelle heure est-il
Default synapse found: default-synapse, running it
Waiting for trigger detection

Trigger Name Not Recognized

Kalliope doesn't seem to hear me when I use the default trigger name "snowboy". I'm running Ubuntu 16.04.

  1. I have made sure my user is in the audio group.
  2. I have checked to make sure that my mic is unmuted and working.
  3. I recorded a test wav file using the rec command, and it worked fine (audio had good volume and clarity).

I just started trying to get Kalliope running today via the readme, so I'm not sure I've got everything configured correctly. Here's the debug output from Kalliope.

$ python kalliope.py start --debug
2016-12-08 11:01:03,098 :: DEBUG :: Logger ready
2016-12-08 11:01:03,098 :: DEBUG :: kalliope args: Namespace(action='start', brain_file=None, debug=True, run_synapse=None)
2016-12-08 11:01:03,098 :: DEBUG :: Loading brain with file path: None
2016-12-08 11:01:03,098 :: DEBUG :: Real brain.yml path: /home/jwright/Downloads/kalliope/brain.yml
2016-12-08 11:01:03,098 :: DEBUG :: Current dir: /home/jwright/Downloads/kalliope/core/ConfigurationManager 
2016-12-08 11:01:03,098 :: DEBUG :: Root dir: /home/jwright/Downloads/kalliope 
2016-12-08 11:01:03,098 :: DEBUG :: File path to load: /home/jwright/Downloads/kalliope/brain.yml 
2016-12-08 11:01:03,147 :: DEBUG :: Real brain.yml path: /home/jwright/Downloads/kalliope/brain.yml
2016-12-08 11:01:03,147 :: DEBUG :: Current dir: /home/jwright/Downloads/kalliope/core/ConfigurationManager 
2016-12-08 11:01:03,147 :: DEBUG :: Root dir: /home/jwright/Downloads/kalliope 
2016-12-08 11:01:03,147 :: DEBUG :: File path to load: /home/jwright/Downloads/kalliope/brain.yml 
2016-12-08 11:01:03,541 :: DEBUG :: Real brain.yml path: /home/jwright/Downloads/kalliope/brain.yml
2016-12-08 11:01:03,547 :: DEBUG :: Real Kalliope.py path: /home/jwright/Downloads/kalliope/kalliope.py
Events loaded in crontab
Starting Kalliope
Press Ctrl+C for stopping
2016-12-08 11:01:03,567 :: DEBUG :: Loading settings with file path: None
2016-12-08 11:01:03,567 :: DEBUG :: Current dir: /home/jwright/Downloads/kalliope/core/ConfigurationManager 
2016-12-08 11:01:03,568 :: DEBUG :: Root dir: /home/jwright/Downloads/kalliope 
2016-12-08 11:01:03,568 :: DEBUG :: File path to load: /home/jwright/Downloads/kalliope/settings.yml 
2016-12-08 11:01:03,580 :: DEBUG :: Current dir: /home/jwright/Downloads/kalliope/core/ConfigurationManager 
2016-12-08 11:01:03,580 :: DEBUG :: Root dir: /home/jwright/Downloads/kalliope 
2016-12-08 11:01:03,580 :: DEBUG :: File path to load: /home/jwright/Downloads/kalliope/settings.yml 
2016-12-08 11:01:03,590 :: DEBUG :: Default STT: google
2016-12-08 11:01:03,590 :: DEBUG :: Default TTS: pico2wave
2016-12-08 11:01:03,590 :: DEBUG :: Default Trigger name: snowboy
Starting REST API Listening port: 5000
2016-12-08 11:01:03,632 :: DEBUG :: TriggerLauncher: Start trigger snowboy with parameters: {'callback': <bound method MainController.callback of <core.MainController.MainController instance at 0x7fc1f24a3368>>, 'pmdl_file': 'trigger/snowboy/resources/kalliope-FR-6samples.pmdl'}
2016-12-08 11:01:03,633 :: DEBUG :: Run plugin Snowboy with parameter {'callback': <bound method MainController.callback of <core.MainController.MainController instance at 0x7fc1f24a3368>>, 'pmdl_file': 'trigger/snowboy/resources/kalliope-FR-6samples.pmdl'}
2016-12-08 11:01:03,662 :: DEBUG :: detecting...

Neurotransmitter from_direct_link neuro don't wait for answer

Hi again… :)

I was playing with the neurotransmitter neuron so that I can start multiple asks at once, with kalliope asking me if I wanted to run these actions.

Might be easier with an example:
https://github.com/bacardi55/kalliope_config/blob/master/brains/morning.yml
Here, I wanted to run a "morning update" synapse where kalliope ask if I want to know my next meetings (if yes then does it) and then ask if i want to here the news (if yes then does it).

When testing the brain above, i notice that the 1st 3 synapses are running ok (one say and 2 neurotransmitter-direct_link) each after the other one but then when the 4th start (the one with the neurotransmitter-from_direct_link) then before i can answer the to kalliope, the 5th synapse starts.

Is this a bug or an expected behavior ? :)

setup.py file

Create a setup.py file.
Almost done in the install_review branch.

This one need to:

  • install python libs
  • install entrypoints (/usr/bin/kalliope)
  • create /etc/kalliope
  • put a default settings.yml file in /etc/kalliope if not already present (do not override current user config)
  • put an hello world brain in /etc/kalliope

Sudo password required

When installing a new neuron via the kalliope install CLI command, I have to enter my sudo password even though my neuron request no additional installation and resources directory is writable by current user.
Could it only ask password when needed ?
Also, what happens when sudo is not installed on the local system?

Seems to come from here:
https://github.com/kalliope-project/kalliope/blob/master/kalliope/core/ResourcesManager.py#L235

(Also, it seems it assume that the root user exists, so I'm wandering if this works on Ubuntu)

Units tests (core and neurons)

Neuron tests to do

  • shell
  • script
  • systemdate
  • ansible_playbook

core tests to do

  • FileManager
  • NeuronModules
  • SynapseLauncher
  • Neuronlauncher
  • TriggerLauncher
  • CrontabManager (but need a review of the class itself first)

Split Core Neurons and Community Neurons

Move community neurons out of the core of Kalliope. Each of those community neurons should be manage in a separate repository to increase its usability.
This allows users to choose neurons they want to install and remove dependencies of the Core of Kalliope to unused libraries.

Only keep Core neurons :

  • ansible playbook
  • say
  • neurotransmitter
  • kill_switch
  • script
  • shell
  • systemdate
  • uri
  • sleep

Community neurons :

  • gmail checker
  • push_message
  • rss_reader
  • tasker_autoremote
  • twitter
  • wake_on_lan
  • wikipedia

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.