Flowise

Форк
0
/
Structured Output Parser.json 
491 строка · 20.7 Кб
1
{
2
    "description": "Return response as a specified JSON structure instead of a string/text",
3
    "categories": "Structured Output Parser,ChatOpenAI,LLM Chain,Langchain",
4
    "framework": "Langchain",
5
    "badge": "NEW",
6
    "nodes": [
7
        {
8
            "width": 300,
9
            "height": 574,
10
            "id": "chatOpenAI_0",
11
            "position": {
12
                "x": 845.3961479115309,
13
                "y": -205.74401580699953
14
            },
15
            "type": "customNode",
16
            "data": {
17
                "id": "chatOpenAI_0",
18
                "label": "ChatOpenAI",
19
                "version": 6.0,
20
                "name": "chatOpenAI",
21
                "type": "ChatOpenAI",
22
                "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
23
                "category": "Chat Models",
24
                "description": "Wrapper around OpenAI large language models that use the Chat endpoint",
25
                "inputParams": [
26
                    {
27
                        "label": "Connect Credential",
28
                        "name": "credential",
29
                        "type": "credential",
30
                        "credentialNames": ["openAIApi"],
31
                        "id": "chatOpenAI_0-input-credential-credential"
32
                    },
33
                    {
34
                        "label": "Model Name",
35
                        "name": "modelName",
36
                        "type": "asyncOptions",
37
                        "loadMethod": "listModels",
38
                        "default": "gpt-3.5-turbo",
39
                        "id": "chatOpenAI_0-input-modelName-options"
40
                    },
41
                    {
42
                        "label": "Temperature",
43
                        "name": "temperature",
44
                        "type": "number",
45
                        "step": 0.1,
46
                        "default": 0.9,
47
                        "optional": true,
48
                        "id": "chatOpenAI_0-input-temperature-number"
49
                    },
50
                    {
51
                        "label": "Max Tokens",
52
                        "name": "maxTokens",
53
                        "type": "number",
54
                        "step": 1,
55
                        "optional": true,
56
                        "additionalParams": true,
57
                        "id": "chatOpenAI_0-input-maxTokens-number"
58
                    },
59
                    {
60
                        "label": "Top Probability",
61
                        "name": "topP",
62
                        "type": "number",
63
                        "step": 0.1,
64
                        "optional": true,
65
                        "additionalParams": true,
66
                        "id": "chatOpenAI_0-input-topP-number"
67
                    },
68
                    {
69
                        "label": "Frequency Penalty",
70
                        "name": "frequencyPenalty",
71
                        "type": "number",
72
                        "step": 0.1,
73
                        "optional": true,
74
                        "additionalParams": true,
75
                        "id": "chatOpenAI_0-input-frequencyPenalty-number"
76
                    },
77
                    {
78
                        "label": "Presence Penalty",
79
                        "name": "presencePenalty",
80
                        "type": "number",
81
                        "step": 0.1,
82
                        "optional": true,
83
                        "additionalParams": true,
84
                        "id": "chatOpenAI_0-input-presencePenalty-number"
85
                    },
86
                    {
87
                        "label": "Timeout",
88
                        "name": "timeout",
89
                        "type": "number",
90
                        "step": 1,
91
                        "optional": true,
92
                        "additionalParams": true,
93
                        "id": "chatOpenAI_0-input-timeout-number"
94
                    },
95
                    {
96
                        "label": "BasePath",
97
                        "name": "basepath",
98
                        "type": "string",
99
                        "optional": true,
100
                        "additionalParams": true,
101
                        "id": "chatOpenAI_0-input-basepath-string"
102
                    },
103
                    {
104
                        "label": "BaseOptions",
105
                        "name": "baseOptions",
106
                        "type": "json",
107
                        "optional": true,
108
                        "additionalParams": true,
109
                        "id": "chatOpenAI_0-input-baseOptions-json"
110
                    },
111
                    {
112
                        "label": "Allow Image Uploads",
113
                        "name": "allowImageUploads",
114
                        "type": "boolean",
115
                        "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",
116
                        "default": false,
117
                        "optional": true,
118
                        "id": "chatOpenAI_0-input-allowImageUploads-boolean"
119
                    },
120
                    {
121
                        "label": "Image Resolution",
122
                        "description": "This parameter controls the resolution in which the model views the image.",
123
                        "name": "imageResolution",
124
                        "type": "options",
125
                        "options": [
126
                            {
127
                                "label": "Low",
128
                                "name": "low"
129
                            },
130
                            {
131
                                "label": "High",
132
                                "name": "high"
133
                            },
134
                            {
135
                                "label": "Auto",
136
                                "name": "auto"
137
                            }
138
                        ],
139
                        "default": "low",
140
                        "optional": false,
141
                        "additionalParams": true,
142
                        "id": "chatOpenAI_0-input-imageResolution-options"
143
                    }
144
                ],
145
                "inputAnchors": [
146
                    {
147
                        "label": "Cache",
148
                        "name": "cache",
149
                        "type": "BaseCache",
150
                        "optional": true,
151
                        "id": "chatOpenAI_0-input-cache-BaseCache"
152
                    }
153
                ],
154
                "inputs": {
155
                    "cache": "",
156
                    "modelName": "gpt-3.5-turbo",
157
                    "temperature": "0",
158
                    "maxTokens": "",
159
                    "topP": "",
160
                    "frequencyPenalty": "",
161
                    "presencePenalty": "",
162
                    "timeout": "",
163
                    "basepath": "",
164
                    "baseOptions": "",
165
                    "allowImageUploads": true,
166
                    "imageResolution": "low"
167
                },
168
                "outputAnchors": [
169
                    {
170
                        "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
171
                        "name": "chatOpenAI",
172
                        "label": "ChatOpenAI",
173
                        "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable"
174
                    }
175
                ],
176
                "outputs": {},
177
                "selected": false
178
            },
179
            "selected": false,
180
            "positionAbsolute": {
181
                "x": 845.3961479115309,
182
                "y": -205.74401580699953
183
            },
184
            "dragging": false
185
        },
186
        {
187
            "width": 300,
188
            "height": 456,
189
            "id": "llmChain_0",
190
            "position": {
191
                "x": 1229.1699649849293,
192
                "y": 245.55173505632646
193
            },
194
            "type": "customNode",
195
            "data": {
196
                "id": "llmChain_0",
197
                "label": "LLM Chain",
198
                "version": 3,
199
                "name": "llmChain",
200
                "type": "LLMChain",
201
                "baseClasses": ["LLMChain", "BaseChain", "Runnable"],
202
                "category": "Chains",
203
                "description": "Chain to run queries against LLMs",
204
                "inputParams": [
205
                    {
206
                        "label": "Chain Name",
207
                        "name": "chainName",
208
                        "type": "string",
209
                        "placeholder": "Name Your Chain",
210
                        "optional": true,
211
                        "id": "llmChain_0-input-chainName-string"
212
                    }
213
                ],
214
                "inputAnchors": [
215
                    {
216
                        "label": "Language Model",
217
                        "name": "model",
218
                        "type": "BaseLanguageModel",
219
                        "id": "llmChain_0-input-model-BaseLanguageModel"
220
                    },
221
                    {
222
                        "label": "Prompt",
223
                        "name": "prompt",
224
                        "type": "BasePromptTemplate",
225
                        "id": "llmChain_0-input-prompt-BasePromptTemplate"
226
                    },
227
                    {
228
                        "label": "Output Parser",
229
                        "name": "outputParser",
230
                        "type": "BaseLLMOutputParser",
231
                        "optional": true,
232
                        "id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
233
                    },
234
                    {
235
                        "label": "Input Moderation",
236
                        "description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
237
                        "name": "inputModeration",
238
                        "type": "Moderation",
239
                        "optional": true,
240
                        "list": true,
241
                        "id": "llmChain_0-input-inputModeration-Moderation"
242
                    }
243
                ],
244
                "inputs": {
245
                    "model": "{{chatOpenAI_0.data.instance}}",
246
                    "prompt": "{{chatPromptTemplate_0.data.instance}}",
247
                    "outputParser": "{{structuredOutputParser_0.data.instance}}",
248
                    "chainName": "",
249
                    "inputModeration": ""
250
                },
251
                "outputAnchors": [
252
                    {
253
                        "name": "output",
254
                        "label": "Output",
255
                        "type": "options",
256
                        "options": [
257
                            {
258
                                "id": "llmChain_0-output-llmChain-LLMChain|BaseChain|Runnable",
259
                                "name": "llmChain",
260
                                "label": "LLM Chain",
261
                                "type": "LLMChain | BaseChain | Runnable"
262
                            },
263
                            {
264
                                "id": "llmChain_0-output-outputPrediction-string|json",
265
                                "name": "outputPrediction",
266
                                "label": "Output Prediction",
267
                                "type": "string | json"
268
                            }
269
                        ],
270
                        "default": "llmChain"
271
                    }
272
                ],
273
                "outputs": {
274
                    "output": "llmChain"
275
                },
276
                "selected": false
277
            },
278
            "positionAbsolute": {
279
                "x": 1229.1699649849293,
280
                "y": 245.55173505632646
281
            },
282
            "selected": false
283
        },
284
        {
285
            "width": 300,
286
            "height": 652,
287
            "id": "chatPromptTemplate_0",
288
            "position": {
289
                "x": 501.1597501123828,
290
                "y": -154.43917602832562
291
            },
292
            "type": "customNode",
293
            "data": {
294
                "id": "chatPromptTemplate_0",
295
                "label": "Chat Prompt Template",
296
                "version": 1,
297
                "name": "chatPromptTemplate",
298
                "type": "ChatPromptTemplate",
299
                "baseClasses": ["ChatPromptTemplate", "BaseChatPromptTemplate", "BasePromptTemplate", "Runnable"],
300
                "category": "Prompts",
301
                "description": "Schema to represent a chat prompt",
302
                "inputParams": [
303
                    {
304
                        "label": "System Message",
305
                        "name": "systemMessagePrompt",
306
                        "type": "string",
307
                        "rows": 4,
308
                        "placeholder": "You are a helpful assistant that translates {input_language} to {output_language}.",
309
                        "id": "chatPromptTemplate_0-input-systemMessagePrompt-string"
310
                    },
311
                    {
312
                        "label": "Human Message",
313
                        "name": "humanMessagePrompt",
314
                        "type": "string",
315
                        "rows": 4,
316
                        "placeholder": "{text}",
317
                        "id": "chatPromptTemplate_0-input-humanMessagePrompt-string"
318
                    },
319
                    {
320
                        "label": "Format Prompt Values",
321
                        "name": "promptValues",
322
                        "type": "json",
323
                        "optional": true,
324
                        "acceptVariable": true,
325
                        "list": true,
326
                        "id": "chatPromptTemplate_0-input-promptValues-json"
327
                    }
328
                ],
329
                "inputAnchors": [],
330
                "inputs": {
331
                    "systemMessagePrompt": "Answer user's question as best you can",
332
                    "humanMessagePrompt": "{text}",
333
                    "promptValues": ""
334
                },
335
                "outputAnchors": [
336
                    {
337
                        "id": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable",
338
                        "name": "chatPromptTemplate",
339
                        "label": "ChatPromptTemplate",
340
                        "type": "ChatPromptTemplate | BaseChatPromptTemplate | BasePromptTemplate | Runnable"
341
                    }
342
                ],
343
                "outputs": {},
344
                "selected": false
345
            },
346
            "selected": false,
347
            "positionAbsolute": {
348
                "x": 501.1597501123828,
349
                "y": -154.43917602832562
350
            },
351
            "dragging": false
352
        },
353
        {
354
            "width": 300,
355
            "height": 328,
356
            "id": "structuredOutputParser_0",
357
            "position": {
358
                "x": 170.3869571939727,
359
                "y": 343.9298288967859
360
            },
361
            "type": "customNode",
362
            "data": {
363
                "id": "structuredOutputParser_0",
364
                "label": "Structured Output Parser",
365
                "version": 1,
366
                "name": "structuredOutputParser",
367
                "type": "StructuredOutputParser",
368
                "baseClasses": ["StructuredOutputParser", "BaseLLMOutputParser", "Runnable"],
369
                "category": "Output Parsers",
370
                "description": "Parse the output of an LLM call into a given (JSON) structure.",
371
                "inputParams": [
372
                    {
373
                        "label": "Autofix",
374
                        "name": "autofixParser",
375
                        "type": "boolean",
376
                        "optional": true,
377
                        "description": "In the event that the first call fails, will make another call to the model to fix any errors.",
378
                        "id": "structuredOutputParser_0-input-autofixParser-boolean"
379
                    },
380
                    {
381
                        "label": "JSON Structure",
382
                        "name": "jsonStructure",
383
                        "type": "datagrid",
384
                        "description": "JSON structure for LLM to return",
385
                        "datagrid": [
386
                            {
387
                                "field": "property",
388
                                "headerName": "Property",
389
                                "editable": true
390
                            },
391
                            {
392
                                "field": "type",
393
                                "headerName": "Type",
394
                                "type": "singleSelect",
395
                                "valueOptions": ["string", "number", "boolean"],
396
                                "editable": true
397
                            },
398
                            {
399
                                "field": "description",
400
                                "headerName": "Description",
401
                                "editable": true,
402
                                "flex": 1
403
                            }
404
                        ],
405
                        "default": [
406
                            {
407
                                "property": "answer",
408
                                "type": "string",
409
                                "description": "answer to the user's question"
410
                            },
411
                            {
412
                                "property": "source",
413
                                "type": "string",
414
                                "description": "sources used to answer the question, should be websites"
415
                            }
416
                        ],
417
                        "additionalParams": true,
418
                        "id": "structuredOutputParser_0-input-jsonStructure-datagrid"
419
                    }
420
                ],
421
                "inputAnchors": [],
422
                "inputs": {
423
                    "autofixParser": true,
424
                    "jsonStructure": [
425
                        {
426
                            "property": "answer",
427
                            "type": "string",
428
                            "description": "answer to the user's question"
429
                        },
430
                        {
431
                            "property": "source",
432
                            "type": "string",
433
                            "description": "sources used to answer the question, should be websites"
434
                        }
435
                    ]
436
                },
437
                "outputAnchors": [
438
                    {
439
                        "id": "structuredOutputParser_0-output-structuredOutputParser-StructuredOutputParser|BaseLLMOutputParser|Runnable",
440
                        "name": "structuredOutputParser",
441
                        "label": "StructuredOutputParser",
442
                        "type": "StructuredOutputParser | BaseLLMOutputParser | Runnable"
443
                    }
444
                ],
445
                "outputs": {},
446
                "selected": false
447
            },
448
            "selected": false,
449
            "positionAbsolute": {
450
                "x": 170.3869571939727,
451
                "y": 343.9298288967859
452
            },
453
            "dragging": false
454
        }
455
    ],
456
    "edges": [
457
        {
458
            "source": "chatOpenAI_0",
459
            "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
460
            "target": "llmChain_0",
461
            "targetHandle": "llmChain_0-input-model-BaseLanguageModel",
462
            "type": "buttonedge",
463
            "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_0-llmChain_0-input-model-BaseLanguageModel",
464
            "data": {
465
                "label": ""
466
            }
467
        },
468
        {
469
            "source": "chatPromptTemplate_0",
470
            "sourceHandle": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable",
471
            "target": "llmChain_0",
472
            "targetHandle": "llmChain_0-input-prompt-BasePromptTemplate",
473
            "type": "buttonedge",
474
            "id": "chatPromptTemplate_0-chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable-llmChain_0-llmChain_0-input-prompt-BasePromptTemplate",
475
            "data": {
476
                "label": ""
477
            }
478
        },
479
        {
480
            "source": "structuredOutputParser_0",
481
            "sourceHandle": "structuredOutputParser_0-output-structuredOutputParser-StructuredOutputParser|BaseLLMOutputParser|Runnable",
482
            "target": "llmChain_0",
483
            "targetHandle": "llmChain_0-input-outputParser-BaseLLMOutputParser",
484
            "type": "buttonedge",
485
            "id": "structuredOutputParser_0-structuredOutputParser_0-output-structuredOutputParser-StructuredOutputParser|BaseLLMOutputParser|Runnable-llmChain_0-llmChain_0-input-outputParser-BaseLLMOutputParser",
486
            "data": {
487
                "label": ""
488
            }
489
        }
490
    ]
491
}
492

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

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

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

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