Flowise

Форк
0
371 строка · 15.4 Кб
1
{
2
    "description": "Language translation using LLM Chain with a Chat Prompt Template and Chat Model",
3
    "categories": "Chat Prompt Template,ChatOpenAI,LLM Chain,Langchain",
4
    "framework": "Langchain",
5
    "nodes": [
6
        {
7
            "width": 300,
8
            "height": 652,
9
            "id": "chatPromptTemplate_0",
10
            "position": {
11
                "x": 437.51367850489396,
12
                "y": 649.7619214034173
13
            },
14
            "type": "customNode",
15
            "data": {
16
                "id": "chatPromptTemplate_0",
17
                "label": "Chat Prompt Template",
18
                "version": 1,
19
                "name": "chatPromptTemplate",
20
                "type": "ChatPromptTemplate",
21
                "baseClasses": ["ChatPromptTemplate", "BaseChatPromptTemplate", "BasePromptTemplate"],
22
                "category": "Prompts",
23
                "description": "Schema to represent a chat prompt",
24
                "inputParams": [
25
                    {
26
                        "label": "System Message",
27
                        "name": "systemMessagePrompt",
28
                        "type": "string",
29
                        "rows": 4,
30
                        "placeholder": "You are a helpful assistant that translates {input_language} to {output_language}.",
31
                        "id": "chatPromptTemplate_0-input-systemMessagePrompt-string"
32
                    },
33
                    {
34
                        "label": "Human Message",
35
                        "name": "humanMessagePrompt",
36
                        "type": "string",
37
                        "rows": 4,
38
                        "placeholder": "{text}",
39
                        "id": "chatPromptTemplate_0-input-humanMessagePrompt-string"
40
                    },
41
                    {
42
                        "label": "Format Prompt Values",
43
                        "name": "promptValues",
44
                        "type": "json",
45
                        "optional": true,
46
                        "acceptVariable": true,
47
                        "list": true,
48
                        "id": "chatPromptTemplate_0-input-promptValues-json"
49
                    }
50
                ],
51
                "inputAnchors": [],
52
                "inputs": {
53
                    "systemMessagePrompt": "You are a helpful assistant that translates {input_language} to {output_language}.",
54
                    "humanMessagePrompt": "{text}",
55
                    "promptValues": "{\"input_language\":\"English\",\"output_language\":\"French\",\"text\":\"{{question}}\"}"
56
                },
57
                "outputAnchors": [
58
                    {
59
                        "id": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate",
60
                        "name": "chatPromptTemplate",
61
                        "label": "ChatPromptTemplate",
62
                        "type": "ChatPromptTemplate | BaseChatPromptTemplate | BasePromptTemplate"
63
                    }
64
                ],
65
                "outputs": {},
66
                "selected": false
67
            },
68
            "selected": false,
69
            "positionAbsolute": {
70
                "x": 437.51367850489396,
71
                "y": 649.7619214034173
72
            },
73
            "dragging": false
74
        },
75
        {
76
            "width": 300,
77
            "height": 574,
78
            "id": "chatOpenAI_0",
79
            "position": {
80
                "x": 436.97058562345904,
81
                "y": 29.96180150605153
82
            },
83
            "type": "customNode",
84
            "data": {
85
                "id": "chatOpenAI_0",
86
                "label": "ChatOpenAI",
87
                "version": 6.0,
88
                "name": "chatOpenAI",
89
                "type": "ChatOpenAI",
90
                "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
91
                "category": "Chat Models",
92
                "description": "Wrapper around OpenAI large language models that use the Chat endpoint",
93
                "inputParams": [
94
                    {
95
                        "label": "Connect Credential",
96
                        "name": "credential",
97
                        "type": "credential",
98
                        "credentialNames": ["openAIApi"],
99
                        "id": "chatOpenAI_0-input-credential-credential"
100
                    },
101
                    {
102
                        "label": "Model Name",
103
                        "name": "modelName",
104
                        "type": "asyncOptions",
105
                        "loadMethod": "listModels",
106
                        "default": "gpt-3.5-turbo",
107
                        "id": "chatOpenAI_0-input-modelName-options"
108
                    },
109
                    {
110
                        "label": "Temperature",
111
                        "name": "temperature",
112
                        "type": "number",
113
                        "default": 0.9,
114
                        "optional": true,
115
                        "id": "chatOpenAI_0-input-temperature-number"
116
                    },
117
                    {
118
                        "label": "Max Tokens",
119
                        "name": "maxTokens",
120
                        "type": "number",
121
                        "optional": true,
122
                        "additionalParams": true,
123
                        "id": "chatOpenAI_0-input-maxTokens-number"
124
                    },
125
                    {
126
                        "label": "Top Probability",
127
                        "name": "topP",
128
                        "type": "number",
129
                        "optional": true,
130
                        "additionalParams": true,
131
                        "id": "chatOpenAI_0-input-topP-number"
132
                    },
133
                    {
134
                        "label": "Frequency Penalty",
135
                        "name": "frequencyPenalty",
136
                        "type": "number",
137
                        "optional": true,
138
                        "additionalParams": true,
139
                        "id": "chatOpenAI_0-input-frequencyPenalty-number"
140
                    },
141
                    {
142
                        "label": "Presence Penalty",
143
                        "name": "presencePenalty",
144
                        "type": "number",
145
                        "optional": true,
146
                        "additionalParams": true,
147
                        "id": "chatOpenAI_0-input-presencePenalty-number"
148
                    },
149
                    {
150
                        "label": "Timeout",
151
                        "name": "timeout",
152
                        "type": "number",
153
                        "optional": true,
154
                        "additionalParams": true,
155
                        "id": "chatOpenAI_0-input-timeout-number"
156
                    },
157
                    {
158
                        "label": "BasePath",
159
                        "name": "basepath",
160
                        "type": "string",
161
                        "optional": true,
162
                        "additionalParams": true,
163
                        "id": "chatOpenAI_0-input-basepath-string"
164
                    },
165
                    {
166
                        "label": "BaseOptions",
167
                        "name": "baseOptions",
168
                        "type": "json",
169
                        "optional": true,
170
                        "additionalParams": true,
171
                        "id": "chatOpenAI_0-input-baseOptions-json"
172
                    },
173
                    {
174
                        "label": "Allow Image Uploads",
175
                        "name": "allowImageUploads",
176
                        "type": "boolean",
177
                        "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",
178
                        "default": false,
179
                        "optional": true,
180
                        "id": "chatOpenAI_0-input-allowImageUploads-boolean"
181
                    },
182
                    {
183
                        "label": "Image Resolution",
184
                        "description": "This parameter controls the resolution in which the model views the image.",
185
                        "name": "imageResolution",
186
                        "type": "options",
187
                        "options": [
188
                            {
189
                                "label": "Low",
190
                                "name": "low"
191
                            },
192
                            {
193
                                "label": "High",
194
                                "name": "high"
195
                            },
196
                            {
197
                                "label": "Auto",
198
                                "name": "auto"
199
                            }
200
                        ],
201
                        "default": "low",
202
                        "optional": false,
203
                        "additionalParams": true,
204
                        "id": "chatOpenAI_0-input-imageResolution-options"
205
                    }
206
                ],
207
                "inputAnchors": [
208
                    {
209
                        "label": "Cache",
210
                        "name": "cache",
211
                        "type": "BaseCache",
212
                        "optional": true,
213
                        "id": "chatOpenAI_0-input-cache-BaseCache"
214
                    }
215
                ],
216
                "inputs": {
217
                    "modelName": "gpt-3.5-turbo",
218
                    "temperature": "0",
219
                    "maxTokens": "",
220
                    "topP": "",
221
                    "frequencyPenalty": "",
222
                    "presencePenalty": "",
223
                    "timeout": "",
224
                    "basepath": "",
225
                    "baseOptions": "",
226
                    "allowImageUploads": true,
227
                    "imageResolution": "low"
228
                },
229
                "outputAnchors": [
230
                    {
231
                        "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
232
                        "name": "chatOpenAI",
233
                        "label": "ChatOpenAI",
234
                        "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel"
235
                    }
236
                ],
237
                "outputs": {},
238
                "selected": false
239
            },
240
            "selected": false,
241
            "positionAbsolute": {
242
                "x": 436.97058562345904,
243
                "y": 29.96180150605153
244
            },
245
            "dragging": false
246
        },
247
        {
248
            "width": 300,
249
            "height": 456,
250
            "id": "llmChain_0",
251
            "position": {
252
                "x": 836.089121144244,
253
                "y": 510.07109938359963
254
            },
255
            "type": "customNode",
256
            "data": {
257
                "id": "llmChain_0",
258
                "label": "LLM Chain",
259
                "version": 3,
260
                "name": "llmChain",
261
                "type": "LLMChain",
262
                "baseClasses": ["LLMChain", "BaseChain", "Runnable"],
263
                "category": "Chains",
264
                "description": "Chain to run queries against LLMs",
265
                "inputParams": [
266
                    {
267
                        "label": "Chain Name",
268
                        "name": "chainName",
269
                        "type": "string",
270
                        "placeholder": "Name Your Chain",
271
                        "optional": true,
272
                        "id": "llmChain_0-input-chainName-string"
273
                    }
274
                ],
275
                "inputAnchors": [
276
                    {
277
                        "label": "Language Model",
278
                        "name": "model",
279
                        "type": "BaseLanguageModel",
280
                        "id": "llmChain_0-input-model-BaseLanguageModel"
281
                    },
282
                    {
283
                        "label": "Prompt",
284
                        "name": "prompt",
285
                        "type": "BasePromptTemplate",
286
                        "id": "llmChain_0-input-prompt-BasePromptTemplate"
287
                    },
288
                    {
289
                        "label": "Output Parser",
290
                        "name": "outputParser",
291
                        "type": "BaseLLMOutputParser",
292
                        "optional": true,
293
                        "id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
294
                    },
295
                    {
296
                        "label": "Input Moderation",
297
                        "description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
298
                        "name": "inputModeration",
299
                        "type": "Moderation",
300
                        "optional": true,
301
                        "list": true,
302
                        "id": "llmChain_0-input-inputModeration-Moderation"
303
                    }
304
                ],
305
                "inputs": {
306
                    "model": "{{chatOpenAI_0.data.instance}}",
307
                    "prompt": "{{chatPromptTemplate_0.data.instance}}",
308
                    "outputParser": "",
309
                    "chainName": "Language Translation",
310
                    "inputModeration": ""
311
                },
312
                "outputAnchors": [
313
                    {
314
                        "name": "output",
315
                        "label": "Output",
316
                        "type": "options",
317
                        "options": [
318
                            {
319
                                "id": "llmChain_0-output-llmChain-LLMChain|BaseChain|Runnable",
320
                                "name": "llmChain",
321
                                "label": "LLM Chain",
322
                                "type": "LLMChain | BaseChain | Runnable"
323
                            },
324
                            {
325
                                "id": "llmChain_0-output-outputPrediction-string|json",
326
                                "name": "outputPrediction",
327
                                "label": "Output Prediction",
328
                                "type": "string | json"
329
                            }
330
                        ],
331
                        "default": "llmChain"
332
                    }
333
                ],
334
                "outputs": {
335
                    "output": "llmChain"
336
                },
337
                "selected": false
338
            },
339
            "selected": false,
340
            "dragging": false,
341
            "positionAbsolute": {
342
                "x": 836.089121144244,
343
                "y": 510.07109938359963
344
            }
345
        }
346
    ],
347
    "edges": [
348
        {
349
            "source": "chatOpenAI_0",
350
            "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
351
            "target": "llmChain_0",
352
            "targetHandle": "llmChain_0-input-model-BaseLanguageModel",
353
            "type": "buttonedge",
354
            "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-llmChain_0-llmChain_0-input-model-BaseLanguageModel",
355
            "data": {
356
                "label": ""
357
            }
358
        },
359
        {
360
            "source": "chatPromptTemplate_0",
361
            "sourceHandle": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate",
362
            "target": "llmChain_0",
363
            "targetHandle": "llmChain_0-input-prompt-BasePromptTemplate",
364
            "type": "buttonedge",
365
            "id": "chatPromptTemplate_0-chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate-llmChain_0-llmChain_0-input-prompt-BasePromptTemplate",
366
            "data": {
367
                "label": ""
368
            }
369
        }
370
    ]
371
}
372

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

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

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

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