Flowise

Форк
0
/
Conversational Agent.json 
465 строк · 21.2 Кб
1
{
2
    "description": "A conversational agent for a chat model which utilize chat specific prompts",
3
    "categories": "Calculator Tool,Buffer Memory,SerpAPI,ChatOpenAI,Conversational Agent,Langchain",
4
    "framework": "Langchain",
5
    "nodes": [
6
        {
7
            "width": 300,
8
            "height": 143,
9
            "id": "calculator_1",
10
            "position": {
11
                "x": 800.5125025564965,
12
                "y": 72.40592063242738
13
            },
14
            "type": "customNode",
15
            "data": {
16
                "id": "calculator_1",
17
                "label": "Calculator",
18
                "version": 1,
19
                "name": "calculator",
20
                "type": "Calculator",
21
                "baseClasses": ["Calculator", "Tool", "StructuredTool", "BaseLangChain"],
22
                "category": "Tools",
23
                "description": "Perform calculations on response",
24
                "inputParams": [],
25
                "inputAnchors": [],
26
                "inputs": {},
27
                "outputAnchors": [
28
                    {
29
                        "id": "calculator_1-output-calculator-Calculator|Tool|StructuredTool|BaseLangChain",
30
                        "name": "calculator",
31
                        "label": "Calculator",
32
                        "type": "Calculator | Tool | StructuredTool | BaseLangChain"
33
                    }
34
                ],
35
                "outputs": {},
36
                "selected": false
37
            },
38
            "positionAbsolute": {
39
                "x": 800.5125025564965,
40
                "y": 72.40592063242738
41
            },
42
            "selected": false,
43
            "dragging": false
44
        },
45
        {
46
            "width": 300,
47
            "height": 376,
48
            "id": "bufferMemory_1",
49
            "position": {
50
                "x": 607.6260576768354,
51
                "y": 584.7920541862369
52
            },
53
            "type": "customNode",
54
            "data": {
55
                "id": "bufferMemory_1",
56
                "label": "Buffer Memory",
57
                "version": 2,
58
                "name": "bufferMemory",
59
                "type": "BufferMemory",
60
                "baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"],
61
                "category": "Memory",
62
                "description": "Retrieve chat messages stored in database",
63
                "inputParams": [
64
                    {
65
                        "label": "Session Id",
66
                        "name": "sessionId",
67
                        "type": "string",
68
                        "description": "If not specified, a random id will be used. Learn <a target=\"_blank\" href=\"https://docs.flowiseai.com/memory#ui-and-embedded-chat\">more</a>",
69
                        "default": "",
70
                        "additionalParams": true,
71
                        "optional": true,
72
                        "id": "bufferMemory_1-input-sessionId-string"
73
                    },
74
                    {
75
                        "label": "Memory Key",
76
                        "name": "memoryKey",
77
                        "type": "string",
78
                        "default": "chat_history",
79
                        "additionalParams": true,
80
                        "id": "bufferMemory_1-input-memoryKey-string"
81
                    }
82
                ],
83
                "inputAnchors": [],
84
                "inputs": {
85
                    "sessionId": "",
86
                    "memoryKey": "chat_history"
87
                },
88
                "outputAnchors": [
89
                    {
90
                        "id": "bufferMemory_1-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory",
91
                        "name": "bufferMemory",
92
                        "label": "BufferMemory",
93
                        "type": "BufferMemory | BaseChatMemory | BaseMemory"
94
                    }
95
                ],
96
                "outputs": {},
97
                "selected": false
98
            },
99
            "positionAbsolute": {
100
                "x": 607.6260576768354,
101
                "y": 584.7920541862369
102
            },
103
            "selected": false,
104
            "dragging": false
105
        },
106
        {
107
            "width": 300,
108
            "height": 277,
109
            "id": "serpAPI_0",
110
            "position": {
111
                "x": 451.83740798447855,
112
                "y": 53.2843022150486
113
            },
114
            "type": "customNode",
115
            "data": {
116
                "id": "serpAPI_0",
117
                "label": "Serp API",
118
                "version": 1,
119
                "name": "serpAPI",
120
                "type": "SerpAPI",
121
                "baseClasses": ["SerpAPI", "Tool", "StructuredTool"],
122
                "category": "Tools",
123
                "description": "Wrapper around SerpAPI - a real-time API to access Google search results",
124
                "inputParams": [
125
                    {
126
                        "label": "Connect Credential",
127
                        "name": "credential",
128
                        "type": "credential",
129
                        "credentialNames": ["serpApi"],
130
                        "id": "serpAPI_0-input-credential-credential"
131
                    }
132
                ],
133
                "inputAnchors": [],
134
                "inputs": {},
135
                "outputAnchors": [
136
                    {
137
                        "id": "serpAPI_0-output-serpAPI-SerpAPI|Tool|StructuredTool",
138
                        "name": "serpAPI",
139
                        "label": "SerpAPI",
140
                        "type": "SerpAPI | Tool | StructuredTool"
141
                    }
142
                ],
143
                "outputs": {},
144
                "selected": false
145
            },
146
            "selected": false,
147
            "positionAbsolute": {
148
                "x": 451.83740798447855,
149
                "y": 53.2843022150486
150
            },
151
            "dragging": false
152
        },
153
        {
154
            "width": 300,
155
            "height": 574,
156
            "id": "chatOpenAI_0",
157
            "position": {
158
                "x": 97.01321406237057,
159
                "y": 63.67664262280914
160
            },
161
            "type": "customNode",
162
            "data": {
163
                "id": "chatOpenAI_0",
164
                "label": "ChatOpenAI",
165
                "version": 6.0,
166
                "name": "chatOpenAI",
167
                "type": "ChatOpenAI",
168
                "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
169
                "category": "Chat Models",
170
                "description": "Wrapper around OpenAI large language models that use the Chat endpoint",
171
                "inputParams": [
172
                    {
173
                        "label": "Connect Credential",
174
                        "name": "credential",
175
                        "type": "credential",
176
                        "credentialNames": ["openAIApi"],
177
                        "id": "chatOpenAI_0-input-credential-credential"
178
                    },
179
                    {
180
                        "label": "Model Name",
181
                        "name": "modelName",
182
                        "type": "asyncOptions",
183
                        "loadMethod": "listModels",
184
                        "default": "gpt-3.5-turbo",
185
                        "id": "chatOpenAI_0-input-modelName-options"
186
                    },
187
                    {
188
                        "label": "Temperature",
189
                        "name": "temperature",
190
                        "type": "number",
191
                        "default": 0.9,
192
                        "optional": true,
193
                        "id": "chatOpenAI_0-input-temperature-number"
194
                    },
195
                    {
196
                        "label": "Max Tokens",
197
                        "name": "maxTokens",
198
                        "type": "number",
199
                        "optional": true,
200
                        "additionalParams": true,
201
                        "id": "chatOpenAI_0-input-maxTokens-number"
202
                    },
203
                    {
204
                        "label": "Top Probability",
205
                        "name": "topP",
206
                        "type": "number",
207
                        "optional": true,
208
                        "additionalParams": true,
209
                        "id": "chatOpenAI_0-input-topP-number"
210
                    },
211
                    {
212
                        "label": "Frequency Penalty",
213
                        "name": "frequencyPenalty",
214
                        "type": "number",
215
                        "optional": true,
216
                        "additionalParams": true,
217
                        "id": "chatOpenAI_0-input-frequencyPenalty-number"
218
                    },
219
                    {
220
                        "label": "Presence Penalty",
221
                        "name": "presencePenalty",
222
                        "type": "number",
223
                        "optional": true,
224
                        "additionalParams": true,
225
                        "id": "chatOpenAI_0-input-presencePenalty-number"
226
                    },
227
                    {
228
                        "label": "Timeout",
229
                        "name": "timeout",
230
                        "type": "number",
231
                        "optional": true,
232
                        "additionalParams": true,
233
                        "id": "chatOpenAI_0-input-timeout-number"
234
                    },
235
                    {
236
                        "label": "BasePath",
237
                        "name": "basepath",
238
                        "type": "string",
239
                        "optional": true,
240
                        "additionalParams": true,
241
                        "id": "chatOpenAI_0-input-basepath-string"
242
                    },
243
                    {
244
                        "label": "BaseOptions",
245
                        "name": "baseOptions",
246
                        "type": "json",
247
                        "optional": true,
248
                        "additionalParams": true,
249
                        "id": "chatOpenAI_0-input-baseOptions-json"
250
                    },
251
                    {
252
                        "label": "Allow Image Uploads",
253
                        "name": "allowImageUploads",
254
                        "type": "boolean",
255
                        "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",
256
                        "default": false,
257
                        "optional": true,
258
                        "id": "chatOpenAI_0-input-allowImageUploads-boolean"
259
                    },
260
                    {
261
                        "label": "Image Resolution",
262
                        "description": "This parameter controls the resolution in which the model views the image.",
263
                        "name": "imageResolution",
264
                        "type": "options",
265
                        "options": [
266
                            {
267
                                "label": "Low",
268
                                "name": "low"
269
                            },
270
                            {
271
                                "label": "High",
272
                                "name": "high"
273
                            },
274
                            {
275
                                "label": "Auto",
276
                                "name": "auto"
277
                            }
278
                        ],
279
                        "default": "low",
280
                        "optional": false,
281
                        "additionalParams": true,
282
                        "id": "chatOpenAI_0-input-imageResolution-options"
283
                    }
284
                ],
285
                "inputAnchors": [
286
                    {
287
                        "label": "Cache",
288
                        "name": "cache",
289
                        "type": "BaseCache",
290
                        "optional": true,
291
                        "id": "chatOpenAI_0-input-cache-BaseCache"
292
                    }
293
                ],
294
                "inputs": {
295
                    "modelName": "gpt-3.5-turbo-16k",
296
                    "temperature": 0.9,
297
                    "maxTokens": "",
298
                    "topP": "",
299
                    "frequencyPenalty": "",
300
                    "presencePenalty": "",
301
                    "timeout": "",
302
                    "basepath": "",
303
                    "baseOptions": "",
304
                    "allowImageUploads": true,
305
                    "imageResolution": "low"
306
                },
307
                "outputAnchors": [
308
                    {
309
                        "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
310
                        "name": "chatOpenAI",
311
                        "label": "ChatOpenAI",
312
                        "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel"
313
                    }
314
                ],
315
                "outputs": {},
316
                "selected": false
317
            },
318
            "selected": false,
319
            "positionAbsolute": {
320
                "x": 97.01321406237057,
321
                "y": 63.67664262280914
322
            },
323
            "dragging": false
324
        },
325
        {
326
            "width": 300,
327
            "height": 383,
328
            "id": "conversationalAgent_0",
329
            "position": {
330
                "x": 1191.1524476753796,
331
                "y": 324.2479396683294
332
            },
333
            "type": "customNode",
334
            "data": {
335
                "id": "conversationalAgent_0",
336
                "label": "Conversational Agent",
337
                "version": 3,
338
                "name": "conversationalAgent",
339
                "type": "AgentExecutor",
340
                "baseClasses": ["AgentExecutor", "BaseChain", "Runnable"],
341
                "category": "Agents",
342
                "description": "Conversational agent for a chat model. It will utilize chat specific prompts",
343
                "inputParams": [
344
                    {
345
                        "label": "System Message",
346
                        "name": "systemMessage",
347
                        "type": "string",
348
                        "rows": 4,
349
                        "default": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful system that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.",
350
                        "optional": true,
351
                        "additionalParams": true,
352
                        "id": "conversationalAgent_0-input-systemMessage-string"
353
                    },
354
                    {
355
                        "label": "Max Iterations",
356
                        "name": "maxIterations",
357
                        "type": "number",
358
                        "optional": true,
359
                        "additionalParams": true,
360
                        "id": "conversationalAgent_0-input-maxIterations-number"
361
                    }
362
                ],
363
                "inputAnchors": [
364
                    {
365
                        "label": "Allowed Tools",
366
                        "name": "tools",
367
                        "type": "Tool",
368
                        "list": true,
369
                        "id": "conversationalAgent_0-input-tools-Tool"
370
                    },
371
                    {
372
                        "label": "Chat Model",
373
                        "name": "model",
374
                        "type": "BaseChatModel",
375
                        "id": "conversationalAgent_0-input-model-BaseChatModel"
376
                    },
377
                    {
378
                        "label": "Memory",
379
                        "name": "memory",
380
                        "type": "BaseChatMemory",
381
                        "id": "conversationalAgent_0-input-memory-BaseChatMemory"
382
                    },
383
                    {
384
                        "label": "Input Moderation",
385
                        "description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
386
                        "name": "inputModeration",
387
                        "type": "Moderation",
388
                        "optional": true,
389
                        "list": true,
390
                        "id": "conversationalAgent_0-input-inputModeration-Moderation"
391
                    }
392
                ],
393
                "inputs": {
394
                    "inputModeration": "",
395
                    "tools": ["{{calculator_1.data.instance}}", "{{serpAPI_0.data.instance}}"],
396
                    "model": "{{chatOpenAI_0.data.instance}}",
397
                    "memory": "{{bufferMemory_1.data.instance}}",
398
                    "systemMessage": "Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful system that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist."
399
                },
400
                "outputAnchors": [
401
                    {
402
                        "id": "conversationalAgent_0-output-conversationalAgent-AgentExecutor|BaseChain|Runnable",
403
                        "name": "conversationalAgent",
404
                        "label": "AgentExecutor",
405
                        "type": "AgentExecutor | BaseChain | Runnable"
406
                    }
407
                ],
408
                "outputs": {},
409
                "selected": false
410
            },
411
            "selected": false,
412
            "positionAbsolute": {
413
                "x": 1191.1524476753796,
414
                "y": 324.2479396683294
415
            },
416
            "dragging": false
417
        }
418
    ],
419
    "edges": [
420
        {
421
            "source": "calculator_1",
422
            "sourceHandle": "calculator_1-output-calculator-Calculator|Tool|StructuredTool|BaseLangChain",
423
            "target": "conversationalAgent_0",
424
            "targetHandle": "conversationalAgent_0-input-tools-Tool",
425
            "type": "buttonedge",
426
            "id": "calculator_1-calculator_1-output-calculator-Calculator|Tool|StructuredTool|BaseLangChain-conversationalAgent_0-conversationalAgent_0-input-tools-Tool",
427
            "data": {
428
                "label": ""
429
            }
430
        },
431
        {
432
            "source": "serpAPI_0",
433
            "sourceHandle": "serpAPI_0-output-serpAPI-SerpAPI|Tool|StructuredTool",
434
            "target": "conversationalAgent_0",
435
            "targetHandle": "conversationalAgent_0-input-tools-Tool",
436
            "type": "buttonedge",
437
            "id": "serpAPI_0-serpAPI_0-output-serpAPI-SerpAPI|Tool|StructuredTool-conversationalAgent_0-conversationalAgent_0-input-tools-Tool",
438
            "data": {
439
                "label": ""
440
            }
441
        },
442
        {
443
            "source": "chatOpenAI_0",
444
            "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
445
            "target": "conversationalAgent_0",
446
            "targetHandle": "conversationalAgent_0-input-model-BaseChatModel",
447
            "type": "buttonedge",
448
            "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-conversationalAgent_0-conversationalAgent_0-input-model-BaseChatModel",
449
            "data": {
450
                "label": ""
451
            }
452
        },
453
        {
454
            "source": "bufferMemory_1",
455
            "sourceHandle": "bufferMemory_1-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory",
456
            "target": "conversationalAgent_0",
457
            "targetHandle": "conversationalAgent_0-input-memory-BaseChatMemory",
458
            "type": "buttonedge",
459
            "id": "bufferMemory_1-bufferMemory_1-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory-conversationalAgent_0-conversationalAgent_0-input-memory-BaseChatMemory",
460
            "data": {
461
                "label": ""
462
            }
463
        }
464
    ]
465
}
466

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

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

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

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