data_map.expressions
An array of objects that define plain string or regex patterns
to match against the user's input. When a match is found, the output object is returned.
| Name | Type | Default | Description |
|---|---|---|---|
expressionsRequired | object[] | - | An array of objects that accept the expressions Parameters. |
expressions Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
stringRequired | string | - | The actual input or value from the user or system. |
patternRequired | string | - | A regular expression pattern to validate or match the string. |
outputRequired | object | - | Defines the response or action to be taken when the pattern matches. |
Example
- YAML
- JSON
expressions:
- string: "starwars"
pattern: "(?i)star\\s*wars"
output:
response: "May the Force be with you!"
- string: "startrek"
pattern: "(?i)star\\s*trek"
output:
response: "Live long and prosper!"
{
"expressions": [
{
"string": "starwars",
"pattern": "(?i)star\\s*wars",
"output": {
"response": "May the Force be with you!"
}
},
{
"string": "startrek",
"pattern": "(?i)star\\s*trek",
"output": {
"response": "Live long and prosper!"
}
}
]
}