-
Notifications
You must be signed in to change notification settings - Fork 8
/
begin.rive
128 lines (102 loc) · 3.9 KB
/
begin.rive
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/******************************************************************************
* Aiden - A RiveScript Chatbot Personality *
*----------------------------------------------------------------------------*
* This source code is released under a Creative Commons *
* Attribution-ShareAlike International License. *
* (C) Noah Petherbridge 2015 *
******************************************************************************/
! version = 2.0
// Number of times to persistently ask the same interview question before
// giving up.
! global interview_retry = 3
! local concat = space
> begin
+ request
* <get isGroupChat> == true => {ok} // Don't do interview in group chats
* <get met> != true => <set met=true>{topic=interview1}{ok}
- {ok}
< begin
+ reinterview me|interview me again
- Okay I'll interview you again.
^ <set met=false>{topic=interview2}What's your name?
> topic interview_common
// User can say "continue" at any time to cancel out of the interview.
+ [*] (continue|cancel|stop|quit) [*]
- Okay, let's just chat then. What's up?{topic=random}
+ int abort
- Nevermind then. What's up?{topic=random}
+ int help *
- If you don't want to tell me your <star>, just type "continue".
- Or just type "continue" if you don't want to tell me your <star>.
< topic
// Interview: ask the user their name.
> topic interview1
+ *
- Hi there! My name is <bot name>. What's your name?
^ <set retry=0>{topic=interview2}
< topic
// Interview: user responds with their name. Try 5 times to get their answer
// before giving up.
> topic interview2 includes interview_common
+ * *
* <get retry> > <env interview_retry> => {@int giveup}
- I only want your first name. {@int help}
- Just tell me your first name. {@int help}
- Can I just get your first name? {@int help}
+ (@first_names)
- <set name=<formal>>Your name is <get name>? Cool! Are you a boy or a girl?
^ <set retry=0>{topic=interview3}
+ *
* <get retry> > <env interview_retry> => {@int giveup}
- <set tmp=<formal>><add retry=1>Is that a real name? ({@int help})
+ [*] @yes [*]
% is that a real name *
- <set name=<get tmp>>Okay, then - I'll call you <get name>.
^ Well, are you a boy or a girl?
^ <set retry=0>{topic=interview3}
+ (my name is|call me|i am|im) *
@ <star2>
+ int giveup
- <set name=<id>>I'll just call you <get name>. Anyway, what's up?
^ {topic=random}
+ int help
- <add retry=1>{@int help name}
< topic
// Interview: user responds with their gender.
> topic interview3 includes interview_common
+ @malenoun
* <bot gender> == male => Me too! How old are you?{@int male}
* <bot gender> == female => Cool! I'm a girl. How old are you?{@int male}
- Cool! I'm a <bot gender>. How old are you?{@int male}
+ @femalenoun
* <bot gender> == female => Me too! How old are you?{@int female}
* <bot gender> == male => Cool! I'm a boy. How old are you?{@int female}
- Cool! I'm a <bot gender>. How old are you?{@int female}
+ [i am|im] a (@malenoun|@femalenoun)
@ <star>
+ *
* <get retry> > <env interview_retry> => {@int abort}
- I asked if you're a boy or a girl? {@int help}
- So are you a boy or a girl? {@int help}
+ int help
- <add retry=1>{@int help gender}
+ int male
- <set gender=male><set retry=0>{topic=interview4}
+ int female
- <set gender=female><set retry=0>{topic=interview4}
< topic
// Interview: user responds with their age.
> topic interview4 includes interview_common
+ #
- <set age=<star>>I'll remember that you're <get age> years old.
^ I'm <bot age>, myself. That's all the questions I have for now -- let's
^ chat. What's up?{topic=random}
+ (i am|im) # [years old]
@ <star2>
+ *
* <get retry> > <env interview_retry> => {@int abort}
- Tell me your age as a number. {@int help}
- Can you tell me your age as a number? {@int help}
+ int help
- <add retry=1>{@int help age}
< topic