Flowise

Форк
0
/
Multi Prompt Chain.json 
499 строк · 21.8 Кб
1
{
2
    "description": "A chain that automatically picks an appropriate prompt from multiple prompts",
3
    "categories": "ChatOpenAI,Multi Prompt Chain,Langchain",
4
    "framework": "Langchain",
5
    "nodes": [
6
        {
7
            "width": 300,
8
            "height": 632,
9
            "id": "promptRetriever_0",
10
            "position": {
11
                "x": 197.46642699727397,
12
                "y": 25.945621297410923
13
            },
14
            "type": "customNode",
15
            "data": {
16
                "id": "promptRetriever_0",
17
                "label": "Prompt Retriever",
18
                "name": "promptRetriever",
19
                "version": 1,
20
                "type": "PromptRetriever",
21
                "baseClasses": ["PromptRetriever"],
22
                "category": "Retrievers",
23
                "description": "Store prompt template with name & description to be later queried by MultiPromptChain",
24
                "inputParams": [
25
                    {
26
                        "label": "Prompt Name",
27
                        "name": "name",
28
                        "type": "string",
29
                        "placeholder": "physics-qa",
30
                        "id": "promptRetriever_0-input-name-string"
31
                    },
32
                    {
33
                        "label": "Prompt Description",
34
                        "name": "description",
35
                        "type": "string",
36
                        "rows": 3,
37
                        "description": "Description of what the prompt does and when it should be used",
38
                        "placeholder": "Good for answering questions about physics",
39
                        "id": "promptRetriever_0-input-description-string"
40
                    },
41
                    {
42
                        "label": "Prompt System Message",
43
                        "name": "systemMessage",
44
                        "type": "string",
45
                        "rows": 4,
46
                        "placeholder": "You are a very smart physics professor. You are great at answering questions about physics in a concise and easy to understand manner. When you don't know the answer to a question you admit that you don't know.",
47
                        "id": "promptRetriever_0-input-systemMessage-string"
48
                    }
49
                ],
50
                "inputAnchors": [],
51
                "inputs": {
52
                    "name": "physics",
53
                    "description": "Good for answering questions about physics",
54
                    "systemMessage": "You are a very smart physics professor. You are great at answering questions about physics in a concise and easy to understand manner. When you don't know the answer to a question you admit that you don't know."
55
                },
56
                "outputAnchors": [
57
                    {
58
                        "id": "promptRetriever_0-output-promptRetriever-PromptRetriever",
59
                        "name": "promptRetriever",
60
                        "label": "PromptRetriever",
61
                        "type": "PromptRetriever"
62
                    }
63
                ],
64
                "outputs": {},
65
                "selected": false
66
            },
67
            "selected": false,
68
            "positionAbsolute": {
69
                "x": 197.46642699727397,
70
                "y": 25.945621297410923
71
            },
72
            "dragging": false
73
        },
74
        {
75
            "width": 300,
76
            "height": 280,
77
            "id": "multiPromptChain_0",
78
            "position": {
79
                "x": 1619.1305522575494,
80
                "y": 210.28103293821243
81
            },
82
            "type": "customNode",
83
            "data": {
84
                "id": "multiPromptChain_0",
85
                "label": "Multi Prompt Chain",
86
                "name": "multiPromptChain",
87
                "version": 2,
88
                "type": "MultiPromptChain",
89
                "baseClasses": ["MultiPromptChain", "MultiRouteChain", "BaseChain", "BaseLangChain"],
90
                "category": "Chains",
91
                "description": "Chain automatically picks an appropriate prompt from multiple prompt templates",
92
                "inputParams": [],
93
                "inputAnchors": [
94
                    {
95
                        "label": "Language Model",
96
                        "name": "model",
97
                        "type": "BaseLanguageModel",
98
                        "id": "multiPromptChain_0-input-model-BaseLanguageModel"
99
                    },
100
                    {
101
                        "label": "Prompt Retriever",
102
                        "name": "promptRetriever",
103
                        "type": "PromptRetriever",
104
                        "list": true,
105
                        "id": "multiPromptChain_0-input-promptRetriever-PromptRetriever"
106
                    },
107
                    {
108
                        "label": "Input Moderation",
109
                        "description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
110
                        "name": "inputModeration",
111
                        "type": "Moderation",
112
                        "optional": true,
113
                        "list": true,
114
                        "id": "multiPromptChain_0-input-inputModeration-Moderation"
115
                    }
116
                ],
117
                "inputs": {
118
                    "inputModeration": "",
119
                    "model": "{{chatOpenAI_0.data.instance}}",
120
                    "promptRetriever": [
121
                        "{{promptRetriever_0.data.instance}}",
122
                        "{{promptRetriever_2.data.instance}}",
123
                        "{{promptRetriever_1.data.instance}}"
124
                    ]
125
                },
126
                "outputAnchors": [
127
                    {
128
                        "id": "multiPromptChain_0-output-multiPromptChain-MultiPromptChain|MultiRouteChain|BaseChain|BaseLangChain",
129
                        "name": "multiPromptChain",
130
                        "label": "MultiPromptChain",
131
                        "type": "MultiPromptChain | MultiRouteChain | BaseChain | BaseLangChain"
132
                    }
133
                ],
134
                "outputs": {},
135
                "selected": false
136
            },
137
            "positionAbsolute": {
138
                "x": 1619.1305522575494,
139
                "y": 210.28103293821243
140
            },
141
            "selected": false,
142
            "dragging": false
143
        },
144
        {
145
            "width": 300,
146
            "height": 632,
147
            "id": "promptRetriever_1",
148
            "position": {
149
                "x": 539.1322780233141,
150
                "y": -250.72967142925938
151
            },
152
            "type": "customNode",
153
            "data": {
154
                "id": "promptRetriever_1",
155
                "label": "Prompt Retriever",
156
                "name": "promptRetriever",
157
                "version": 1,
158
                "type": "PromptRetriever",
159
                "baseClasses": ["PromptRetriever"],
160
                "category": "Retrievers",
161
                "description": "Store prompt template with name & description to be later queried by MultiPromptChain",
162
                "inputParams": [
163
                    {
164
                        "label": "Prompt Name",
165
                        "name": "name",
166
                        "type": "string",
167
                        "placeholder": "physics-qa",
168
                        "id": "promptRetriever_1-input-name-string"
169
                    },
170
                    {
171
                        "label": "Prompt Description",
172
                        "name": "description",
173
                        "type": "string",
174
                        "rows": 3,
175
                        "description": "Description of what the prompt does and when it should be used",
176
                        "placeholder": "Good for answering questions about physics",
177
                        "id": "promptRetriever_1-input-description-string"
178
                    },
179
                    {
180
                        "label": "Prompt System Message",
181
                        "name": "systemMessage",
182
                        "type": "string",
183
                        "rows": 4,
184
                        "placeholder": "You are a very smart physics professor. You are great at answering questions about physics in a concise and easy to understand manner. When you don't know the answer to a question you admit that you don't know.",
185
                        "id": "promptRetriever_1-input-systemMessage-string"
186
                    }
187
                ],
188
                "inputAnchors": [],
189
                "inputs": {
190
                    "name": "math",
191
                    "description": "Good for answering math questions",
192
                    "systemMessage": "You are a very good mathematician. You are great at answering math questions. You are so good because you are able to break down hard problems into their component parts, answer the component parts, and then put them together to answer the broader question."
193
                },
194
                "outputAnchors": [
195
                    {
196
                        "id": "promptRetriever_1-output-promptRetriever-PromptRetriever",
197
                        "name": "promptRetriever",
198
                        "label": "PromptRetriever",
199
                        "type": "PromptRetriever"
200
                    }
201
                ],
202
                "outputs": {},
203
                "selected": false
204
            },
205
            "selected": false,
206
            "positionAbsolute": {
207
                "x": 539.1322780233141,
208
                "y": -250.72967142925938
209
            },
210
            "dragging": false
211
        },
212
        {
213
            "width": 300,
214
            "height": 632,
215
            "id": "promptRetriever_2",
216
            "position": {
217
                "x": 872.6184534864304,
218
                "y": -366.9443140594265
219
            },
220
            "type": "customNode",
221
            "data": {
222
                "id": "promptRetriever_2",
223
                "label": "Prompt Retriever",
224
                "name": "promptRetriever",
225
                "version": 1,
226
                "type": "PromptRetriever",
227
                "baseClasses": ["PromptRetriever"],
228
                "category": "Retrievers",
229
                "description": "Store prompt template with name & description to be later queried by MultiPromptChain",
230
                "inputParams": [
231
                    {
232
                        "label": "Prompt Name",
233
                        "name": "name",
234
                        "type": "string",
235
                        "placeholder": "physics-qa",
236
                        "id": "promptRetriever_2-input-name-string"
237
                    },
238
                    {
239
                        "label": "Prompt Description",
240
                        "name": "description",
241
                        "type": "string",
242
                        "rows": 3,
243
                        "description": "Description of what the prompt does and when it should be used",
244
                        "placeholder": "Good for answering questions about physics",
245
                        "id": "promptRetriever_2-input-description-string"
246
                    },
247
                    {
248
                        "label": "Prompt System Message",
249
                        "name": "systemMessage",
250
                        "type": "string",
251
                        "rows": 4,
252
                        "placeholder": "You are a very smart physics professor. You are great at answering questions about physics in a concise and easy to understand manner. When you don't know the answer to a question you admit that you don't know.",
253
                        "id": "promptRetriever_2-input-systemMessage-string"
254
                    }
255
                ],
256
                "inputAnchors": [],
257
                "inputs": {
258
                    "name": "history",
259
                    "description": "Good for answering questions about history",
260
                    "systemMessage": "You are a very smart history professor. You are great at answering questions about history in a concise and easy to understand manner. When you don't know the answer to a question you admit that you don't know."
261
                },
262
                "outputAnchors": [
263
                    {
264
                        "id": "promptRetriever_2-output-promptRetriever-PromptRetriever",
265
                        "name": "promptRetriever",
266
                        "label": "PromptRetriever",
267
                        "type": "PromptRetriever"
268
                    }
269
                ],
270
                "outputs": {},
271
                "selected": false
272
            },
273
            "selected": false,
274
            "positionAbsolute": {
275
                "x": 872.6184534864304,
276
                "y": -366.9443140594265
277
            },
278
            "dragging": false
279
        },
280
        {
281
            "width": 300,
282
            "height": 523,
283
            "id": "chatOpenAI_0",
284
            "position": {
285
                "x": 1228.4059611466973,
286
                "y": -326.46419383157513
287
            },
288
            "type": "customNode",
289
            "data": {
290
                "id": "chatOpenAI_0",
291
                "label": "ChatOpenAI",
292
                "name": "chatOpenAI",
293
                "version": 6.0,
294
                "type": "ChatOpenAI",
295
                "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
296
                "category": "Chat Models",
297
                "description": "Wrapper around OpenAI large language models that use the Chat endpoint",
298
                "inputParams": [
299
                    {
300
                        "label": "Connect Credential",
301
                        "name": "credential",
302
                        "type": "credential",
303
                        "credentialNames": ["openAIApi"],
304
                        "id": "chatOpenAI_0-input-credential-credential"
305
                    },
306
                    {
307
                        "label": "Model Name",
308
                        "name": "modelName",
309
                        "type": "asyncOptions",
310
                        "loadMethod": "listModels",
311
                        "default": "gpt-3.5-turbo",
312
                        "id": "chatOpenAI_0-input-modelName-options"
313
                    },
314
                    {
315
                        "label": "Temperature",
316
                        "name": "temperature",
317
                        "type": "number",
318
                        "default": 0.9,
319
                        "optional": true,
320
                        "id": "chatOpenAI_0-input-temperature-number"
321
                    },
322
                    {
323
                        "label": "Max Tokens",
324
                        "name": "maxTokens",
325
                        "type": "number",
326
                        "optional": true,
327
                        "additionalParams": true,
328
                        "id": "chatOpenAI_0-input-maxTokens-number"
329
                    },
330
                    {
331
                        "label": "Top Probability",
332
                        "name": "topP",
333
                        "type": "number",
334
                        "optional": true,
335
                        "additionalParams": true,
336
                        "id": "chatOpenAI_0-input-topP-number"
337
                    },
338
                    {
339
                        "label": "Frequency Penalty",
340
                        "name": "frequencyPenalty",
341
                        "type": "number",
342
                        "optional": true,
343
                        "additionalParams": true,
344
                        "id": "chatOpenAI_0-input-frequencyPenalty-number"
345
                    },
346
                    {
347
                        "label": "Presence Penalty",
348
                        "name": "presencePenalty",
349
                        "type": "number",
350
                        "optional": true,
351
                        "additionalParams": true,
352
                        "id": "chatOpenAI_0-input-presencePenalty-number"
353
                    },
354
                    {
355
                        "label": "Timeout",
356
                        "name": "timeout",
357
                        "type": "number",
358
                        "optional": true,
359
                        "additionalParams": true,
360
                        "id": "chatOpenAI_0-input-timeout-number"
361
                    },
362
                    {
363
                        "label": "BasePath",
364
                        "name": "basepath",
365
                        "type": "string",
366
                        "optional": true,
367
                        "additionalParams": true,
368
                        "id": "chatOpenAI_0-input-basepath-string"
369
                    },
370
                    {
371
                        "label": "BaseOptions",
372
                        "name": "baseOptions",
373
                        "type": "json",
374
                        "optional": true,
375
                        "additionalParams": true,
376
                        "id": "chatOpenAI_0-input-baseOptions-json"
377
                    },
378
                    {
379
                        "label": "Allow Image Uploads",
380
                        "name": "allowImageUploads",
381
                        "type": "boolean",
382
                        "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",
383
                        "default": false,
384
                        "optional": true,
385
                        "id": "chatOpenAI_0-input-allowImageUploads-boolean"
386
                    },
387
                    {
388
                        "label": "Image Resolution",
389
                        "description": "This parameter controls the resolution in which the model views the image.",
390
                        "name": "imageResolution",
391
                        "type": "options",
392
                        "options": [
393
                            {
394
                                "label": "Low",
395
                                "name": "low"
396
                            },
397
                            {
398
                                "label": "High",
399
                                "name": "high"
400
                            },
401
                            {
402
                                "label": "Auto",
403
                                "name": "auto"
404
                            }
405
                        ],
406
                        "default": "low",
407
                        "optional": false,
408
                        "additionalParams": true,
409
                        "id": "chatOpenAI_0-input-imageResolution-options"
410
                    }
411
                ],
412
                "inputAnchors": [
413
                    {
414
                        "label": "Cache",
415
                        "name": "cache",
416
                        "type": "BaseCache",
417
                        "optional": true,
418
                        "id": "chatOpenAI_0-input-cache-BaseCache"
419
                    }
420
                ],
421
                "inputs": {
422
                    "modelName": "gpt-3.5-turbo",
423
                    "temperature": 0.9,
424
                    "maxTokens": "",
425
                    "topP": "",
426
                    "frequencyPenalty": "",
427
                    "presencePenalty": "",
428
                    "timeout": "",
429
                    "basepath": "",
430
                    "baseOptions": "",
431
                    "allowImageUploads": true,
432
                    "imageResolution": "low"
433
                },
434
                "outputAnchors": [
435
                    {
436
                        "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
437
                        "name": "chatOpenAI",
438
                        "label": "ChatOpenAI",
439
                        "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel"
440
                    }
441
                ],
442
                "outputs": {},
443
                "selected": false
444
            },
445
            "selected": false,
446
            "positionAbsolute": {
447
                "x": 1228.4059611466973,
448
                "y": -326.46419383157513
449
            },
450
            "dragging": false
451
        }
452
    ],
453
    "edges": [
454
        {
455
            "source": "promptRetriever_0",
456
            "sourceHandle": "promptRetriever_0-output-promptRetriever-PromptRetriever",
457
            "target": "multiPromptChain_0",
458
            "targetHandle": "multiPromptChain_0-input-promptRetriever-PromptRetriever",
459
            "type": "buttonedge",
460
            "id": "promptRetriever_0-promptRetriever_0-output-promptRetriever-PromptRetriever-multiPromptChain_0-multiPromptChain_0-input-promptRetriever-PromptRetriever",
461
            "data": {
462
                "label": ""
463
            }
464
        },
465
        {
466
            "source": "promptRetriever_2",
467
            "sourceHandle": "promptRetriever_2-output-promptRetriever-PromptRetriever",
468
            "target": "multiPromptChain_0",
469
            "targetHandle": "multiPromptChain_0-input-promptRetriever-PromptRetriever",
470
            "type": "buttonedge",
471
            "id": "promptRetriever_2-promptRetriever_2-output-promptRetriever-PromptRetriever-multiPromptChain_0-multiPromptChain_0-input-promptRetriever-PromptRetriever",
472
            "data": {
473
                "label": ""
474
            }
475
        },
476
        {
477
            "source": "promptRetriever_1",
478
            "sourceHandle": "promptRetriever_1-output-promptRetriever-PromptRetriever",
479
            "target": "multiPromptChain_0",
480
            "targetHandle": "multiPromptChain_0-input-promptRetriever-PromptRetriever",
481
            "type": "buttonedge",
482
            "id": "promptRetriever_1-promptRetriever_1-output-promptRetriever-PromptRetriever-multiPromptChain_0-multiPromptChain_0-input-promptRetriever-PromptRetriever",
483
            "data": {
484
                "label": ""
485
            }
486
        },
487
        {
488
            "source": "chatOpenAI_0",
489
            "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
490
            "target": "multiPromptChain_0",
491
            "targetHandle": "multiPromptChain_0-input-model-BaseLanguageModel",
492
            "type": "buttonedge",
493
            "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-multiPromptChain_0-multiPromptChain_0-input-model-BaseLanguageModel",
494
            "data": {
495
                "label": ""
496
            }
497
        }
498
    ]
499
}
500

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.