-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflowise_gpt-4-turbo Chatflow.json
560 lines (560 loc) · 21 KB
/
flowise_gpt-4-turbo Chatflow.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
{
"nodes": [
{
"id": "llmChain_0",
"position": {
"x": 76.55313591847457,
"y": -381.75777584924407
},
"type": "customNode",
"data": {
"id": "llmChain_0",
"label": "LLM Chain",
"version": 3,
"name": "llmChain",
"type": "LLMChain",
"baseClasses": [
"LLMChain",
"BaseChain",
"Runnable"
],
"category": "Chains",
"description": "Chain to run queries against LLMs",
"inputParams": [
{
"label": "Chain Name",
"name": "chainName",
"type": "string",
"placeholder": "Name Your Chain",
"optional": true,
"id": "llmChain_0-input-chainName-string"
}
],
"inputAnchors": [
{
"label": "Language Model",
"name": "model",
"type": "BaseLanguageModel",
"id": "llmChain_0-input-model-BaseLanguageModel"
},
{
"label": "Prompt",
"name": "prompt",
"type": "BasePromptTemplate",
"id": "llmChain_0-input-prompt-BasePromptTemplate"
},
{
"label": "Output Parser",
"name": "outputParser",
"type": "BaseLLMOutputParser",
"optional": true,
"id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
},
{
"label": "Input Moderation",
"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
"name": "inputModeration",
"type": "Moderation",
"optional": true,
"list": true,
"id": "llmChain_0-input-inputModeration-Moderation"
}
],
"inputs": {
"model": "{{chatOpenAI_0.data.instance}}",
"prompt": "{{chatPromptTemplate_0.data.instance}}",
"outputParser": "{{structuredOutputParser_0.data.instance}}",
"inputModeration": "",
"chainName": ""
},
"outputAnchors": [
{
"name": "output",
"label": "Output",
"type": "options",
"description": "",
"options": [
{
"id": "llmChain_0-output-llmChain-LLMChain|BaseChain|Runnable",
"name": "llmChain",
"label": "LLM Chain",
"description": "",
"type": "LLMChain | BaseChain | Runnable"
},
{
"id": "llmChain_0-output-outputPrediction-string|json",
"name": "outputPrediction",
"label": "Output Prediction",
"description": "",
"type": "string | json"
}
],
"default": "llmChain"
}
],
"outputs": {
"output": "llmChain"
},
"selected": false
},
"width": 300,
"height": 507,
"positionAbsolute": {
"x": 76.55313591847457,
"y": -381.75777584924407
},
"selected": false,
"dragging": false
},
{
"id": "chatPromptTemplate_0",
"position": {
"x": -929.2796249118419,
"y": -890.7656024407386
},
"type": "customNode",
"data": {
"id": "chatPromptTemplate_0",
"label": "Chat Prompt Template",
"version": 1,
"name": "chatPromptTemplate",
"type": "ChatPromptTemplate",
"baseClasses": [
"ChatPromptTemplate",
"BaseChatPromptTemplate",
"BasePromptTemplate",
"Runnable"
],
"category": "Prompts",
"description": "Schema to represent a chat prompt",
"inputParams": [
{
"label": "System Message",
"name": "systemMessagePrompt",
"type": "string",
"rows": 4,
"placeholder": "You are a helpful assistant that translates {input_language} to {output_language}.",
"id": "chatPromptTemplate_0-input-systemMessagePrompt-string"
},
{
"label": "Human Message",
"name": "humanMessagePrompt",
"type": "string",
"rows": 4,
"placeholder": "{text}",
"id": "chatPromptTemplate_0-input-humanMessagePrompt-string"
},
{
"label": "Format Prompt Values",
"name": "promptValues",
"type": "json",
"optional": true,
"acceptVariable": true,
"list": true,
"id": "chatPromptTemplate_0-input-promptValues-json"
}
],
"inputAnchors": [],
"inputs": {
"systemMessagePrompt": "You are {your_name} with the personality of {your_personality}. Always stay in character.\nYou are in a dungeon inside a mountain. \n\nIn order to move, you must specify \"move\" as the action. You can then set your direction and distance based on possible_directions (N, NE, S, etc.) or torwards other destinations.\n\nInteract with nearby entities based on their direction, distance, and actions. Attack enemies and heal friends or yourself using available abilities.\nA timestamp (turn) starts at 1 and increments. History includes all information. Entities with 0 or less health points are dead, and you can see their corpse.\nInteract with entities only within range. \"in_talk_range\":\"true\" means they can hear you.\nKeep speech content to 50 words and thoughts to 20 words maximum. Avoid repetition.\nTalk to nearby people if you want, ignore them, or do anything you choose.\nUse history to avoid loops in conversing or moving. Respond with answers, not questions. Be dynamic and avoid repetition including with your thoughts.\n\nYou will receive a list of possible actions, such as move, attack, heal, depending on what you are able to do. You can only use 1 action at a time.\n\nYou will not tell your allies to head cardinal directions. You will only tell them to follow you or tell them to head to a destination (e.g. the exit) or to head to an item if one is visible.\n\nIf you are not a troll then you need to exit the map in the south west part of the map, however, to get there directly is not possible, so you will need to follow the dungeon like a maze to get out. The map is 32 x 32 in size.\n\nIf you are a troll you live here.\n\nIf your ally tells you to head a direction you must ignore them and instead head torwards that entitiy because they may be behind a wall and you will end up getting further away.\n\nYou will receive json with your current location, health and other information and historical information.\n\nYou can only pick them up only if they are in range (in_range_of_pickup=true). You need to be stationary and move should be 0 distance from the item to use the pickup action.\nIf in range of an item you can pickup by specifying the \"action\" as \"pickup\" and the \"action_target\" as the item name, for example \n\n \"action\": \"pickup\",\n \"action_target\": \"berries\"\n\nWhen you pickup an item they will be shown in your inventory.",
"humanMessagePrompt": "{messages}",
"promptValues": "{\"your_name\":\"This is your name.\",\"your_personality\":\"this is your personality\",\"messages\":\"{{question}}\"}"
},
"outputAnchors": [
{
"id": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable",
"name": "chatPromptTemplate",
"label": "ChatPromptTemplate",
"description": "Schema to represent a chat prompt",
"type": "ChatPromptTemplate | BaseChatPromptTemplate | BasePromptTemplate | Runnable"
}
],
"outputs": {},
"selected": false
},
"width": 300,
"height": 688,
"selected": false,
"positionAbsolute": {
"x": -929.2796249118419,
"y": -890.7656024407386
},
"dragging": false
},
{
"id": "structuredOutputParser_0",
"position": {
"x": -581.8536675133461,
"y": -149.09421705752922
},
"type": "customNode",
"data": {
"id": "structuredOutputParser_0",
"label": "Structured Output Parser",
"version": 1,
"name": "structuredOutputParser",
"type": "StructuredOutputParser",
"baseClasses": [
"StructuredOutputParser",
"BaseLLMOutputParser",
"Runnable"
],
"category": "Output Parsers",
"description": "Parse the output of an LLM call into a given (JSON) structure.",
"inputParams": [
{
"label": "Autofix",
"name": "autofixParser",
"type": "boolean",
"optional": true,
"description": "In the event that the first call fails, will make another call to the model to fix any errors.",
"id": "structuredOutputParser_0-input-autofixParser-boolean"
},
{
"label": "JSON Structure",
"name": "jsonStructure",
"type": "datagrid",
"description": "JSON structure for LLM to return",
"datagrid": [
{
"field": "property",
"headerName": "Property",
"editable": true
},
{
"field": "type",
"headerName": "Type",
"type": "singleSelect",
"valueOptions": [
"string",
"number",
"boolean"
],
"editable": true
},
{
"field": "description",
"headerName": "Description",
"editable": true,
"flex": 1
}
],
"default": [
{
"property": "answer",
"type": "string",
"description": "answer to the user's question"
},
{
"property": "source",
"type": "string",
"description": "sources used to answer the question, should be websites"
}
],
"additionalParams": true,
"id": "structuredOutputParser_0-input-jsonStructure-datagrid"
}
],
"inputAnchors": [],
"inputs": {
"autofixParser": true,
"jsonStructure": "[{\"property\":\"thought\",\"type\":\"string\",\"description\":\"your thoughts. This should always contain content.\",\"actions\":\"\",\"id\":0},{\"property\":\"talk\",\"type\":\"string\",\"description\":\"if you wish to speak to a nearby entity then use this key.\",\"actions\":\"\",\"id\":1},{\"property\":\"direction\",\"type\":\"string\",\"description\":\"the cardinal direction to travel. You must set \\\"move\\\" as the action if you wish to move.\",\"actions\":\"\",\"id\":2},{\"property\":\"distance\",\"type\":\"number\",\"description\":\"the distance to travel in the specified direction. You must set \\\"move\\\" as the action if you wish to move.\",\"actions\":\"\",\"id\":3},{\"property\":\"action\",\"type\":\"string\",\"description\":\"the action to use.\",\"actions\":\"\",\"id\":4},{\"property\":\"action_target\",\"type\":\"string\",\"description\":\"the target entity's or items name or 0 to not use your action unless it is \\\"move\\\".\",\"actions\":\"\",\"id\":5}]"
},
"outputAnchors": [
{
"id": "structuredOutputParser_0-output-structuredOutputParser-StructuredOutputParser|BaseLLMOutputParser|Runnable",
"name": "structuredOutputParser",
"label": "StructuredOutputParser",
"description": "Parse the output of an LLM call into a given (JSON) structure.",
"type": "StructuredOutputParser | BaseLLMOutputParser | Runnable"
}
],
"outputs": {},
"selected": false
},
"width": 300,
"height": 328,
"selected": false,
"dragging": false,
"positionAbsolute": {
"x": -581.8536675133461,
"y": -149.09421705752922
}
},
{
"id": "chatOpenAI_0",
"position": {
"x": -395.6348856113725,
"y": -918.9441058524708
},
"type": "customNode",
"data": {
"id": "chatOpenAI_0",
"label": "ChatOpenAI",
"version": 5,
"name": "chatOpenAI",
"type": "ChatOpenAI",
"baseClasses": [
"ChatOpenAI",
"BaseChatModel",
"BaseLanguageModel",
"Runnable"
],
"category": "Chat Models",
"description": "Wrapper around OpenAI large language models that use the Chat endpoint",
"inputParams": [
{
"label": "Connect Credential",
"name": "credential",
"type": "credential",
"credentialNames": [
"openAIApi"
],
"id": "chatOpenAI_0-input-credential-credential"
},
{
"label": "Model Name",
"name": "modelName",
"type": "options",
"options": [
{
"label": "gpt-4",
"name": "gpt-4"
},
{
"label": "gpt-4-turbo-preview",
"name": "gpt-4-turbo-preview"
},
{
"label": "gpt-4-0125-preview",
"name": "gpt-4-0125-preview"
},
{
"label": "gpt-4-1106-preview",
"name": "gpt-4-1106-preview"
},
{
"label": "gpt-4-1106-vision-preview",
"name": "gpt-4-1106-vision-preview"
},
{
"label": "gpt-4-vision-preview",
"name": "gpt-4-vision-preview"
},
{
"label": "gpt-4-0613",
"name": "gpt-4-0613"
},
{
"label": "gpt-4-32k",
"name": "gpt-4-32k"
},
{
"label": "gpt-4-32k-0613",
"name": "gpt-4-32k-0613"
},
{
"label": "gpt-3.5-turbo",
"name": "gpt-3.5-turbo"
},
{
"label": "gpt-3.5-turbo-0125",
"name": "gpt-3.5-turbo-0125"
},
{
"label": "gpt-3.5-turbo-1106",
"name": "gpt-3.5-turbo-1106"
},
{
"label": "gpt-3.5-turbo-0613",
"name": "gpt-3.5-turbo-0613"
},
{
"label": "gpt-3.5-turbo-16k",
"name": "gpt-3.5-turbo-16k"
},
{
"label": "gpt-3.5-turbo-16k-0613",
"name": "gpt-3.5-turbo-16k-0613"
}
],
"default": "gpt-3.5-turbo",
"optional": true,
"id": "chatOpenAI_0-input-modelName-options"
},
{
"label": "Temperature",
"name": "temperature",
"type": "number",
"step": 0.1,
"default": 0.9,
"optional": true,
"id": "chatOpenAI_0-input-temperature-number"
},
{
"label": "Max Tokens",
"name": "maxTokens",
"type": "number",
"step": 1,
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-maxTokens-number"
},
{
"label": "Top Probability",
"name": "topP",
"type": "number",
"step": 0.1,
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-topP-number"
},
{
"label": "Frequency Penalty",
"name": "frequencyPenalty",
"type": "number",
"step": 0.1,
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-frequencyPenalty-number"
},
{
"label": "Presence Penalty",
"name": "presencePenalty",
"type": "number",
"step": 0.1,
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-presencePenalty-number"
},
{
"label": "Timeout",
"name": "timeout",
"type": "number",
"step": 1,
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-timeout-number"
},
{
"label": "BasePath",
"name": "basepath",
"type": "string",
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-basepath-string"
},
{
"label": "BaseOptions",
"name": "baseOptions",
"type": "json",
"optional": true,
"additionalParams": true,
"id": "chatOpenAI_0-input-baseOptions-json"
},
{
"label": "Allow Image Uploads",
"name": "allowImageUploads",
"type": "boolean",
"description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent",
"default": false,
"optional": true,
"id": "chatOpenAI_0-input-allowImageUploads-boolean"
},
{
"label": "Image Resolution",
"description": "This parameter controls the resolution in which the model views the image.",
"name": "imageResolution",
"type": "options",
"options": [
{
"label": "Low",
"name": "low"
},
{
"label": "High",
"name": "high"
},
{
"label": "Auto",
"name": "auto"
}
],
"default": "low",
"optional": false,
"additionalParams": true,
"id": "chatOpenAI_0-input-imageResolution-options"
}
],
"inputAnchors": [
{
"label": "Cache",
"name": "cache",
"type": "BaseCache",
"optional": true,
"id": "chatOpenAI_0-input-cache-BaseCache"
}
],
"inputs": {
"cache": "",
"modelName": "gpt-4-turbo-preview",
"temperature": "0.7",
"maxTokens": "",
"topP": "",
"frequencyPenalty": "",
"presencePenalty": "",
"timeout": "",
"basepath": "",
"baseOptions": "",
"allowImageUploads": "",
"imageResolution": "low"
},
"outputAnchors": [
{
"id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
"name": "chatOpenAI",
"label": "ChatOpenAI",
"description": "Wrapper around OpenAI large language models that use the Chat endpoint",
"type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable"
}
],
"outputs": {},
"selected": false
},
"width": 300,
"height": 671,
"selected": false,
"dragging": false,
"positionAbsolute": {
"x": -395.6348856113725,
"y": -918.9441058524708
}
}
],
"edges": [
{
"source": "chatPromptTemplate_0",
"sourceHandle": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable",
"target": "llmChain_0",
"targetHandle": "llmChain_0-input-prompt-BasePromptTemplate",
"type": "buttonedge",
"id": "chatPromptTemplate_0-chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable-llmChain_0-llmChain_0-input-prompt-BasePromptTemplate"
},
{
"source": "structuredOutputParser_0",
"sourceHandle": "structuredOutputParser_0-output-structuredOutputParser-StructuredOutputParser|BaseLLMOutputParser|Runnable",
"target": "llmChain_0",
"targetHandle": "llmChain_0-input-outputParser-BaseLLMOutputParser",
"type": "buttonedge",
"id": "structuredOutputParser_0-structuredOutputParser_0-output-structuredOutputParser-StructuredOutputParser|BaseLLMOutputParser|Runnable-llmChain_0-llmChain_0-input-outputParser-BaseLLMOutputParser"
},
{
"source": "chatOpenAI_0",
"sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
"target": "llmChain_0",
"targetHandle": "llmChain_0-input-model-BaseLanguageModel",
"type": "buttonedge",
"id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_0-llmChain_0-input-model-BaseLanguageModel"
}
]
}