wingbot 3.76.1-alpha.2 → 3.76.3
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.
- package/.claude/settings.local.json +11 -0
- package/package.json +1 -1
- package/src/LLMType.js +7 -0
- package/src/utils/compileWithState.js +5 -4
- package/test.json +0 -330
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(npx mocha:*)",
|
|
5
|
+
"Bash(npx tsc *)",
|
|
6
|
+
"Bash(npm test *)",
|
|
7
|
+
"Bash(node -e \"const p = require\\('./bot/plugins/BTMLLM'\\); console.log\\('factory type:', typeof p\\); console.log\\('factory name:', p.name\\);\")",
|
|
8
|
+
"Bash(grep -n \"prompt\\\\`\\\\|tagged\\\\|render\\\\|compile\\\\|hbs\" /Users/ondrejveres/Wingbot/wingbot-llm/src/prompt.js)"
|
|
9
|
+
]
|
|
10
|
+
}
|
|
11
|
+
}
|
package/package.json
CHANGED
package/src/LLMType.js
CHANGED
|
@@ -249,6 +249,13 @@ class LLMType {
|
|
|
249
249
|
const childSchema = child.toJSON();
|
|
250
250
|
if (!child._required) {
|
|
251
251
|
childSchema.type = [childSchema.type, 'null'];
|
|
252
|
+
// A nullable enum must also list null among its allowed
|
|
253
|
+
// values — otherwise null satisfies `type` but fails `enum`
|
|
254
|
+
// and is effectively disallowed, forcing the model to pick
|
|
255
|
+
// a value for an optional field.
|
|
256
|
+
if (Array.isArray(childSchema.enum) && !childSchema.enum.includes(null)) {
|
|
257
|
+
childSchema.enum = [...childSchema.enum, null];
|
|
258
|
+
}
|
|
252
259
|
}
|
|
253
260
|
properties[key] = childSchema;
|
|
254
261
|
required.push(key);
|
|
@@ -42,11 +42,12 @@ function compileWithState (req, res, template, forcedData = null) {
|
|
|
42
42
|
if (typeof template !== 'string') {
|
|
43
43
|
return `${template}`;
|
|
44
44
|
}
|
|
45
|
-
if (!template.includes('{{')) {
|
|
46
|
-
return template;
|
|
47
|
-
}
|
|
48
45
|
const data = forcedData || stateData(req, res);
|
|
49
|
-
|
|
46
|
+
let result = template;
|
|
47
|
+
for (let i = 0; i < 10 && result.includes('{{'); i++) {
|
|
48
|
+
result = handlebars.compile(result)(data);
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
module.exports = compileWithState;
|
package/test.json
DELETED
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"nlpModel": null,
|
|
3
|
-
"aiToken": null,
|
|
4
|
-
"locked": false,
|
|
5
|
-
"botId": "d3d638ef-880c-47af-be32-0677fd84daf5",
|
|
6
|
-
"name": "development",
|
|
7
|
-
"url": null,
|
|
8
|
-
"type": null,
|
|
9
|
-
"blocks": [
|
|
10
|
-
{
|
|
11
|
-
"isRoot": true,
|
|
12
|
-
"blockName": "Root",
|
|
13
|
-
"staticBlockId": "AJzahxmkr2V41diCjMdYsZ",
|
|
14
|
-
"routes": [
|
|
15
|
-
{
|
|
16
|
-
"id": "AJzai2BXN2V41diCjMdYsZ",
|
|
17
|
-
"path": "start",
|
|
18
|
-
"name": "Start",
|
|
19
|
-
"skill": null,
|
|
20
|
-
"isEntryPoint": true,
|
|
21
|
-
"isFallback": false,
|
|
22
|
-
"replies": [],
|
|
23
|
-
"resolvers": [
|
|
24
|
-
{
|
|
25
|
-
"type": "botbuild.message",
|
|
26
|
-
"params": {
|
|
27
|
-
"text": [
|
|
28
|
-
{
|
|
29
|
-
"l": "cs",
|
|
30
|
-
"t": [
|
|
31
|
-
"We just started talkin"
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"l": "en",
|
|
36
|
-
"t": ""
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
"replies": [],
|
|
40
|
-
"type": "message",
|
|
41
|
-
"llmContextType": "default"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
"aiTags": [],
|
|
46
|
-
"aiTitle": null,
|
|
47
|
-
"aiGlobal": true
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"path": "cars",
|
|
51
|
-
"id": "AHSwFpGqn2VLxPDKVL4XKZ",
|
|
52
|
-
"resolvers": [
|
|
53
|
-
{
|
|
54
|
-
"id": "AHSwFpGqn2VLxPDKVL4XKZ",
|
|
55
|
-
"type": "botbuild.include",
|
|
56
|
-
"params": {
|
|
57
|
-
"staticBlockId": "AHSwFpGqn2VLxPDKVL4XKZ",
|
|
58
|
-
"items": {}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"path": "weather",
|
|
65
|
-
"id": "IMb1IDCxl2VMWusudBybZW",
|
|
66
|
-
"resolvers": [
|
|
67
|
-
{
|
|
68
|
-
"id": "IMb1IDCxl2VMWusudBybZW",
|
|
69
|
-
"type": "botbuild.include",
|
|
70
|
-
"params": {
|
|
71
|
-
"staticBlockId": "IMb1IDCxl2VMWusudBybZW",
|
|
72
|
-
"items": {}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"id": "AJzaiAz6P2V41diCjMdYsZ",
|
|
79
|
-
"path": "fallback",
|
|
80
|
-
"name": "Fallback",
|
|
81
|
-
"skill": null,
|
|
82
|
-
"isEntryPoint": false,
|
|
83
|
-
"isFallback": true,
|
|
84
|
-
"replies": [],
|
|
85
|
-
"resolvers": [
|
|
86
|
-
{
|
|
87
|
-
"type": "botbuild.message",
|
|
88
|
-
"params": {
|
|
89
|
-
"text": [
|
|
90
|
-
{
|
|
91
|
-
"l": "cs",
|
|
92
|
-
"t": [
|
|
93
|
-
"Sorry, but i don't understand"
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"l": "en",
|
|
98
|
-
"t": [
|
|
99
|
-
"aaaaa"
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
],
|
|
103
|
-
"hasCondition": false,
|
|
104
|
-
"replies": [
|
|
105
|
-
{
|
|
106
|
-
"targetRouteId": "AJzai2BXN2V41diCjMdYsZ",
|
|
107
|
-
"title": [
|
|
108
|
-
{
|
|
109
|
-
"l": "cs",
|
|
110
|
-
"t": "Back to Start"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"l": "en",
|
|
114
|
-
"t": "sefsef"
|
|
115
|
-
}
|
|
116
|
-
]
|
|
117
|
-
}
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
]
|
|
122
|
-
}
|
|
123
|
-
],
|
|
124
|
-
"llmRouting": {
|
|
125
|
-
"prompt": "Use user's last message to decide, if they want's to change context of conversation.\nReturn one of following routing actions:\n\n- `-not-changed-`: context not changed or can't decide\n{{{actionListString}}}",
|
|
126
|
-
"scope": "global",
|
|
127
|
-
"bounce": "fallback"
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"blockName": "cars",
|
|
132
|
-
"staticBlockId": "AHSwFpGqn2VLxPDKVL4XKZ",
|
|
133
|
-
"routes": [
|
|
134
|
-
{
|
|
135
|
-
"id": "96GRoJH3h2VKYdPJ7k12sDM",
|
|
136
|
-
"path": "cars",
|
|
137
|
-
"name": "Cars",
|
|
138
|
-
"skill": "cars",
|
|
139
|
-
"isEntryPoint": true,
|
|
140
|
-
"isFallback": false,
|
|
141
|
-
"replies": [],
|
|
142
|
-
"resolvers": [
|
|
143
|
-
{
|
|
144
|
-
"type": "botbuild.message",
|
|
145
|
-
"params": {
|
|
146
|
-
"text": [
|
|
147
|
-
{
|
|
148
|
-
"l": "cs",
|
|
149
|
-
"t": [
|
|
150
|
-
"We are talking about cars. What would you like to know about cars?"
|
|
151
|
-
]
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"l": "en",
|
|
155
|
-
"t": ""
|
|
156
|
-
}
|
|
157
|
-
],
|
|
158
|
-
"replies": [],
|
|
159
|
-
"type": "message",
|
|
160
|
-
"llmContextType": "default"
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
],
|
|
164
|
-
"aiTags": [],
|
|
165
|
-
"aiTitle": null,
|
|
166
|
-
"aiGlobal": true,
|
|
167
|
-
"llmRouting": {
|
|
168
|
-
"scope": "global",
|
|
169
|
-
"classificationDescription": "user wants to talk about cars, or anything car related"
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
"id": "7QOQxgYFt2VM9DTyPZpSKs",
|
|
174
|
-
"path": "carburators",
|
|
175
|
-
"name": "carburators",
|
|
176
|
-
"skill": "cars",
|
|
177
|
-
"isEntryPoint": true,
|
|
178
|
-
"isFallback": false,
|
|
179
|
-
"replies": [],
|
|
180
|
-
"resolvers": [
|
|
181
|
-
{
|
|
182
|
-
"type": "botbuild.message",
|
|
183
|
-
"params": {
|
|
184
|
-
"text": [
|
|
185
|
-
{
|
|
186
|
-
"l": "cs",
|
|
187
|
-
"t": [
|
|
188
|
-
"Talk about carburators."
|
|
189
|
-
]
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
"l": "en",
|
|
193
|
-
"t": ""
|
|
194
|
-
}
|
|
195
|
-
],
|
|
196
|
-
"replies": [],
|
|
197
|
-
"type": "prompt",
|
|
198
|
-
"llmContextType": "default"
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
],
|
|
202
|
-
"aiTags": [],
|
|
203
|
-
"aiTitle": null,
|
|
204
|
-
"aiGlobal": true,
|
|
205
|
-
"llmRouting": {
|
|
206
|
-
"scope": "local",
|
|
207
|
-
"classificationDescription": "when user wants to speak about carburators"
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
"id": "9dIsbyWUD2VM9DTyPZpSKs",
|
|
212
|
-
"path": "fallback",
|
|
213
|
-
"name": "Fallback",
|
|
214
|
-
"skill": "cars",
|
|
215
|
-
"isEntryPoint": false,
|
|
216
|
-
"isFallback": true,
|
|
217
|
-
"replies": [],
|
|
218
|
-
"resolvers": [
|
|
219
|
-
{
|
|
220
|
-
"type": "botbuild.message",
|
|
221
|
-
"params": {
|
|
222
|
-
"text": [
|
|
223
|
-
{
|
|
224
|
-
"l": "cs",
|
|
225
|
-
"t": [
|
|
226
|
-
"Answer the users question, or just talk to him based on what he/she said."
|
|
227
|
-
]
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
"l": "en",
|
|
231
|
-
"t": ""
|
|
232
|
-
}
|
|
233
|
-
],
|
|
234
|
-
"replies": [],
|
|
235
|
-
"type": "prompt",
|
|
236
|
-
"llmContextType": "default"
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
"type": "botbuild.message",
|
|
241
|
-
"params": {
|
|
242
|
-
"text": [
|
|
243
|
-
{
|
|
244
|
-
"l": "cs",
|
|
245
|
-
"t": [
|
|
246
|
-
"This was fallbacked"
|
|
247
|
-
]
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
"l": "en",
|
|
251
|
-
"t": ""
|
|
252
|
-
}
|
|
253
|
-
],
|
|
254
|
-
"replies": [],
|
|
255
|
-
"type": "message",
|
|
256
|
-
"llmContextType": "default"
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
],
|
|
260
|
-
"aiTags": [],
|
|
261
|
-
"aiTitle": [
|
|
262
|
-
{
|
|
263
|
-
"l": "cs",
|
|
264
|
-
"t": ""
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
"l": "en",
|
|
268
|
-
"t": ""
|
|
269
|
-
}
|
|
270
|
-
],
|
|
271
|
-
"aiGlobal": true
|
|
272
|
-
}
|
|
273
|
-
]
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
"blockName": "weather",
|
|
277
|
-
"staticBlockId": "IMb1IDCxl2VMWusudBybZW",
|
|
278
|
-
"routes": [
|
|
279
|
-
{
|
|
280
|
-
"id": "IRs920neD2VMWusudBybZW",
|
|
281
|
-
"path": "weather",
|
|
282
|
-
"name": "weather",
|
|
283
|
-
"skill": "weather",
|
|
284
|
-
"isEntryPoint": true,
|
|
285
|
-
"isFallback": false,
|
|
286
|
-
"replies": [],
|
|
287
|
-
"resolvers": [
|
|
288
|
-
{
|
|
289
|
-
"type": "botbuild.message",
|
|
290
|
-
"params": {
|
|
291
|
-
"text": [
|
|
292
|
-
{
|
|
293
|
-
"l": "cs",
|
|
294
|
-
"t": [
|
|
295
|
-
"We are talking about weather"
|
|
296
|
-
]
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
"l": "en",
|
|
300
|
-
"t": ""
|
|
301
|
-
}
|
|
302
|
-
],
|
|
303
|
-
"replies": [],
|
|
304
|
-
"type": "message",
|
|
305
|
-
"llmContextType": "default"
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
"type": "botbuild.postback",
|
|
310
|
-
"params": {
|
|
311
|
-
"routeId": "AJzai2BXN2V41diCjMdYsZ"
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
],
|
|
315
|
-
"aiTags": [],
|
|
316
|
-
"aiTitle": null,
|
|
317
|
-
"aiGlobal": true,
|
|
318
|
-
"llmRouting": {
|
|
319
|
-
"scope": "global",
|
|
320
|
-
"classificationDescription": "user wants to talk about weather"
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
]
|
|
324
|
-
}
|
|
325
|
-
],
|
|
326
|
-
"deployedConfiguration": null,
|
|
327
|
-
"lastmod": 1779356722025,
|
|
328
|
-
"id": "development",
|
|
329
|
-
"handlerUrl": null
|
|
330
|
-
}
|