110
edits
(implementation update, development plan update) |
|||
| Line 14: | Line 14: | ||
= Implementation = | = Implementation = | ||
(TBD)(brief introduction) | (TBD)(brief introduction) | ||
To achieve 3rd party command registry, we apply linked data defined in schema.org as command format then make Vaani parse and manage the registered commands. | |||
== Data structure == | == Data structure == | ||
| Line 54: | Line 38: | ||
In this case, we create a dial command whose object is a telephone text or a person. Once a user says this command, the '''/dailer/index.html?dail={telephone}''' is called. | In this case, we create a dial command whose object is a telephone text or a person. Once a user says this command, the '''/dailer/index.html?dail={telephone}''' is called. | ||
== Structure of Code== | |||
<br> | |||
[[image:Introduced-modules.png|none|thumb|500px|]] | |||
==== predefined actions (predefined-actions/*.js) ==== | |||
A predefined action is responsible for: | |||
* parse target field of manifest.webapp | |||
* generate grammar | |||
* parse result from transcript | |||
We can find DialAction at predefined-actions/dial-action.js, OpenAppAction at predefined-actions/open-app-action.js. | |||
==== launchers (launchers/*.js) ==== | |||
A launcher executes the command parsed by Vaani. Currently, we only support '''WebActivity''', launchers/activity-launcher.js. In the future, we will support IAC. | |||
==== actions parser (store/app-actions.js) ==== | |||
The actions parser parses action definitions from manifest.webapp. It looks up custom_command field from manifest.webapp file. Once found it, it asks launcher to parse it. | |||
==== core (action/standing-by.js) ==== | |||
We extends the original design of Vaani but changes '''setupSpeech''' and '''_interpreter''' function at standing-by.js: | |||
* '''setupSpeech''': we use predefined actions to generate grammars. | |||
* '''_interpreter''': we use predefined actions to parse transcript and use launcher to execute command. | |||
=== Predefined actions === | === Predefined actions === | ||
(TBD) | (TBD) | ||
==== Dial Action ==== | |||
"custom_commands": [{ | |||
"@context": "http://schema.org", | |||
"@type": "DialAction", | |||
"target": { | |||
"@type": "WebActivity", | |||
"name": "dial", | |||
"data": { | |||
"type": "webtelephony/number", | |||
"number": "@number" | |||
} | |||
} | |||
}] | |||
==== Open Action ==== | |||
"custom_commands": [{ | |||
"@context": "http://schema.org", | |||
"@type": "OpenAction", | |||
"object": "SoftwareApplication", | |||
"target": { | |||
"@type": "WebActivity", | |||
"name": "open-app", | |||
"data": { | |||
"type": "webapp", | |||
"manifest": "@manifest", | |||
"entry_point": "@entry_point" | |||
} | |||
} | |||
}] | |||
== Bug list == | == Bug list == | ||
| Line 67: | Line 107: | ||
**Define data format and supported actions. | **Define data format and supported actions. | ||
**Predefined grammar structure. | **Predefined grammar structure. | ||
** | **Compound command through IAC. | ||
*Stage 2 : Compound command | *Stage 2 : Compound command API | ||
**Compound command. | **Compound command API for 3rd party apps. | ||
*Stage 3 : NLP service | *Stage 3 : NLP service | ||
**NLP processor to recognition result. | **NLP processor to recognition result. | ||
| Line 143: | Line 183: | ||
Since there is no one handles open-app activity, we also add open-app activity to Vaani app. | Since there is no one handles open-app activity, we also add open-app activity to Vaani app. | ||
=== | == Stage 2 == | ||
In stage 1, we use IAC to achieve interaction between Vaani and app. However, IAC is only for certified apps, we want extend it to any 3rd party apps. So in this stage, we will design a communication API for general packaged apps. | |||
= FAQ = | = FAQ = | ||
edits