-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSara.js
55 lines (38 loc) · 1.79 KB
/
Sara.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// {Name: The AI Dude}
// {Description: Learn how to create a dialog script and integrate your AI assistant with the app}
// Use this sample to create your own voice commands
let sarahVoice = voice(en, 'female', 0, 5, 1.2);
intent(`Who are you?`, `What is your name?`, p => {
p.play(sarahVoice, `I'm Sarah, your virtual voice assistant`, opts({deactivate: true}));
})
const greedyCapture = '.+';
intent(`Add $(TASK* ${greedyCapture}) to my to do list`, p => {
p.play(
opts({force: true}),
{command: 'addItem', item: p.TASK.value}, );
p.play(`Added ${p.TASK.value} to your to-do list`)
});
intent(`I want to submit a complaint. $(COMPLAINT* ${greedyCapture})`, p => {
p.play(`Your complaint has been registered. You've said: ${p.COMPLAINT.value}`);
});
intent(`add to Stream of Conciousness $(CONCIOUSNESS* ${greedyCapture})`, p => {
p.play(
opts({force: true, activate:true}),
{command: 'addConciousness', item: p.CONCIOUSNESS.value}, );
p.play(`Added ${p.CONCIOUSNESS.value} to your screen`)
p.play(`Your Conciousness has been registered. You've said: ${p.CONCIOUSNESS.value}`);
});
// Give Alan some knowledge about the world
corpus(`
Hello, I'm Alan.
This is a demo application.
You can learn how to teach Alan useful skills.
I can teach you how to write Alan Scripts.
I can help you. I can do a lot of things. I can answer questions. I can do tasks.
But they should be relevant to this application.
I can help with this application.
I'm Alan. I'm a virtual assistant. I'm here to help you with applications.
This is a demo script. It shows how to use Alan.
You can create dialogs and teach me.
For example: I can help navigate this application.
`);