-
-
Notifications
You must be signed in to change notification settings - Fork 15
Module structure
maxbachmann edited this page Oct 21, 2019
·
7 revisions
- Modules belong in the modules directory of Project Alice
- Each sub directory represents another module
- The module structure is the following
- ModuleName
-
dialogTemplate
- en.json
- talks
- en.json
- widgets
- ModuleName.install
- ModuleName.py
- README.md
-
dialogTemplate
- ModuleName
Dialog templates, one for each supported languages, define the intents, the utterances and the slots supported by your module. It's default content should look like
{
"module": "ModuleName",
"icon": "time",
"description": "{description}",
"slotTypes": [
{
"name": "DummySlot",
"matchingStrictness": null,
"automaticallyExtensible": false,
"useSynonyms": true,
"values": []
}
],
"intents": [
{
"name": "Dummy",
"description": "REMOVE this dummy intent!",
"enabledByDefault": true,
"utterances": [],
"slots": []
}
]
}
import json
import core.base.Managers as managers
from core.base.model.Intent import Intent
from core.base.model.Module import Module
from core.dialog.model.DialogSession import DialogSession
class ModuleName(Module):
"""
Author: {username}
Description: {description}
"""
def __init__(self):
self._SUPPORTED_INTENTS = [
]
super().__init__(self._SUPPORTED_INTENTS)
def onMessage(self, intent: str, session: DialogSession):
return
{
"name": "{moduleName}",
"version": 0.1,
"author": "{username}",
"maintainers": [],
"desc": "{description}",
"aliceMinVersion": 0.10,
"pipRequirements": [{pipRequirements}],
"systemRequirements": [{systemRequirements}],
"conditions": {{
"lang": [{langs}]
}}
}
# {moduleName}
### Download
##### > WGET method
```bash
wget http://bit.ly/????????? -O ~/ProjectAlice/system/moduleInstallTickets/{moduleName}.install
```
##### > Alice CLI method
```bash
./alice add module {username} {moduleName}
```
### Description
{description}
- Version: 0.1
- Author: {username}
- Maintainers: N/A
- Alice minimum version: 0.10
- Conditions:
{langs}
- Pip requirements: N/A
- System requirements: N/A
### Configuration
`foo`:
- type: `bar`
- desc: `baz`
`bar`:
- type: `baz`
- desc: `bar`