@kavchat/core 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1846,5 +1846,369 @@
1846
1846
  ]
1847
1847
  }
1848
1848
  ]
1849
+ },
1850
+ {
1851
+ "name": "th: question without spaces, answered",
1852
+ "scripts": "th",
1853
+ "locale": "th",
1854
+ "userName": "สมชาย",
1855
+ "steps": [
1856
+ {
1857
+ "do": "start",
1858
+ "messages": [
1859
+ {
1860
+ "from": "bot",
1861
+ "text": "สวัสดี, สมชาย มีอะไรให้ช่วยไหม"
1862
+ }
1863
+ ],
1864
+ "chips": [
1865
+ {
1866
+ "id": "script:billing",
1867
+ "label": "การชำระเงิน",
1868
+ "kind": "button"
1869
+ },
1870
+ {
1871
+ "id": "script:account",
1872
+ "label": "บัญชีผู้ใช้",
1873
+ "kind": "button"
1874
+ },
1875
+ {
1876
+ "id": "script:shipping",
1877
+ "label": "การจัดส่ง",
1878
+ "kind": "button"
1879
+ },
1880
+ {
1881
+ "id": "script:promo",
1882
+ "label": "โปรโมชั่น",
1883
+ "kind": "button"
1884
+ },
1885
+ {
1886
+ "id": "contact",
1887
+ "label": "ติดต่อทีมงาน",
1888
+ "kind": "contact"
1889
+ }
1890
+ ],
1891
+ "outcome": "open",
1892
+ "position": null,
1893
+ "path": [
1894
+ "open/w/start"
1895
+ ],
1896
+ "unmatched": []
1897
+ },
1898
+ {
1899
+ "do": {
1900
+ "text": "ลืมรหัสผ่านค่ะ"
1901
+ },
1902
+ "effect": null,
1903
+ "messages": [
1904
+ {
1905
+ "from": "bot",
1906
+ "text": "สวัสดี, สมชาย มีอะไรให้ช่วยไหม"
1907
+ },
1908
+ {
1909
+ "from": "user",
1910
+ "text": "ลืมรหัสผ่านค่ะ"
1911
+ },
1912
+ {
1913
+ "from": "bot",
1914
+ "text": "กด \"ลืมรหัสผ่าน\" ที่หน้าเข้าสู่ระบบ",
1915
+ "stepId": "a1"
1916
+ },
1917
+ {
1918
+ "from": "bot",
1919
+ "text": "คำตอบนี้ช่วยตอบคำถามของคุณหรือไม่"
1920
+ }
1921
+ ],
1922
+ "chips": [
1923
+ {
1924
+ "id": "yes",
1925
+ "label": "ใช่ ขอบคุณ",
1926
+ "kind": "yes"
1927
+ },
1928
+ {
1929
+ "id": "no",
1930
+ "label": "ไม่ใช่ ต้องการความช่วยเหลือ",
1931
+ "kind": "no"
1932
+ },
1933
+ {
1934
+ "id": "home",
1935
+ "label": "เมนูหลัก",
1936
+ "kind": "home"
1937
+ }
1938
+ ],
1939
+ "outcome": "open",
1940
+ "position": {
1941
+ "scriptId": "account",
1942
+ "stepId": "a1"
1943
+ },
1944
+ "path": [
1945
+ "open/w/start",
1946
+ "account/a1/text"
1947
+ ],
1948
+ "unmatched": []
1949
+ },
1950
+ {
1951
+ "do": {
1952
+ "chip": "yes"
1953
+ },
1954
+ "effect": null,
1955
+ "messages": [
1956
+ {
1957
+ "from": "bot",
1958
+ "text": "สวัสดี, สมชาย มีอะไรให้ช่วยไหม"
1959
+ },
1960
+ {
1961
+ "from": "user",
1962
+ "text": "ลืมรหัสผ่านค่ะ"
1963
+ },
1964
+ {
1965
+ "from": "bot",
1966
+ "text": "กด \"ลืมรหัสผ่าน\" ที่หน้าเข้าสู่ระบบ",
1967
+ "stepId": "a1"
1968
+ },
1969
+ {
1970
+ "from": "bot",
1971
+ "text": "คำตอบนี้ช่วยตอบคำถามของคุณหรือไม่"
1972
+ },
1973
+ {
1974
+ "from": "user",
1975
+ "text": "ใช่ ขอบคุณ"
1976
+ },
1977
+ {
1978
+ "from": "bot",
1979
+ "text": "ยินดีที่ได้ช่วยเหลือ"
1980
+ }
1981
+ ],
1982
+ "chips": [
1983
+ {
1984
+ "id": "new",
1985
+ "label": "ถามคำถามใหม่",
1986
+ "kind": "home"
1987
+ }
1988
+ ],
1989
+ "outcome": "answered",
1990
+ "position": {
1991
+ "scriptId": "account",
1992
+ "stepId": "a1"
1993
+ },
1994
+ "path": [
1995
+ "open/w/start",
1996
+ "account/a1/text"
1997
+ ],
1998
+ "unmatched": []
1999
+ }
2000
+ ]
2001
+ },
2002
+ {
2003
+ "name": "th: no match twice opens contact with the question",
2004
+ "scripts": "th",
2005
+ "locale": "th-TH",
2006
+ "userName": "",
2007
+ "steps": [
2008
+ {
2009
+ "do": "start",
2010
+ "messages": [
2011
+ {
2012
+ "from": "bot",
2013
+ "text": "สวัสดี มีอะไรให้ช่วยไหม"
2014
+ }
2015
+ ],
2016
+ "chips": [
2017
+ {
2018
+ "id": "script:billing",
2019
+ "label": "การชำระเงิน",
2020
+ "kind": "button"
2021
+ },
2022
+ {
2023
+ "id": "script:account",
2024
+ "label": "บัญชีผู้ใช้",
2025
+ "kind": "button"
2026
+ },
2027
+ {
2028
+ "id": "script:shipping",
2029
+ "label": "การจัดส่ง",
2030
+ "kind": "button"
2031
+ },
2032
+ {
2033
+ "id": "script:promo",
2034
+ "label": "โปรโมชั่น",
2035
+ "kind": "button"
2036
+ },
2037
+ {
2038
+ "id": "contact",
2039
+ "label": "ติดต่อทีมงาน",
2040
+ "kind": "contact"
2041
+ }
2042
+ ],
2043
+ "outcome": "open",
2044
+ "position": null,
2045
+ "path": [
2046
+ "open/w/start"
2047
+ ],
2048
+ "unmatched": []
2049
+ },
2050
+ {
2051
+ "do": {
2052
+ "text": "วันนี้อากาศดีไหม"
2053
+ },
2054
+ "effect": null,
2055
+ "messages": [
2056
+ {
2057
+ "from": "bot",
2058
+ "text": "สวัสดี มีอะไรให้ช่วยไหม"
2059
+ },
2060
+ {
2061
+ "from": "user",
2062
+ "text": "วันนี้อากาศดีไหม"
2063
+ },
2064
+ {
2065
+ "from": "bot",
2066
+ "text": "ขออภัย ไม่พบคำตอบสำหรับคำถามนี้ กรุณาเลือกหัวข้อจากเมนู หรือติดต่อทีมงานของเรา"
2067
+ }
2068
+ ],
2069
+ "chips": [
2070
+ {
2071
+ "id": "script:billing",
2072
+ "label": "การชำระเงิน",
2073
+ "kind": "button"
2074
+ },
2075
+ {
2076
+ "id": "script:account",
2077
+ "label": "บัญชีผู้ใช้",
2078
+ "kind": "button"
2079
+ },
2080
+ {
2081
+ "id": "script:shipping",
2082
+ "label": "การจัดส่ง",
2083
+ "kind": "button"
2084
+ },
2085
+ {
2086
+ "id": "script:promo",
2087
+ "label": "โปรโมชั่น",
2088
+ "kind": "button"
2089
+ },
2090
+ {
2091
+ "id": "contact",
2092
+ "label": "ติดต่อทีมงาน",
2093
+ "kind": "contact"
2094
+ }
2095
+ ],
2096
+ "outcome": "open",
2097
+ "position": null,
2098
+ "path": [
2099
+ "open/w/start"
2100
+ ],
2101
+ "unmatched": [
2102
+ "วันนี้อากาศดีไหม"
2103
+ ]
2104
+ },
2105
+ {
2106
+ "do": {
2107
+ "text": "อากาศพรุ่งนี้"
2108
+ },
2109
+ "effect": null,
2110
+ "messages": [
2111
+ {
2112
+ "from": "bot",
2113
+ "text": "สวัสดี มีอะไรให้ช่วยไหม"
2114
+ },
2115
+ {
2116
+ "from": "user",
2117
+ "text": "วันนี้อากาศดีไหม"
2118
+ },
2119
+ {
2120
+ "from": "bot",
2121
+ "text": "ขออภัย ไม่พบคำตอบสำหรับคำถามนี้ กรุณาเลือกหัวข้อจากเมนู หรือติดต่อทีมงานของเรา"
2122
+ },
2123
+ {
2124
+ "from": "user",
2125
+ "text": "อากาศพรุ่งนี้"
2126
+ },
2127
+ {
2128
+ "from": "bot",
2129
+ "text": "ขออภัย ไม่พบคำตอบ ทีมงานของเรายินดีช่วยเหลือ และได้ใส่คำถามของคุณไว้ในแบบฟอร์มแล้ว"
2130
+ }
2131
+ ],
2132
+ "chips": [
2133
+ {
2134
+ "id": "contact",
2135
+ "label": "ติดต่อทีมงาน",
2136
+ "kind": "contact"
2137
+ },
2138
+ {
2139
+ "id": "home",
2140
+ "label": "เมนูหลัก",
2141
+ "kind": "home"
2142
+ }
2143
+ ],
2144
+ "outcome": "open",
2145
+ "position": null,
2146
+ "path": [
2147
+ "open/w/start"
2148
+ ],
2149
+ "unmatched": [
2150
+ "วันนี้อากาศดีไหม",
2151
+ "อากาศพรุ่งนี้"
2152
+ ]
2153
+ },
2154
+ {
2155
+ "do": {
2156
+ "chip": "contact"
2157
+ },
2158
+ "effect": {
2159
+ "type": "contact",
2160
+ "contactTopicId": null,
2161
+ "scriptId": null,
2162
+ "prefill": "อากาศพรุ่งนี้",
2163
+ "transcript": 6
2164
+ },
2165
+ "messages": [
2166
+ {
2167
+ "from": "bot",
2168
+ "text": "สวัสดี มีอะไรให้ช่วยไหม"
2169
+ },
2170
+ {
2171
+ "from": "user",
2172
+ "text": "วันนี้อากาศดีไหม"
2173
+ },
2174
+ {
2175
+ "from": "bot",
2176
+ "text": "ขออภัย ไม่พบคำตอบสำหรับคำถามนี้ กรุณาเลือกหัวข้อจากเมนู หรือติดต่อทีมงานของเรา"
2177
+ },
2178
+ {
2179
+ "from": "user",
2180
+ "text": "อากาศพรุ่งนี้"
2181
+ },
2182
+ {
2183
+ "from": "bot",
2184
+ "text": "ขออภัย ไม่พบคำตอบ ทีมงานของเรายินดีช่วยเหลือ และได้ใส่คำถามของคุณไว้ในแบบฟอร์มแล้ว"
2185
+ },
2186
+ {
2187
+ "from": "user",
2188
+ "text": "ติดต่อทีมงาน"
2189
+ },
2190
+ {
2191
+ "from": "bot",
2192
+ "text": "กำลังเปิดแบบฟอร์มติดต่อ บทสนทนานี้จะแนบไปกับคำขอของคุณ"
2193
+ }
2194
+ ],
2195
+ "chips": [
2196
+ {
2197
+ "id": "home",
2198
+ "label": "เมนูหลัก",
2199
+ "kind": "home"
2200
+ }
2201
+ ],
2202
+ "outcome": "contact",
2203
+ "position": null,
2204
+ "path": [
2205
+ "open/w/start"
2206
+ ],
2207
+ "unmatched": [
2208
+ "วันนี้อากาศดีไหม",
2209
+ "อากาศพรุ่งนี้"
2210
+ ]
2211
+ }
2212
+ ]
1849
2213
  }
1850
2214
  ]
@@ -191,5 +191,129 @@
191
191
  ]
192
192
  }
193
193
  }
194
+ ],
195
+ "th": [
196
+ {
197
+ "id": "open",
198
+ "kind": "opening",
199
+ "sortOrder": -1,
200
+ "content": {
201
+ "name": "",
202
+ "keywords": [],
203
+ "rootStepId": "w",
204
+ "steps": [
205
+ {
206
+ "id": "w",
207
+ "text": "สวัสดี{name} มีอะไรให้ช่วยไหม",
208
+ "keywords": [],
209
+ "buttons": []
210
+ }
211
+ ]
212
+ }
213
+ },
214
+ {
215
+ "id": "billing",
216
+ "kind": "topic",
217
+ "sortOrder": 1,
218
+ "content": {
219
+ "name": "การชำระเงิน",
220
+ "keywords": [
221
+ "ใบเสร็จ",
222
+ "ชำระเงิน",
223
+ "บัตรเครดิต"
224
+ ],
225
+ "contactTopicId": "finance",
226
+ "rootStepId": "b1",
227
+ "steps": [
228
+ {
229
+ "id": "b1",
230
+ "text": "ดาวน์โหลดใบเสร็จได้ที่หน้าบัญชีของคุณ",
231
+ "keywords": [],
232
+ "buttons": [
233
+ {
234
+ "id": "b1",
235
+ "label": "ขอใบกำกับภาษี",
236
+ "action": {
237
+ "type": "step",
238
+ "stepId": "b2"
239
+ }
240
+ }
241
+ ]
242
+ },
243
+ {
244
+ "id": "b2",
245
+ "text": "ส่งคำขอใบกำกับภาษีได้ในแบบฟอร์มติดต่อ",
246
+ "keywords": [
247
+ "ใบกำกับภาษี"
248
+ ],
249
+ "buttons": []
250
+ }
251
+ ]
252
+ }
253
+ },
254
+ {
255
+ "id": "account",
256
+ "kind": "topic",
257
+ "sortOrder": 2,
258
+ "content": {
259
+ "name": "บัญชีผู้ใช้",
260
+ "keywords": [
261
+ "รหัสผ่าน",
262
+ "รหัส",
263
+ "เข้าสู่ระบบ",
264
+ "password"
265
+ ],
266
+ "rootStepId": "a1",
267
+ "steps": [
268
+ {
269
+ "id": "a1",
270
+ "text": "กด \"ลืมรหัสผ่าน\" ที่หน้าเข้าสู่ระบบ",
271
+ "keywords": [],
272
+ "buttons": []
273
+ }
274
+ ]
275
+ }
276
+ },
277
+ {
278
+ "id": "shipping",
279
+ "kind": "topic",
280
+ "sortOrder": 3,
281
+ "content": {
282
+ "name": "การจัดส่ง",
283
+ "keywords": [
284
+ "พัสดุ",
285
+ "น้ำหนัก"
286
+ ],
287
+ "rootStepId": "s1",
288
+ "steps": [
289
+ {
290
+ "id": "s1",
291
+ "text": "จัดส่งภายใน 3-5 วันทำการ",
292
+ "keywords": [],
293
+ "buttons": []
294
+ }
295
+ ]
296
+ }
297
+ },
298
+ {
299
+ "id": "promo",
300
+ "kind": "topic",
301
+ "sortOrder": 4,
302
+ "content": {
303
+ "name": "โปรโมชั่น",
304
+ "keywords": [
305
+ "โปร199"
306
+ ],
307
+ "rootStepId": "p1",
308
+ "steps": [
309
+ {
310
+ "id": "p1",
311
+ "text": "แพ็กเกจ 199 บาทต่อเดือน",
312
+ "keywords": [],
313
+ "buttons": []
314
+ }
315
+ ]
316
+ }
317
+ }
194
318
  ]
195
319
  }
@@ -128,5 +128,136 @@
128
128
  "score": 2
129
129
  }
130
130
  ]
131
+ },
132
+ {
133
+ "scripts": "th",
134
+ "input": "ใบเสร็จอยู่ที่ไหนครับ",
135
+ "kind": "single",
136
+ "matches": [
137
+ {
138
+ "scriptId": "billing",
139
+ "stepId": "b1",
140
+ "score": 3
141
+ }
142
+ ]
143
+ },
144
+ {
145
+ "scripts": "th",
146
+ "input": "ลืมรหัสผ่านค่ะ",
147
+ "kind": "single",
148
+ "matches": [
149
+ {
150
+ "scriptId": "account",
151
+ "stepId": "a1",
152
+ "score": 3
153
+ }
154
+ ]
155
+ },
156
+ {
157
+ "scripts": "th",
158
+ "input": "ลืมรหัส\u200bผ่าน",
159
+ "kind": "single",
160
+ "matches": [
161
+ {
162
+ "scriptId": "account",
163
+ "stepId": "a1",
164
+ "score": 3
165
+ }
166
+ ]
167
+ },
168
+ {
169
+ "scripts": "th",
170
+ "input": "สนใจโปร๑๙๙",
171
+ "kind": "single",
172
+ "matches": [
173
+ {
174
+ "scriptId": "promo",
175
+ "stepId": "p1",
176
+ "score": 3
177
+ }
178
+ ]
179
+ },
180
+ {
181
+ "scripts": "th",
182
+ "input": "นำ้หนักพัสดุเท่าไหร่",
183
+ "kind": "single",
184
+ "matches": [
185
+ {
186
+ "scriptId": "shipping",
187
+ "stepId": "s1",
188
+ "score": 6
189
+ }
190
+ ]
191
+ },
192
+ {
193
+ "scripts": "th",
194
+ "input": "เปลี่ยน รหัสผ่าน",
195
+ "kind": "single",
196
+ "matches": [
197
+ {
198
+ "scriptId": "account",
199
+ "stepId": "a1",
200
+ "score": 3
201
+ }
202
+ ]
203
+ },
204
+ {
205
+ "scripts": "th",
206
+ "input": "มีโปรโมชั่นอะไรบ้าง",
207
+ "kind": "single",
208
+ "matches": [
209
+ {
210
+ "scriptId": "promo",
211
+ "stepId": "p1",
212
+ "score": 2
213
+ }
214
+ ]
215
+ },
216
+ {
217
+ "scripts": "th",
218
+ "input": "ขอใบกำกับภาษีหน่อย",
219
+ "kind": "single",
220
+ "matches": [
221
+ {
222
+ "scriptId": "billing",
223
+ "stepId": "b2",
224
+ "score": 5
225
+ }
226
+ ]
227
+ },
228
+ {
229
+ "scripts": "th",
230
+ "input": "reset password ได้ไหม",
231
+ "kind": "single",
232
+ "matches": [
233
+ {
234
+ "scriptId": "account",
235
+ "stepId": "a1",
236
+ "score": 3
237
+ }
238
+ ]
239
+ },
240
+ {
241
+ "scripts": "th",
242
+ "input": "ชำระเงินค่าพัสดุ",
243
+ "kind": "multi",
244
+ "matches": [
245
+ {
246
+ "scriptId": "billing",
247
+ "stepId": "b1",
248
+ "score": 3
249
+ },
250
+ {
251
+ "scriptId": "shipping",
252
+ "stepId": "s1",
253
+ "score": 3
254
+ }
255
+ ]
256
+ },
257
+ {
258
+ "scripts": "th",
259
+ "input": "วันนี้อากาศดีไหม",
260
+ "kind": "none",
261
+ "matches": []
131
262
  }
132
263
  ]