Skip to content

Commit 937f55c

Browse files
committed
updated flow for openai streaming chat
1 parent dc2d241 commit 937f55c

File tree

2 files changed

+94
-38
lines changed

2 files changed

+94
-38
lines changed

apps/vps-web/src/main.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ if (url.pathname === '/run-flow') {
5050
const popupContainer = document.getElementById('textAreaContainer');
5151
if (!container || !popupContainer) return;
5252

53+
// with a node that contains a button below the editor in the node-type, the new grid css setup
54+
// ... this works when going to fullscreen but not when going back to normal size
5355
const resizeObserver = new ResizeObserver((_entries) => {
5456
console.log('resizeObserver');
5557
if (editorInstance) {
@@ -78,6 +80,7 @@ if (url.pathname === '/run-flow') {
7880
scrollbar: {
7981
alwaysConsumeMouseWheel: false,
8082
},
83+
//automaticLayout: true, // this doesn't work for this use-case !??
8184
});
8285
if (editor) {
8386
editorInstance = editor;

examples-test-flows/openai-fetch-completion-as-stream.json

Lines changed: 91 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
},
2626
{
2727
"id": "3cf44538-9913-4aa2-aade-a7c619910f45",
28-
"x": 2870.2376315349347,
29-
"y": 1063.2936853877577,
28+
"x": 2883.462127419976,
29+
"y": 1083.5811430954288,
3030
"width": 178.5078125,
3131
"height": 80,
3232
"nodeType": "Shape",
@@ -38,16 +38,15 @@
3838
"nodeCannotBeReplaced": true,
3939
"showFormOnlyInPopup": true,
4040
"useInCompositionOnly": false,
41-
"keepPopupOpenAfterUpdate": true,
42-
"isRunOnStart": true
41+
"keepPopupOpenAfterUpdate": true
4342
}
4443
},
4544
{
4645
"id": "d186a002-218b-47dc-aae8-07522a3da6ed",
4746
"x": 4086.27967757153,
4847
"y": 1055.5510998151515,
49-
"width": 119.99999053099201,
50-
"height": 272.00005831671666,
48+
"width": 119.99977460681525,
49+
"height": 55.99991833813306,
5150
"nodeType": "Shape",
5251
"nodeInfo": {
5352
"type": "show-input",
@@ -63,8 +62,8 @@
6362
"id": "383eb9cf-3b45-489e-8281-720b702b9159",
6463
"x": 3302.6185234344857,
6564
"y": 529.4952359949934,
66-
"width": 240.0001805114876,
67-
"height": 216.00002284568635,
65+
"width": 119.99977460681525,
66+
"height": 107.9999853190879,
6867
"nodeType": "Shape",
6968
"nodeInfo": {
7069
"type": "scope-variable",
@@ -82,8 +81,8 @@
8281
},
8382
{
8483
"id": "4ffd9779-4d78-4122-9619-ee6dcf7ee81d",
85-
"x": 5421.5451389834425,
86-
"y": 1038.4911316966602,
84+
"x": 5421.544846596196,
85+
"y": 1038.491072178194,
8786
"width": 280,
8887
"height": 40,
8988
"nodeType": "Shape",
@@ -165,8 +164,8 @@
165164
},
166165
{
167166
"id": "2a227359-4016-4fa7-9788-948030bc0e90",
168-
"x": 3287.9477754176096,
169-
"y": 1054.0469817505104,
167+
"x": 3287.94780194177,
168+
"y": 1054.0470007342954,
170169
"width": 200,
171170
"height": 128,
172171
"nodeType": "Shape",
@@ -203,8 +202,8 @@
203202
"id": "b936e1cd-134c-4476-b412-342c7d89c762",
204203
"x": 5118.75836670038,
205204
"y": 1435.0647024699165,
206-
"width": 119.99999053099201,
207-
"height": 223.9999424346177,
205+
"width": 119.99977460681525,
206+
"height": 55.9998007300367,
208207
"nodeType": "Shape",
209208
"nodeInfo": {
210209
"type": "show-input",
@@ -236,8 +235,8 @@
236235
},
237236
{
238237
"id": "6631fbab-1a06-4f8e-9abc-ee8ac2c3f923",
239-
"x": 2243.6771759113494,
240-
"y": 1047.0934728314523,
238+
"x": 2179.535686485716,
239+
"y": 1037.511744316569,
241240
"width": 434.54733649065247,
242241
"height": 185.8378093625031,
243242
"nodeType": "Shape",
@@ -254,19 +253,43 @@
254253
}
255254
},
256255
{
257-
"id": "1a35b609-3594-4529-bec1-2b50b205aa0d",
258-
"x": 2870.2376315349347,
259-
"y": 1103.2936853877577,
260-
"endX": 3287.9477754176096,
261-
"endY": 1118.0469817505104,
262-
"startNodeId": "3cf44538-9913-4aa2-aade-a7c619910f45",
263-
"endNodeId": "2a227359-4016-4fa7-9788-948030bc0e90",
264-
"startThumbName": "input",
265-
"endThumbName": "input",
266-
"lineType": "BezierCubic",
267-
"nodeType": "Connection",
268-
"layer": 1,
269-
"nodeInfo": {}
256+
"id": "6e164a19-962b-412d-ad81-8505dcc24783",
257+
"x": 3755.8355767022904,
258+
"y": 557.7102718926435,
259+
"width": 119.99977460681525,
260+
"height": 107.9999853190879,
261+
"nodeType": "Shape",
262+
"nodeInfo": {
263+
"type": "scope-variable",
264+
"formValues": {
265+
"variableName": "chat",
266+
"initialValue": "",
267+
"fieldType": "array",
268+
"fieldValueType": "string",
269+
"enumValues": [],
270+
"initialEnumValue": ""
271+
},
272+
"isVariable": true,
273+
"nodeCannotBeReplaced": true
274+
}
275+
},
276+
{
277+
"id": "ae25e02d-93e6-41da-a3e4-8fceca2276ce",
278+
"x": 5320.673441453338,
279+
"y": 1441.1633290252423,
280+
"width": 280,
281+
"height": 40,
282+
"nodeType": "Shape",
283+
"nodeInfo": {
284+
"type": "push-value-to-array-variable",
285+
"formValues": {
286+
"variableName": "chat"
287+
},
288+
"nodeCannotBeReplaced": false,
289+
"showFormOnlyInPopup": true,
290+
"useInCompositionOnly": false,
291+
"keepPopupOpenAfterUpdate": false
292+
}
270293
},
271294
{
272295
"id": "a16c5c54-c867-41af-a922-9a014786c513",
@@ -285,7 +308,7 @@
285308
},
286309
{
287310
"id": "9c9efadf-8473-439f-849b-1fa8cbc09ad5",
288-
"x": 4206.279668102522,
311+
"x": 4206.279452178345,
289312
"y": 1085.5510998151515,
290313
"endX": 4363.497086195699,
291314
"endY": 1116.0164055112382,
@@ -302,8 +325,8 @@
302325
"id": "782908ad-a7fc-4086-b2d0-8491bb9bafa9",
303326
"x": 5161.2547235002,
304327
"y": 1039.0147977761594,
305-
"endX": 5421.5451389834425,
306-
"endY": 1058.4911316966602,
328+
"endX": 5421.544846596196,
329+
"endY": 1058.491072178194,
307330
"startNodeId": "24b43a64-3ba7-4c90-af25-de0da725600b",
308331
"endNodeId": "4ffd9779-4d78-4122-9619-ee6dcf7ee81d",
309332
"startThumbName": "output",
@@ -345,8 +368,8 @@
345368
},
346369
{
347370
"id": "b58697e4-82bf-4d83-917a-03be6daedc12",
348-
"x": 3487.9477754176096,
349-
"y": 1118.0469817505104,
371+
"x": 3487.94780194177,
372+
"y": 1118.0470007342954,
350373
"endX": 3705.3356695038824,
351374
"endY": 1156.5469817505104,
352375
"startNodeId": "2a227359-4016-4fa7-9788-948030bc0e90",
@@ -405,10 +428,10 @@
405428
},
406429
{
407430
"id": "3601f5bf-09f9-401d-b7de-28d1be639fb5",
408-
"x": 2678.224512402002,
409-
"y": 1126.0934728314523,
410-
"endX": 2870.2376315349347,
411-
"endY": 1103.2936853877577,
431+
"x": 2614.0830229763683,
432+
"y": 1116.511744316569,
433+
"endX": 2883.462127419976,
434+
"endY": 1123.5811430954288,
412435
"startNodeId": "6631fbab-1a06-4f8e-9abc-ee8ac2c3f923",
413436
"endNodeId": "3cf44538-9913-4aa2-aade-a7c619910f45",
414437
"startThumbName": "output",
@@ -417,6 +440,36 @@
417440
"nodeType": "Connection",
418441
"layer": 1,
419442
"nodeInfo": {}
443+
},
444+
{
445+
"id": "993273ac-60cc-4c0b-9f50-31b62d6ec3f0",
446+
"x": 3061.969939919976,
447+
"y": 1123.5811430954288,
448+
"endX": 3287.94780194177,
449+
"endY": 1118.0470007342954,
450+
"startNodeId": "3cf44538-9913-4aa2-aade-a7c619910f45",
451+
"endNodeId": "2a227359-4016-4fa7-9788-948030bc0e90",
452+
"startThumbName": "output",
453+
"endThumbName": "input",
454+
"lineType": "BezierCubic",
455+
"nodeType": "Connection",
456+
"layer": 1,
457+
"nodeInfo": {}
458+
},
459+
{
460+
"id": "7619188f-269f-46a1-b144-d641b411a547",
461+
"x": 5238.758141307196,
462+
"y": 1465.0647024699165,
463+
"endX": 5320.673441453338,
464+
"endY": 1461.1633290252423,
465+
"startNodeId": "b936e1cd-134c-4476-b412-342c7d89c762",
466+
"endNodeId": "ae25e02d-93e6-41da-a3e4-8fceca2276ce",
467+
"startThumbName": "output",
468+
"endThumbName": "value",
469+
"lineType": "BezierCubic",
470+
"nodeType": "Connection",
471+
"layer": 1,
472+
"nodeInfo": {}
420473
}
421474
]
422475
}

0 commit comments

Comments
 (0)