forked from aichaos/rivescript-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrivescript.proto
More file actions
91 lines (75 loc) · 2.12 KB
/
Copy pathrivescript.proto
File metadata and controls
91 lines (75 loc) · 2.12 KB
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
package rivescript;
// Protocol Buffer Schema for RiveScript Binary Format
// Compile to Python by doing:
// $ protoc --python_out=rivescript/ rivescript.proto
message Document {
// Wrapper for a complete RiveScript Document
required string version = 1; // RiveScript language version, i.e. 2.0
repeated Dict meta = 2; // Optional meta information (author, etc.)
// Configuration variables (from your begin.rs)
repeated Dict global = 3; // global variables
repeated Dict var = 4; // bot variables
repeated Dict sub = 5; // substitutions
repeated Dict person = 6; // person substitutions
repeated Array array = 7; // arrays
// Topics in this document
repeated Topic topic = 8;
// Object macros in this document
repeated Macro macro = 9;
}
message Topic {
// A wrapper for topics, which group sets of triggers together
required string name = 1 [default = "random"];
repeated Trigger trigger = 2;
repeated string include = 3;
repeated string inherit = 4;
}
message Macro {
// Container for an object macro
required string name = 1;
optional string language = 2;
required string code = 3;
}
message Trigger {
required string text = 1;
repeated Reply reply = 2;
repeated Previous previous = 3;
repeated Redirect redirect = 4;
repeated Condition condition = 5;
optional Syntax syntax = 6;
}
message Reply {
required string text = 1;
optional Syntax syntax = 2;
}
message Redirect {
required string text = 1;
optional Syntax syntax = 2;
}
message Previous {
required string text = 1;
optional Syntax syntax = 2;
}
message Condition {
required string condition = 1;
required string text = 2;
optional Syntax syntax = 3;
}
//
// Primitive Types
//
message Syntax {
// Track the original file name and line number of anything.
required string filename = 1;
required uint32 line = 2;
}
message Array {
// String array type
required string name = 1;
repeated string content = 2;
}
message Dict {
// Key/value store
required string key = 1;
required string value = 2;
}