Skip to content

Module structure

maxbachmann edited this page Oct 21, 2019 · 7 revisions

Presentation

dialogTemplate

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": []
        }
    ]
}

ModuleName.py

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

ModuleName.install

{
	"name": "{moduleName}",
	"version": 0.1,
	"author": "{username}",
	"maintainers": [],
	"desc": "{description}",
	"aliceMinVersion": 0.10,
	"pipRequirements": [{pipRequirements}],
	"systemRequirements": [{systemRequirements}],
	"conditions": {{
		"lang": [{langs}]
	}}
}

README.md

# {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`