Browse Source

update neuron template doc

nico 8 years ago
parent
commit
8d348b2af2
3 changed files with 28 additions and 4 deletions
  1. 25 2
      Docs/neuron_template.md
  2. 1 0
      brain.yml
  3. 2 2
      test.py

+ 25 - 2
Docs/neuron_template.md

@@ -4,7 +4,7 @@
 
 Little description of what the neuron do.
 
-## Parameters
+## Options
 
 (usage of a [table generator](http://www.tablesgenerator.com/markdown_tables) is recommended)
 
@@ -15,17 +15,40 @@ Little description of what the neuron do.
 | parameter_name_3 | yes      | default_value_if_not_provided |                                   | description of the parameter |
 
 
-## Synapse example
+## Return Values
 
+Only necessary when the neuron use a template to say something
+
+| name      | description                        | type       | sample                    |
+|-----------|------------------------------------|------------|---------------------------|
+| value_key | dictionary containing all the data | dictionary | {"name":"me", "email": 2} |
+| value_key | list of value                      | list       | ["val1", "val2", "val3"]  |
+| value_key | string value                       | string     | "2"                       |
+
+
+## Synapses example
+
+Description of what the synapse will do
 ```
  - name: "type here your name"
     neurons:      
       - neuron_name:
           parameter: "value"
+          parameter: "value"
+          file_template: template_name.j2
     signals:
       - order: "this is what I have to say to run this synapse"
 ```
 
+## Templates example 
+
+Description of the template
+```
+This is a var {{ var }} 
+{% for item in items %}
+ This is the  {{ item }}  
+{% endfor %}
+```
 
 ## Notes
 

+ 1 - 0
brain.yml

@@ -32,6 +32,7 @@
           say_template:
             - "Il est {{ hours }} heures et {{ minutes }} minutes"
           tts: "voxygen"
+          cache: False
     signals:
       - order: "what time"
 

+ 2 - 2
test.py

@@ -11,8 +11,8 @@ from core.TriggerLauncher import TriggerLauncher
 
 logging.basicConfig()
 logger = logging.getLogger("jarvis")
-
-order = "est-ce que j'ai des emails"
+logger.setLevel(logging.DEBUG)
+order = "dis bonjour"
 
 oa = OrderAnalyser(order=order)