Skip to content

Commit d39c386

Browse files
committed
auto scroll content in openai chat flow
1 parent e8f7eaa commit d39c386

File tree

1 file changed

+103
-107
lines changed

1 file changed

+103
-107
lines changed

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

Lines changed: 103 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
"id": "d186a002-218b-47dc-aae8-07522a3da6ed",
4747
"x": 4483.009756940378,
4848
"y": 1009.3019209291535,
49-
"width": 119.99990849367349,
50-
"height": 272.0000176044985,
49+
"width": 120.00012334690193,
50+
"height": 272.0000558397062,
5151
"nodeType": "Shape",
5252
"nodeInfo": {
5353
"type": "show-input",
@@ -63,8 +63,8 @@
6363
"id": "383eb9cf-3b45-489e-8281-720b702b9159",
6464
"x": 3302.6184447265578,
6565
"y": 528.2644630083273,
66-
"width": 136.67209739727394,
67-
"height": 300.00000401229266,
66+
"width": 136.67199921373413,
67+
"height": 299.99996414170886,
6868
"nodeType": "Shape",
6969
"nodeInfo": {
7070
"type": "scope-variable",
@@ -187,8 +187,8 @@
187187
"id": "b936e1cd-134c-4476-b412-342c7d89c762",
188188
"x": 5386.760673284272,
189189
"y": 1453.0422559463495,
190-
"width": 119.99990849367349,
191-
"height": 271.99997880814703,
190+
"width": 120.00012334690193,
191+
"height": 271.99996978331967,
192192
"nodeType": "Shape",
193193
"nodeInfo": {
194194
"type": "show-input",
@@ -241,8 +241,8 @@
241241
"id": "6e164a19-962b-412d-ad81-8505dcc24783",
242242
"x": 3731.953338189688,
243243
"y": 523.6128115645795,
244-
"width": 136.67178702646203,
245-
"height": 419.9999900986691,
244+
"width": 136.67199921373413,
245+
"height": 371.99998651601817,
246246
"nodeType": "Shape",
247247
"nodeInfo": {
248248
"type": "scope-variable",
@@ -471,8 +471,8 @@
471471
"id": "597efff5-91e1-40f2-bd4d-993567abb93a",
472472
"x": 4136.59680841861,
473473
"y": 526.2205686983754,
474-
"width": 120.31233953946541,
475-
"height": 107.99998883824934,
474+
"width": 120.31239132581437,
475+
"height": 107.99999941694148,
476476
"nodeType": "Shape",
477477
"nodeInfo": {
478478
"type": "scope-variable",
@@ -636,8 +636,8 @@
636636
},
637637
{
638638
"id": "deaded83-0638-4fde-b865-171bd0f79e26",
639-
"x": 7138.222920196529,
640-
"y": 1518.8828241176188,
639+
"x": 7142.740778457433,
640+
"y": 1527.918438413395,
641641
"width": 280,
642642
"height": 40,
643643
"nodeType": "Shape",
@@ -709,8 +709,8 @@
709709
"id": "f02b98f8-d7be-40ec-82da-0fcaddda5663",
710710
"x": 6021.817071637092,
711711
"y": 2275.116037678438,
712-
"width": 119.99990849367349,
713-
"height": 271.99997880814703,
712+
"width": 119.99977912135599,
713+
"height": 272.00014189609266,
714714
"nodeType": "Shape",
715715
"nodeInfo": {
716716
"type": "show-input",
@@ -724,15 +724,86 @@
724724
},
725725
{
726726
"id": "2ac953f1-dc37-41c9-a4be-ab85339ad5bc",
727-
"x": 6433.094898272377,
728-
"y": 2108.0181318174277,
727+
"x": 6433.0931872881165,
728+
"y": 2110.0356338343695,
729729
"width": 400,
730730
"height": 400,
731731
"nodeType": "Shape",
732732
"nodeInfo": {
733733
"type": "iframe-html-node",
734734
"formValues": {
735-
"html": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>Plot visualization</title>\n <script src=\"https://cdn.tailwindcss.com\"></script>\n <script src=\"https://unpkg.com/showdown/dist/showdown.min.js\"></script>\n <style>\n .wrapper {\n \n }\n </style>\n </head>\n <body class=\"bg-white w-full\">\n <div class=\"min-h-screen w-full flex wrapper\" id=\"inner\">\n <div\n id=\"message-container\"\n class=\"grid w-full p-8\" \n ></div>\n </div>\n\n <script>\n // Initialize the global variable \"input\"\n window.input = window.input;\n let inputstream = [];\n let initialized = false;\n let elements = [];\n\n let messageContainer = document.getElementById('message-container');\n // Function to rerender the UI\n function rerenderUI() {\n if (!initialized && window['createElement']) {\n initialized = true;\n }\n let documentFragment = document.createDocumentFragment();\n let messages = [];\n if (window.input !== undefined) {\n if (Array.isArray(window.input)) {\n \n window.input.forEach((message, index) => {\n \n \n let divElement = document.createElement(\n \n 'div',\n {class:\"\"}\n );\n \n const converter = new showdown.Converter(); \n const html = converter.makeHtml(message.message);\n\n divElement.innerHTML = `<div class=\"font-bold border-b-2 border-black py-1 my-2\">${message.role}</div>\n <div>${html}\n </div>`\n \n documentFragment.appendChild(divElement);\n \n });\n }\n }\n messageContainer.replaceChildren(documentFragment);\n }\n\n // Attach the rerenderUI function to the global onExecute method\n window.onExecute = rerenderUI;\n\n rerenderUI();\n </script>\n </body>\n</html>\n",
735+
"html": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>Plot visualization</title>\n <script src=\"https://cdn.tailwindcss.com\"></script>\n <script src=\"https://unpkg.com/showdown/dist/showdown.min.js\"></script>\n <style>\n .wrapper {\n \n }\n </style>\n </head>\n <body class=\"bg-white w-full\">\n <div class=\"min-h-screen w-full flex wrapper\" id=\"inner\">\n <div\n id=\"message-container\"\n class=\"grid w-full p-8\" \n ></div>\n </div>\n\n <script>\n // Initialize the global variable \"input\"\n window.input = window.input;\n let inputstream = [];\n let initialized = false;\n let elements = [];\n\n let messageContainer = document.getElementById('message-container');\n // Function to rerender the UI\n function rerenderUI() {\n if (!initialized && window['createElement']) {\n initialized = true;\n }\n let documentFragment = document.createDocumentFragment();\n let messages = [];\n if (window.input !== undefined) {\n if (Array.isArray(window.input)) {\n \n window.input.forEach((message, index) => {\n \n \n let divElement = document.createElement(\n \n 'div',\n {class:\"\"}\n );\n \n const converter = new showdown.Converter(); \n const html = converter.makeHtml(message.message);\n\n divElement.innerHTML = `<div class=\"font-bold border-b-2 border-black py-1 my-2\">${message.role}</div>\n <div>${html}\n </div>`\n \n documentFragment.appendChild(divElement);\n \n \n });\n }\n }\n messageContainer.replaceChildren(documentFragment);\n window.scrollTo(0, document.body.scrollHeight);\n }\n\n // Attach the rerenderUI function to the global onExecute method\n window.onExecute = rerenderUI;\n\n rerenderUI();\n </script>\n </body>\n</html>\n",
736+
"aiprompt": ""
737+
},
738+
"showFormOnlyInPopup": true,
739+
"initializeOnStartFlow": true
740+
}
741+
},
742+
{
743+
"id": "bb043590-a5fc-4f4c-95e9-f89cb73dbeb5",
744+
"x": 6764.885773263479,
745+
"y": 798.0597305272516,
746+
"width": 200,
747+
"height": 64,
748+
"nodeType": "Shape",
749+
"nodeInfo": {
750+
"type": "get-array",
751+
"formValues": {
752+
"variableName": "result"
753+
},
754+
"nodeCannotBeReplaced": false,
755+
"showFormOnlyInPopup": true,
756+
"useInCompositionOnly": false,
757+
"keepPopupOpenAfterUpdate": false
758+
}
759+
},
760+
{
761+
"id": "65149c21-fa2c-4c60-b3ec-d0c4c8b3485a",
762+
"x": 7149.0825680873195,
763+
"y": 763.5156525527909,
764+
"width": 200,
765+
"height": 128,
766+
"nodeType": "Shape",
767+
"nodeInfo": {
768+
"type": "join-array",
769+
"formValues": {
770+
"joinChar": ""
771+
},
772+
"nodeCannotBeReplaced": false,
773+
"showFormOnlyInPopup": false,
774+
"useInCompositionOnly": false,
775+
"keepPopupOpenAfterUpdate": false
776+
}
777+
},
778+
{
779+
"id": "bbd6ebe9-c403-4807-aea4-dd0bc2169dbf",
780+
"x": 4966.026555483235,
781+
"y": 1714.0005949014421,
782+
"width": 200,
783+
"height": 128,
784+
"nodeType": "Shape",
785+
"nodeInfo": {
786+
"type": "join-array",
787+
"formValues": {
788+
"joinChar": ""
789+
},
790+
"nodeCannotBeReplaced": false,
791+
"showFormOnlyInPopup": false,
792+
"useInCompositionOnly": false,
793+
"keepPopupOpenAfterUpdate": false
794+
}
795+
},
796+
{
797+
"id": "c68ce9ef-1673-4edc-8d1c-4ade51e9ddff",
798+
"x": 7609.236662441795,
799+
"y": 701.5370560517476,
800+
"width": 590.4003603474912,
801+
"height": 264.55549062774435,
802+
"nodeType": "Shape",
803+
"nodeInfo": {
804+
"type": "iframe-html-node",
805+
"formValues": {
806+
"html": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>Plot visualization</title>\n <script src=\"https://cdn.tailwindcss.com\"></script>\n <script src=\"https://unpkg.com/showdown/dist/showdown.min.js\"></script>\n <style>\n .wrapper {\n \n }\n </style>\n </head>\n <body class=\"bg-white w-full\">\n <div class=\"min-h-screen w-full flex wrapper\" id=\"inner\">\n <div\n id=\"message-container\"\n class=\"grid w-full p-8\" \n ></div>\n </div>\n\n <script>\n // Initialize the global variable \"input\"\n window.input = window.input;\n let inputstream = [];\n let initialized = false;\n let elements = [];\n\n let messageContainer = document.getElementById('message-container');\n // Function to rerender the UI\n function rerenderUI() {\n if (!initialized && window['createElement']) {\n initialized = true;\n }\n let documentFragment = document.createDocumentFragment();\n let messages = [];\n if (window.input !== undefined) {\n let divElement = document.createElement(\n \n 'div',\n {class:\"\"}\n );\n \n const converter = new showdown.Converter(); \n const html = converter.makeHtml(window.input);\n\n divElement.innerHTML = `<div>${html}</div>`;\n \n documentFragment.appendChild(divElement);\n }\n messageContainer.replaceChildren(documentFragment);\n window.scrollTo(0, document.body.scrollHeight);\n }\n\n // Attach the rerenderUI function to the global onExecute method\n window.onExecute = rerenderUI;\n\n rerenderUI();\n </script>\n </body>\n</html>\n",
736807
"aiprompt": ""
737808
},
738809
"showFormOnlyInPopup": true,
@@ -756,7 +827,7 @@
756827
},
757828
{
758829
"id": "9c9efadf-8473-439f-849b-1fa8cbc09ad5",
759-
"x": 4603.009665434051,
830+
"x": 4603.00988028728,
760831
"y": 1039.3019209291535,
761832
"endX": 4808.82988279589,
762833
"endY": 1032.15973144007,
@@ -861,7 +932,7 @@
861932
},
862933
{
863934
"id": "7619188f-269f-46a1-b144-d641b411a547",
864-
"x": 5506.760581777946,
935+
"x": 5506.760796631174,
865936
"y": 1483.0422559463495,
866937
"endX": 5725.337982593981,
867938
"endY": 1685.1782664011737,
@@ -1103,8 +1174,8 @@
11031174
"id": "3241be19-3f51-417b-b11f-b1fbc619575c",
11041175
"x": 6957.954090347076,
11051176
"y": 1536.8649389031089,
1106-
"endX": 7138.222920196529,
1107-
"endY": 1538.8828241176188,
1177+
"endX": 7142.740778457433,
1178+
"endY": 1547.918438413395,
11081179
"startNodeId": "9a8f4b17-6cd4-4b9f-92f5-d363c59835b0",
11091180
"endNodeId": "deaded83-0638-4fde-b865-171bd0f79e26",
11101181
"startThumbName": "output",
@@ -1161,10 +1232,10 @@
11611232
},
11621233
{
11631234
"id": "aa63fd0c-c4ee-46b8-abd4-d6d2d6c142c2",
1164-
"x": 6141.816980130766,
1235+
"x": 6141.816850758449,
11651236
"y": 2305.116037678438,
1166-
"endX": 6433.094898272377,
1167-
"endY": 2308.0181318174277,
1237+
"endX": 6433.0931872881165,
1238+
"endY": 2310.0356338343695,
11681239
"startNodeId": "f02b98f8-d7be-40ec-82da-0fcaddda5663",
11691240
"endNodeId": "2ac953f1-dc37-41c9-a4be-ab85339ad5bc",
11701241
"startThumbName": "output",
@@ -1174,50 +1245,12 @@
11741245
"layer": 1,
11751246
"nodeInfo": {}
11761247
},
1177-
{
1178-
"id": "bb043590-a5fc-4f4c-95e9-f89cb73dbeb5",
1179-
"x": 6764.885773263479,
1180-
"y": 798.0597305272516,
1181-
"width": 200.00029088708501,
1182-
"height": 63.99998485767688,
1183-
"nodeType": "Shape",
1184-
"nodeInfo": {
1185-
"type": "get-array",
1186-
"formValues": {
1187-
"variableName": "result"
1188-
},
1189-
"nodeCannotBeReplaced": false,
1190-
"showFormOnlyInPopup": true,
1191-
"useInCompositionOnly": false,
1192-
"keepPopupOpenAfterUpdate": false,
1193-
"taskType": "get-array"
1194-
}
1195-
},
1196-
{
1197-
"id": "65149c21-fa2c-4c60-b3ec-d0c4c8b3485a",
1198-
"x": 7149.0825680873195,
1199-
"y": 763.5156525527909,
1200-
"width": 200.00043905494857,
1201-
"height": 128.00003359234788,
1202-
"nodeType": "Shape",
1203-
"nodeInfo": {
1204-
"type": "join-array",
1205-
"formValues": {
1206-
"joinChar": ""
1207-
},
1208-
"nodeCannotBeReplaced": false,
1209-
"showFormOnlyInPopup": false,
1210-
"useInCompositionOnly": false,
1211-
"keepPopupOpenAfterUpdate": false,
1212-
"taskType": "join-array"
1213-
}
1214-
},
12151248
{
12161249
"id": "db7f5391-4ec1-4b12-83cd-8413c081b28e",
12171250
"x": 6597.654836589958,
12181251
"y": 837.4755269345331,
12191252
"endX": 6764.885773263479,
1220-
"endY": 830.0597229560901,
1253+
"endY": 830.0597305272516,
12211254
"startNodeId": "4ffd9779-4d78-4122-9619-ee6dcf7ee81d",
12221255
"endNodeId": "bb043590-a5fc-4f4c-95e9-f89cb73dbeb5",
12231256
"startThumbName": "output",
@@ -1229,10 +1262,10 @@
12291262
},
12301263
{
12311264
"id": "d628b79e-f0fc-4dd2-a35b-807277439408",
1232-
"x": 6964.8860641505635,
1233-
"y": 830.0597229560901,
1265+
"x": 6964.885773263479,
1266+
"y": 830.0597305272516,
12341267
"endX": 7149.0825680873195,
1235-
"endY": 827.5156693489648,
1268+
"endY": 827.5156525527909,
12361269
"startNodeId": "bb043590-a5fc-4f4c-95e9-f89cb73dbeb5",
12371270
"endNodeId": "65149c21-fa2c-4c60-b3ec-d0c4c8b3485a",
12381271
"startThumbName": "output",
@@ -1242,49 +1275,12 @@
12421275
"layer": 1,
12431276
"nodeInfo": {}
12441277
},
1245-
{
1246-
"id": "bbd6ebe9-c403-4807-aea4-dd0bc2169dbf",
1247-
"x": 4966.026555483235,
1248-
"y": 1714.0005949014421,
1249-
"width": 199.99997075821278,
1250-
"height": 128.0000233726445,
1251-
"nodeType": "Shape",
1252-
"nodeInfo": {
1253-
"type": "join-array",
1254-
"formValues": {
1255-
"joinChar": ""
1256-
},
1257-
"nodeCannotBeReplaced": false,
1258-
"showFormOnlyInPopup": false,
1259-
"useInCompositionOnly": false,
1260-
"keepPopupOpenAfterUpdate": false,
1261-
"taskType": "join-array"
1262-
}
1263-
},
1264-
{
1265-
"id": "c68ce9ef-1673-4edc-8d1c-4ade51e9ddff",
1266-
"x": 7593.264901209055,
1267-
"y": 629.2702750663578,
1268-
"width": 400,
1269-
"height": 400,
1270-
"nodeType": "Shape",
1271-
"nodeInfo": {
1272-
"type": "iframe-html-node",
1273-
"formValues": {
1274-
"html": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>Plot visualization</title>\n <script src=\"https://cdn.tailwindcss.com\"></script>\n <script src=\"https://unpkg.com/showdown/dist/showdown.min.js\"></script>\n <style>\n .wrapper {\n \n }\n </style>\n </head>\n <body class=\"bg-white w-full\">\n <div class=\"min-h-screen w-full flex wrapper\" id=\"inner\">\n <div\n id=\"message-container\"\n class=\"grid w-full p-8\" \n ></div>\n </div>\n\n <script>\n // Initialize the global variable \"input\"\n window.input = window.input;\n let inputstream = [];\n let initialized = false;\n let elements = [];\n\n let messageContainer = document.getElementById('message-container');\n // Function to rerender the UI\n function rerenderUI() {\n if (!initialized && window['createElement']) {\n initialized = true;\n }\n let documentFragment = document.createDocumentFragment();\n let messages = [];\n if (window.input !== undefined) {\n let divElement = document.createElement(\n \n 'div',\n {class:\"\"}\n );\n \n const converter = new showdown.Converter(); \n const html = converter.makeHtml(window.input);\n\n divElement.innerHTML = `<div>${html}</div>`;\n \n documentFragment.appendChild(divElement);\n }\n messageContainer.replaceChildren(documentFragment);\n }\n\n // Attach the rerenderUI function to the global onExecute method\n window.onExecute = rerenderUI;\n\n rerenderUI();\n </script>\n </body>\n</html>\n",
1275-
"aiprompt": ""
1276-
},
1277-
"showFormOnlyInPopup": true,
1278-
"initializeOnStartFlow": true,
1279-
"taskType": "iframe-html-node"
1280-
}
1281-
},
12821278
{
12831279
"id": "52470d44-2037-44f9-ba81-6cd7014e7567",
1284-
"x": 7349.083007142268,
1285-
"y": 827.5156693489648,
1286-
"endX": 7593.264901209055,
1287-
"endY": 829.2702750663578,
1280+
"x": 7349.0825680873195,
1281+
"y": 827.5156525527909,
1282+
"endX": 7609.236662441795,
1283+
"endY": 833.8148013656198,
12881284
"startNodeId": "65149c21-fa2c-4c60-b3ec-d0c4c8b3485a",
12891285
"endNodeId": "c68ce9ef-1673-4edc-8d1c-4ade51e9ddff",
12901286
"startThumbName": "output",

0 commit comments

Comments
 (0)