|
@@ -19,11 +19,11 @@ Let's take a look on a basic synapse in our brain:
|
|
|
```
|
|
|
---
|
|
|
- name: "Say-hello"
|
|
|
- neurons:
|
|
|
- - say:
|
|
|
- message: "Hello, sir"
|
|
|
signals:
|
|
|
- order: "say hello"
|
|
|
+ neurons:
|
|
|
+ - say:
|
|
|
+ message: "Hello, sir"
|
|
|
```
|
|
|
|
|
|
Let's break this down in sections so we can understand how the file is built and what each part means.
|
|
@@ -41,29 +41,8 @@ At the top level we have a "name" tag. This is the **unique identifier** of the
|
|
|
- name: "Say-hello"
|
|
|
```
|
|
|
|
|
|
-Then we have the neurons declaration. Neurons are modules that will be executed when the input action is triggered. You can define as many neurons as you want to the same input action (for example: say somethning, then do something etc...). This declaration contains a list (because it starts with a "-") of neurons
|
|
|
-```
|
|
|
-neurons:
|
|
|
- - neuron_1_name
|
|
|
- - neuron_2_name
|
|
|
- - another_neuron
|
|
|
-```
|
|
|
-
|
|
|
-The order of execution of neurons is defined by the order in which they are listed in neurons declaration.
|
|
|
-
|
|
|
-Some neurons need parameters that can be passed as arguments following the syntax bellow:
|
|
|
-```
|
|
|
-neurons:
|
|
|
- - neuron_name:
|
|
|
- parameter1: "value1"
|
|
|
- parameter2: "value2"
|
|
|
-```
|
|
|
-Note here that parameters are indented with one tabulation bellow the neuron's name (YAML syntax requirement).
|
|
|
-
|
|
|
-In this example, the neuron called "say" will make Kalliope speak out loud the sentence in parameter **message**.
|
|
|
-See the complete list of [available neurons](neurons.md) here.
|
|
|
|
|
|
-The last part, called **signals** is a list of input actions. This works exactly the same way as neurons. You must place here at least one action.
|
|
|
+The first part, called **signals** is a list of input actions. This works exactly the same way as neurons. You must place here at least one action.
|
|
|
In the following example, we use just one signal, an order. See the complete list of [available signals](signals.md) here.
|
|
|
```
|
|
|
signals:
|
|
@@ -85,19 +64,39 @@ To know if your order will be triggered by Kalliope, we recommend you to [use th
|
|
|
You must pay attention to define the orders as precise as possible. As Kalliope is based on matching, if you define your orders in different synapses too similiary, Kalliope risks to trigger more actions that you were expecting. For exemple, if you define two different synapses as shown below:
|
|
|
```
|
|
|
- name: "Say-hello"
|
|
|
-...
|
|
|
-signals:
|
|
|
- - order: "say hello"
|
|
|
+ signals:
|
|
|
+ - order: "say hello"
|
|
|
```
|
|
|
and
|
|
|
```
|
|
|
- name: "Say-something"
|
|
|
-...
|
|
|
-signals:
|
|
|
- - order: "say"
|
|
|
+ signals:
|
|
|
+ - order: "say"
|
|
|
```
|
|
|
When you will pronounce "say hello", it will trigger both synapses.
|
|
|
|
|
|
+Then we have the neurons declaration. Neurons are modules that will be executed when the input action is triggered. You can define as many neurons as you want to the same input action (for example: say somethning, then do something etc...). This declaration contains a list (because it starts with a "-") of neurons
|
|
|
+```
|
|
|
+neurons:
|
|
|
+ - neuron_1_name
|
|
|
+ - neuron_2_name
|
|
|
+ - another_neuron
|
|
|
+```
|
|
|
+
|
|
|
+The order of execution of neurons is defined by the order in which they are listed in neurons declaration.
|
|
|
+
|
|
|
+Some neurons need parameters that can be passed as arguments following the syntax bellow:
|
|
|
+```
|
|
|
+neurons:
|
|
|
+ - neuron_name:
|
|
|
+ parameter1: "value1"
|
|
|
+ parameter2: "value2"
|
|
|
+```
|
|
|
+Note here that parameters are indented with one tabulation bellow the neuron's name (YAML syntax requirement).
|
|
|
+
|
|
|
+In this example, the neuron called "say" will make Kalliope speak out loud the sentence in parameter **message**.
|
|
|
+See the complete list of [available neurons](neurons.md) here.
|
|
|
+
|
|
|
## Manage synapses
|
|
|
|
|
|
Kalliope provides also a REST API to manage your synapses (get the list, get one, run one), refer to [rest api documentation](rest_api.md) for more details.
|