Browse Source

[Doc] add doc for Say neuron

monf 8 years ago
parent
commit
261818efcf
3 changed files with 51 additions and 6 deletions
  1. 49 0
      neurons/say/README.md
  2. 2 6
      neurons/say/say.py
  3. 0 0
      neurons/shell/README.md

+ 49 - 0
neurons/say/README.md

@@ -0,0 +1,49 @@
+# shell
+
+## Synopsis
+
+This neuron is the mouth of Kalliope and uses the [TTS](../../Docs/tts.md) to say the given message.
+
+## Options
+
+| parameter | required | default | choices | comment                                |
+|-----------|----------|---------|---------|----------------------------------------|
+| message   | YES      |         |         | A list of messages Kalliope could say  |
+
+## Return Values
+
+No returned values
+
+## Synapses example
+
+Simple example : 
+
+```
+   - name: "Say-hello"
+    neurons:
+      - say:
+          message:
+            - "Hello Sir"
+    signals:
+      - order: "hello"
+```
+
+With a multiple choice list, Kalliope will pick one randomly:
+
+```
+   - name: "Say-hello"
+    neurons:
+      - say:
+          message:
+            - "Hello Sir"
+            - "Welcome Sir"
+            - "Good morning Sir"
+    signals:
+      - order: "hello"
+```
+
+
+## Notes
+
+> **Note:** The neuron does not return any values.
+> **Note:** Kalliope randomly takes a message from the list 

+ 2 - 6
neurons/say/say.py

@@ -1,8 +1,4 @@
-from core.NeuronModule import NeuronModule
-
-
-class NoMessageException(Exception):
-    pass
+from core.NeuronModule import NeuronModule, MissingParameterException
 
 
 class Say(NeuronModule):
@@ -12,6 +8,6 @@ class Say(NeuronModule):
         message = kwargs.get('message', None)
         # user must specify a message
         if message is None:
-            raise NoMessageException("You must specify a message string or a list of messages as parameter")
+            raise MissingParameterException("You must specify a message string or a list of messages as parameter")
         else:
             self.say(message)

+ 0 - 0
neurons/shell/Readme.md → neurons/shell/README.md