Flowise

Форк
0
338 строк · 15.6 Кб
1
{
2
    "description": "Answer questions over a SQL database",
3
    "categories": "ChatOpenAI,Sql Database Chain,Langchain",
4
    "framework": "Langchain",
5
    "nodes": [
6
        {
7
            "width": 300,
8
            "height": 522,
9
            "id": "chatOpenAI_0",
10
            "position": {
11
                "x": 855.0396169649254,
12
                "y": 179.29430548099504
13
            },
14
            "type": "customNode",
15
            "data": {
16
                "id": "chatOpenAI_0",
17
                "label": "ChatOpenAI",
18
                "version": 6.0,
19
                "name": "chatOpenAI",
20
                "type": "ChatOpenAI",
21
                "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
22
                "category": "Chat Models",
23
                "description": "Wrapper around OpenAI large language models that use the Chat endpoint",
24
                "inputParams": [
25
                    {
26
                        "label": "Connect Credential",
27
                        "name": "credential",
28
                        "type": "credential",
29
                        "credentialNames": ["openAIApi"],
30
                        "id": "chatOpenAI_0-input-credential-credential"
31
                    },
32
                    {
33
                        "label": "Model Name",
34
                        "name": "modelName",
35
                        "type": "asyncOptions",
36
                        "loadMethod": "listModels",
37
                        "default": "gpt-3.5-turbo",
38
                        "id": "chatOpenAI_0-input-modelName-options"
39
                    },
40
                    {
41
                        "label": "Temperature",
42
                        "name": "temperature",
43
                        "type": "number",
44
                        "default": 0.9,
45
                        "optional": true,
46
                        "id": "chatOpenAI_0-input-temperature-number"
47
                    },
48
                    {
49
                        "label": "Max Tokens",
50
                        "name": "maxTokens",
51
                        "type": "number",
52
                        "optional": true,
53
                        "additionalParams": true,
54
                        "id": "chatOpenAI_0-input-maxTokens-number"
55
                    },
56
                    {
57
                        "label": "Top Probability",
58
                        "name": "topP",
59
                        "type": "number",
60
                        "optional": true,
61
                        "additionalParams": true,
62
                        "id": "chatOpenAI_0-input-topP-number"
63
                    },
64
                    {
65
                        "label": "Frequency Penalty",
66
                        "name": "frequencyPenalty",
67
                        "type": "number",
68
                        "optional": true,
69
                        "additionalParams": true,
70
                        "id": "chatOpenAI_0-input-frequencyPenalty-number"
71
                    },
72
                    {
73
                        "label": "Presence Penalty",
74
                        "name": "presencePenalty",
75
                        "type": "number",
76
                        "optional": true,
77
                        "additionalParams": true,
78
                        "id": "chatOpenAI_0-input-presencePenalty-number"
79
                    },
80
                    {
81
                        "label": "Timeout",
82
                        "name": "timeout",
83
                        "type": "number",
84
                        "optional": true,
85
                        "additionalParams": true,
86
                        "id": "chatOpenAI_0-input-timeout-number"
87
                    },
88
                    {
89
                        "label": "BasePath",
90
                        "name": "basepath",
91
                        "type": "string",
92
                        "optional": true,
93
                        "additionalParams": true,
94
                        "id": "chatOpenAI_0-input-basepath-string"
95
                    },
96
                    {
97
                        "label": "BaseOptions",
98
                        "name": "baseOptions",
99
                        "type": "json",
100
                        "optional": true,
101
                        "additionalParams": true,
102
                        "id": "chatOpenAI_0-input-baseOptions-json"
103
                    },
104
                    {
105
                        "label": "Allow Image Uploads",
106
                        "name": "allowImageUploads",
107
                        "type": "boolean",
108
                        "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",
109
                        "default": false,
110
                        "optional": true,
111
                        "id": "chatOpenAI_0-input-allowImageUploads-boolean"
112
                    },
113
                    {
114
                        "label": "Image Resolution",
115
                        "description": "This parameter controls the resolution in which the model views the image.",
116
                        "name": "imageResolution",
117
                        "type": "options",
118
                        "options": [
119
                            {
120
                                "label": "Low",
121
                                "name": "low"
122
                            },
123
                            {
124
                                "label": "High",
125
                                "name": "high"
126
                            },
127
                            {
128
                                "label": "Auto",
129
                                "name": "auto"
130
                            }
131
                        ],
132
                        "default": "low",
133
                        "optional": false,
134
                        "additionalParams": true,
135
                        "id": "chatOpenAI_0-input-imageResolution-options"
136
                    }
137
                ],
138
                "inputAnchors": [
139
                    {
140
                        "label": "Cache",
141
                        "name": "cache",
142
                        "type": "BaseCache",
143
                        "optional": true,
144
                        "id": "chatOpenAI_0-input-cache-BaseCache"
145
                    }
146
                ],
147
                "inputs": {
148
                    "modelName": "gpt-3.5-turbo",
149
                    "temperature": "0",
150
                    "maxTokens": "",
151
                    "topP": "",
152
                    "frequencyPenalty": "",
153
                    "presencePenalty": "",
154
                    "timeout": "",
155
                    "basepath": "",
156
                    "baseOptions": "",
157
                    "allowImageUploads": true,
158
                    "imageResolution": "low"
159
                },
160
                "outputAnchors": [
161
                    {
162
                        "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
163
                        "name": "chatOpenAI",
164
                        "label": "ChatOpenAI",
165
                        "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel"
166
                    }
167
                ],
168
                "outputs": {},
169
                "selected": false
170
            },
171
            "selected": false,
172
            "positionAbsolute": {
173
                "x": 855.0396169649254,
174
                "y": 179.29430548099504
175
            },
176
            "dragging": false
177
        },
178
        {
179
            "width": 300,
180
            "height": 475,
181
            "id": "sqlDatabaseChain_0",
182
            "position": {
183
                "x": 1206.5244299447634,
184
                "y": 201.04431101230608
185
            },
186
            "type": "customNode",
187
            "data": {
188
                "id": "sqlDatabaseChain_0",
189
                "label": "Sql Database Chain",
190
                "version": 5,
191
                "name": "sqlDatabaseChain",
192
                "type": "SqlDatabaseChain",
193
                "baseClasses": ["SqlDatabaseChain", "BaseChain", "Runnable"],
194
                "category": "Chains",
195
                "description": "Answer questions over a SQL database",
196
                "inputParams": [
197
                    {
198
                        "label": "Database",
199
                        "name": "database",
200
                        "type": "options",
201
                        "options": [
202
                            {
203
                                "label": "SQLite",
204
                                "name": "sqlite"
205
                            },
206
                            {
207
                                "label": "PostgreSQL",
208
                                "name": "postgres"
209
                            },
210
                            {
211
                                "label": "MSSQL",
212
                                "name": "mssql"
213
                            },
214
                            {
215
                                "label": "MySQL",
216
                                "name": "mysql"
217
                            }
218
                        ],
219
                        "default": "sqlite",
220
                        "id": "sqlDatabaseChain_0-input-database-options"
221
                    },
222
                    {
223
                        "label": "Connection string or file path (sqlite only)",
224
                        "name": "url",
225
                        "type": "string",
226
                        "placeholder": "1270.0.0.1:5432/chinook",
227
                        "id": "sqlDatabaseChain_0-input-url-string"
228
                    },
229
                    {
230
                        "label": "Include Tables",
231
                        "name": "includesTables",
232
                        "type": "string",
233
                        "description": "Tables to include for queries, seperated by comma. Can only use Include Tables or Ignore Tables",
234
                        "placeholder": "table1, table2",
235
                        "additionalParams": true,
236
                        "optional": true,
237
                        "id": "sqlDatabaseChain_0-input-includesTables-string"
238
                    },
239
                    {
240
                        "label": "Ignore Tables",
241
                        "name": "ignoreTables",
242
                        "type": "string",
243
                        "description": "Tables to ignore for queries, seperated by comma. Can only use Ignore Tables or Include Tables",
244
                        "placeholder": "table1, table2",
245
                        "additionalParams": true,
246
                        "optional": true,
247
                        "id": "sqlDatabaseChain_0-input-ignoreTables-string"
248
                    },
249
                    {
250
                        "label": "Sample table's rows info",
251
                        "name": "sampleRowsInTableInfo",
252
                        "type": "number",
253
                        "description": "Number of sample row for tables to load for info.",
254
                        "placeholder": "3",
255
                        "additionalParams": true,
256
                        "optional": true,
257
                        "id": "sqlDatabaseChain_0-input-sampleRowsInTableInfo-number"
258
                    },
259
                    {
260
                        "label": "Top Keys",
261
                        "name": "topK",
262
                        "type": "number",
263
                        "description": "If you are querying for several rows of a table you can select the maximum number of results you want to get by using the top_k parameter (default is 10). This is useful for avoiding query results that exceed the prompt max length or consume tokens unnecessarily.",
264
                        "placeholder": "10",
265
                        "additionalParams": true,
266
                        "optional": true,
267
                        "id": "sqlDatabaseChain_0-input-topK-number"
268
                    },
269
                    {
270
                        "label": "Custom Prompt",
271
                        "name": "customPrompt",
272
                        "type": "string",
273
                        "description": "You can provide custom prompt to the chain. This will override the existing default prompt used. See <a target=\"_blank\" href=\"https://python.langchain.com/docs/integrations/tools/sqlite#customize-prompt\">guide</a>",
274
                        "warning": "Prompt must include 3 input variables: {input}, {dialect}, {table_info}. You can refer to official guide from description above",
275
                        "rows": 4,
276
                        "placeholder": "Given an input question, first create a syntactically correct {dialect} query to run, then look at the results of the query and return the answer. Unless the user specifies in his question a specific number of examples he wishes to obtain, always limit your query to at most {top_k} results. You can order the results by a relevant column to return the most interesting examples in the database.\n\nNever query for all the columns from a specific table, only ask for a the few relevant columns given the question.\n\nPay attention to use only the column names that you can see in the schema description. Be careful to not query for columns that do not exist. Also, pay attention to which column is in which table.\n\nUse the following format:\n\nQuestion: \"Question here\"\nSQLQuery: \"SQL Query to run\"\nSQLResult: \"Result of the SQLQuery\"\nAnswer: \"Final answer here\"\n\nOnly use the tables listed below.\n\n{table_info}\n\nQuestion: {input}",
277
                        "additionalParams": true,
278
                        "optional": true,
279
                        "id": "sqlDatabaseChain_0-input-customPrompt-string"
280
                    }
281
                ],
282
                "inputAnchors": [
283
                    {
284
                        "label": "Language Model",
285
                        "name": "model",
286
                        "type": "BaseLanguageModel",
287
                        "id": "sqlDatabaseChain_0-input-model-BaseLanguageModel"
288
                    },
289
                    {
290
                        "label": "Input Moderation",
291
                        "description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
292
                        "name": "inputModeration",
293
                        "type": "Moderation",
294
                        "optional": true,
295
                        "list": true,
296
                        "id": "sqlDatabaseChain_0-input-inputModeration-Moderation"
297
                    }
298
                ],
299
                "inputs": {
300
                    "inputModeration": "",
301
                    "model": "{{chatOpenAI_0.data.instance}}",
302
                    "database": "sqlite",
303
                    "url": "",
304
                    "customPrompt": ""
305
                },
306
                "outputAnchors": [
307
                    {
308
                        "id": "sqlDatabaseChain_0-output-sqlDatabaseChain-SqlDatabaseChain|BaseChain|Runnable",
309
                        "name": "sqlDatabaseChain",
310
                        "label": "SqlDatabaseChain",
311
                        "type": "SqlDatabaseChain | BaseChain | Runnable"
312
                    }
313
                ],
314
                "outputs": {},
315
                "selected": false
316
            },
317
            "selected": false,
318
            "positionAbsolute": {
319
                "x": 1206.5244299447634,
320
                "y": 201.04431101230608
321
            },
322
            "dragging": false
323
        }
324
    ],
325
    "edges": [
326
        {
327
            "source": "chatOpenAI_0",
328
            "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
329
            "target": "sqlDatabaseChain_0",
330
            "targetHandle": "sqlDatabaseChain_0-input-model-BaseLanguageModel",
331
            "type": "buttonedge",
332
            "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-sqlDatabaseChain_0-sqlDatabaseChain_0-input-model-BaseLanguageModel",
333
            "data": {
334
                "label": ""
335
            }
336
        }
337
    ]
338
}
339

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

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

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

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