|
1 | 1 | { |
2 | 2 | "seed_key": "huey-bookbot", |
3 | 3 | "name": "Huey Bookbot", |
4 | | - "description": "Kid-friendly book recommendation chatbot. Asks age, reading ability, and preference questions, then recommends books.", |
5 | | - "version": "2.0.0", |
| 4 | + "description": "Kid-friendly book recommendation chatbot. Asks age, reading ability, and preference questions, then recommends books. Optionally offers jokes and a spelling game.", |
| 5 | + "version": "3.0.0", |
6 | 6 | "entry_node_id": "welcome", |
7 | 7 | "visibility": "wriveted", |
8 | 8 | "trace_enabled": true, |
|
56 | 56 | ], |
57 | 57 | "variable": "temp.school_confirm" |
58 | 58 | }, |
59 | | - "position": {"x": 700, "y": 150} |
| 59 | + "position": {"x": 700, "y": 100} |
| 60 | + }, |
| 61 | + { |
| 62 | + "id": "check_stale_collection", |
| 63 | + "type": "condition", |
| 64 | + "content": { |
| 65 | + "conditions": [ |
| 66 | + {"if": "has(context.collection_updated_at) && days_since(context.collection_updated_at) > 1095", "then": "$0"} |
| 67 | + ], |
| 68 | + "default_path": "default" |
| 69 | + }, |
| 70 | + "position": {"x": 900, "y": 100} |
| 71 | + }, |
| 72 | + { |
| 73 | + "id": "stale_collection_msg", |
| 74 | + "type": "message", |
| 75 | + "content": { |
| 76 | + "messages": [ |
| 77 | + {"type": "text", "text": "Just a heads up \u2014 it looks like your school's book list hasn't been updated in a while, so my recommendations might not match what's on the shelves right now."}, |
| 78 | + {"type": "text", "text": "Your librarian can upload a new CSV at hueybooks.com to help me find the latest books! \ud83d\udcda"} |
| 79 | + ] |
| 80 | + }, |
| 81 | + "position": {"x": 1100, "y": 0} |
60 | 82 | }, |
61 | 83 | { |
62 | 84 | "id": "profile_composite", |
63 | 85 | "type": "composite", |
64 | 86 | "content": { |
65 | 87 | "composite_flow_seed_key": "huey-profile" |
66 | 88 | }, |
67 | | - "position": {"x": 900, "y": 300} |
| 89 | + "position": {"x": 1100, "y": 300} |
68 | 90 | }, |
69 | 91 | { |
70 | 92 | "id": "preferences_composite", |
71 | 93 | "type": "composite", |
72 | 94 | "content": { |
73 | 95 | "composite_flow_seed_key": "huey-preferences" |
74 | 96 | }, |
75 | | - "position": {"x": 1100, "y": 300} |
| 97 | + "position": {"x": 1300, "y": 300} |
76 | 98 | }, |
77 | 99 | { |
78 | 100 | "id": "recommendation_composite", |
79 | 101 | "type": "composite", |
80 | 102 | "content": { |
81 | 103 | "composite_flow_seed_key": "huey-recommendation" |
82 | 104 | }, |
83 | | - "position": {"x": 1300, "y": 300} |
| 105 | + "position": {"x": 1500, "y": 300} |
| 106 | + }, |
| 107 | + { |
| 108 | + "id": "check_jokes_enabled", |
| 109 | + "type": "condition", |
| 110 | + "content": { |
| 111 | + "conditions": [ |
| 112 | + {"if": "!(has(context.experiments) && has(context.experiments.no_jokes) && context.experiments.no_jokes == true)", "then": "$0"} |
| 113 | + ], |
| 114 | + "default_path": "default" |
| 115 | + }, |
| 116 | + "position": {"x": 1700, "y": 300} |
| 117 | + }, |
| 118 | + { |
| 119 | + "id": "jokes_composite", |
| 120 | + "type": "composite", |
| 121 | + "content": { |
| 122 | + "composite_flow_seed_key": "huey-jokes" |
| 123 | + }, |
| 124 | + "position": {"x": 1900, "y": 200} |
| 125 | + }, |
| 126 | + { |
| 127 | + "id": "spelling_composite", |
| 128 | + "type": "composite", |
| 129 | + "content": { |
| 130 | + "composite_flow_seed_key": "huey-spelling" |
| 131 | + }, |
| 132 | + "position": {"x": 2100, "y": 300} |
84 | 133 | }, |
85 | 134 | { |
86 | 135 | "id": "end_msg", |
|
90 | 139 | {"type": "text", "text": "Happy reading! Remember, the best book is the one YOU enjoy. \ud83d\ude0a"} |
91 | 140 | ] |
92 | 141 | }, |
93 | | - "position": {"x": 1500, "y": 300} |
| 142 | + "position": {"x": 2300, "y": 300} |
94 | 143 | }, |
95 | 144 | { |
96 | 145 | "id": "restart_choice", |
|
104 | 153 | ], |
105 | 154 | "variable": "temp.restart_choice" |
106 | 155 | }, |
107 | | - "position": {"x": 1700, "y": 300} |
| 156 | + "position": {"x": 2500, "y": 300} |
108 | 157 | }, |
109 | 158 | { |
110 | 159 | "id": "goodbye", |
|
114 | 163 | {"type": "text", "text": "Thanks for chatting with me! See you next time! \ud83d\udc4b"} |
115 | 164 | ] |
116 | 165 | }, |
117 | | - "position": {"x": 1900, "y": 450} |
| 166 | + "position": {"x": 2700, "y": 450} |
118 | 167 | } |
119 | 168 | ], |
120 | 169 | "connections": [ |
121 | 170 | {"source": "welcome", "target": "greeting_response", "type": "default"}, |
122 | 171 | {"source": "greeting_response", "target": "check_school", "type": "default"}, |
123 | 172 | {"source": "check_school", "target": "school_confirm", "type": "$0"}, |
124 | 173 | {"source": "check_school", "target": "profile_composite", "type": "default"}, |
125 | | - {"source": "school_confirm", "target": "profile_composite", "type": "default"}, |
| 174 | + {"source": "school_confirm", "target": "check_stale_collection", "type": "default"}, |
| 175 | + {"source": "check_stale_collection", "target": "stale_collection_msg", "type": "$0"}, |
| 176 | + {"source": "check_stale_collection", "target": "profile_composite", "type": "default"}, |
| 177 | + {"source": "stale_collection_msg", "target": "profile_composite", "type": "default"}, |
126 | 178 | {"source": "profile_composite", "target": "preferences_composite", "type": "default"}, |
127 | 179 | {"source": "preferences_composite", "target": "recommendation_composite", "type": "default"}, |
128 | | - {"source": "recommendation_composite", "target": "end_msg", "type": "default"}, |
| 180 | + {"source": "recommendation_composite", "target": "check_jokes_enabled", "type": "default"}, |
| 181 | + {"source": "check_jokes_enabled", "target": "jokes_composite", "type": "$0"}, |
| 182 | + {"source": "check_jokes_enabled", "target": "spelling_composite", "type": "default"}, |
| 183 | + {"source": "jokes_composite", "target": "spelling_composite", "type": "default"}, |
| 184 | + {"source": "spelling_composite", "target": "end_msg", "type": "default"}, |
129 | 185 | {"source": "end_msg", "target": "restart_choice", "type": "default"}, |
130 | 186 | {"source": "restart_choice", "target": "welcome", "type": "$0", "conditions": {"if": {"var": "temp.restart_choice", "eq": "restart"}}}, |
131 | 187 | {"source": "restart_choice", "target": "goodbye", "type": "default"} |
|
0 commit comments