Flowise

Форк
0
/
Prompt Chaining with VectorStore.json 
1109 строк · 46.8 Кб
1
{
2
    "description": "Use chat history to rephrase user question, and answer the rephrased question using retrieved docs from vector store",
3
    "categories": "ChatOpenAI,LLM Chain,SingleStore,Langchain",
4
    "badge": "POPULAR",
5
    "framework": "Langchain",
6
    "nodes": [
7
        {
8
            "width": 300,
9
            "height": 475,
10
            "id": "promptTemplate_0",
11
            "position": {
12
                "x": 344.73370692733414,
13
                "y": -122.34815000085804
14
            },
15
            "type": "customNode",
16
            "data": {
17
                "id": "promptTemplate_0",
18
                "label": "Prompt Template",
19
                "version": 1,
20
                "name": "promptTemplate",
21
                "type": "PromptTemplate",
22
                "baseClasses": ["PromptTemplate", "BaseStringPromptTemplate", "BasePromptTemplate", "Runnable"],
23
                "category": "Prompts",
24
                "description": "Schema to represent a basic prompt for an LLM",
25
                "inputParams": [
26
                    {
27
                        "label": "Template",
28
                        "name": "template",
29
                        "type": "string",
30
                        "rows": 4,
31
                        "placeholder": "What is a good name for a company that makes {product}?",
32
                        "id": "promptTemplate_0-input-template-string"
33
                    },
34
                    {
35
                        "label": "Format Prompt Values",
36
                        "name": "promptValues",
37
                        "type": "json",
38
                        "optional": true,
39
                        "acceptVariable": true,
40
                        "list": true,
41
                        "id": "promptTemplate_0-input-promptValues-json"
42
                    }
43
                ],
44
                "inputAnchors": [],
45
                "inputs": {
46
                    "template": "Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.\n\nChat History:\n{chat_history}\nFollow Up Input: {question}\nStandalone question:",
47
                    "promptValues": "{\"question\":\"{{question}}\",\"chat_history\":\"{{chat_history}}\"}"
48
                },
49
                "outputAnchors": [
50
                    {
51
                        "id": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable",
52
                        "name": "promptTemplate",
53
                        "label": "PromptTemplate",
54
                        "type": "PromptTemplate | BaseStringPromptTemplate | BasePromptTemplate | Runnable"
55
                    }
56
                ],
57
                "outputs": {},
58
                "selected": false
59
            },
60
            "selected": false,
61
            "positionAbsolute": {
62
                "x": 344.73370692733414,
63
                "y": -122.34815000085804
64
            },
65
            "dragging": false
66
        },
67
        {
68
            "width": 300,
69
            "height": 652,
70
            "id": "chatPromptTemplate_0",
71
            "position": {
72
                "x": 2290.8365353040026,
73
                "y": -168.49082887954518
74
            },
75
            "type": "customNode",
76
            "data": {
77
                "id": "chatPromptTemplate_0",
78
                "label": "Chat Prompt Template",
79
                "version": 1,
80
                "name": "chatPromptTemplate",
81
                "type": "ChatPromptTemplate",
82
                "baseClasses": ["ChatPromptTemplate", "BaseChatPromptTemplate", "BasePromptTemplate", "Runnable"],
83
                "category": "Prompts",
84
                "description": "Schema to represent a chat prompt",
85
                "inputParams": [
86
                    {
87
                        "label": "System Message",
88
                        "name": "systemMessagePrompt",
89
                        "type": "string",
90
                        "rows": 4,
91
                        "placeholder": "You are a helpful assistant that translates {input_language} to {output_language}.",
92
                        "id": "chatPromptTemplate_0-input-systemMessagePrompt-string"
93
                    },
94
                    {
95
                        "label": "Human Message",
96
                        "name": "humanMessagePrompt",
97
                        "type": "string",
98
                        "rows": 4,
99
                        "placeholder": "{text}",
100
                        "id": "chatPromptTemplate_0-input-humanMessagePrompt-string"
101
                    },
102
                    {
103
                        "label": "Format Prompt Values",
104
                        "name": "promptValues",
105
                        "type": "json",
106
                        "optional": true,
107
                        "acceptVariable": true,
108
                        "list": true,
109
                        "id": "chatPromptTemplate_0-input-promptValues-json"
110
                    }
111
                ],
112
                "inputAnchors": [],
113
                "inputs": {
114
                    "systemMessagePrompt": "Using the provided context, answer the user's question to the best of your ability using the resources provided. If there is nothing in the context relevant to the question at hand, just say \"Hmm, I'm not sure.\" Don't try to make up an answer.\n\nAnything between the following \\`context\\`  html blocks is retrieved from a knowledge bank, not part of the conversation with the user.\n\n<context>\n    {context}\n<context/>\n\nREMEMBER: If there is no relevant information within the context, just say \"Hmm, I'm not sure.\" Don't try to make up an answer. Anything between the preceding 'context' html blocks is retrieved from a knowledge bank, not part of the conversation with the user.",
115
                    "humanMessagePrompt": "{text}",
116
                    "promptValues": "{\"context\":\"{{vectorStoreToDocument_0.data.instance}}\",\"text\":\"{{question}}\"}"
117
                },
118
                "outputAnchors": [
119
                    {
120
                        "id": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable",
121
                        "name": "chatPromptTemplate",
122
                        "label": "ChatPromptTemplate",
123
                        "type": "ChatPromptTemplate | BaseChatPromptTemplate | BasePromptTemplate | Runnable"
124
                    }
125
                ],
126
                "outputs": {},
127
                "selected": false
128
            },
129
            "selected": false,
130
            "positionAbsolute": {
131
                "x": 2290.8365353040026,
132
                "y": -168.49082887954518
133
            },
134
            "dragging": false
135
        },
136
        {
137
            "width": 300,
138
            "height": 454,
139
            "id": "vectorStoreToDocument_0",
140
            "position": {
141
                "x": 1906.6871314089658,
142
                "y": -157.0046189166955
143
            },
144
            "type": "customNode",
145
            "data": {
146
                "id": "vectorStoreToDocument_0",
147
                "label": "VectorStore To Document",
148
                "version": 2,
149
                "name": "vectorStoreToDocument",
150
                "type": "Document",
151
                "baseClasses": ["Document"],
152
                "category": "Document Loaders",
153
                "description": "Search documents with scores from vector store",
154
                "inputParams": [
155
                    {
156
                        "label": "Query",
157
                        "name": "query",
158
                        "type": "string",
159
                        "description": "Query to retrieve documents from vector database. If not specified, user question will be used",
160
                        "optional": true,
161
                        "acceptVariable": true,
162
                        "id": "vectorStoreToDocument_0-input-query-string"
163
                    },
164
                    {
165
                        "label": "Minimum Score (%)",
166
                        "name": "minScore",
167
                        "type": "number",
168
                        "optional": true,
169
                        "placeholder": "75",
170
                        "step": 1,
171
                        "description": "Minumum score for embeddings documents to be included",
172
                        "id": "vectorStoreToDocument_0-input-minScore-number"
173
                    }
174
                ],
175
                "inputAnchors": [
176
                    {
177
                        "label": "Vector Store",
178
                        "name": "vectorStore",
179
                        "type": "VectorStore",
180
                        "id": "vectorStoreToDocument_0-input-vectorStore-VectorStore"
181
                    }
182
                ],
183
                "inputs": {
184
                    "vectorStore": "{{singlestore_0.data.instance}}",
185
                    "query": "{{llmChain_2.data.instance}}",
186
                    "minScore": ""
187
                },
188
                "outputAnchors": [
189
                    {
190
                        "name": "output",
191
                        "label": "Output",
192
                        "type": "options",
193
                        "options": [
194
                            {
195
                                "id": "vectorStoreToDocument_0-output-document-Document|json",
196
                                "name": "document",
197
                                "label": "Document",
198
                                "type": "Document | json"
199
                            },
200
                            {
201
                                "id": "vectorStoreToDocument_0-output-text-string|json",
202
                                "name": "text",
203
                                "label": "Text",
204
                                "type": "string | json"
205
                            }
206
                        ],
207
                        "default": "document"
208
                    }
209
                ],
210
                "outputs": {
211
                    "output": "text"
212
                },
213
                "selected": false
214
            },
215
            "selected": false,
216
            "positionAbsolute": {
217
                "x": 1906.6871314089658,
218
                "y": -157.0046189166955
219
            },
220
            "dragging": false
221
        },
222
        {
223
            "width": 300,
224
            "height": 456,
225
            "id": "llmChain_2",
226
            "position": {
227
                "x": 756.2678342825631,
228
                "y": -244.07972550448233
229
            },
230
            "type": "customNode",
231
            "data": {
232
                "id": "llmChain_2",
233
                "label": "LLM Chain",
234
                "version": 3,
235
                "name": "llmChain",
236
                "type": "LLMChain",
237
                "baseClasses": ["LLMChain", "BaseChain", "Runnable"],
238
                "category": "Chains",
239
                "description": "Chain to run queries against LLMs",
240
                "inputParams": [
241
                    {
242
                        "label": "Chain Name",
243
                        "name": "chainName",
244
                        "type": "string",
245
                        "placeholder": "Name Your Chain",
246
                        "optional": true,
247
                        "id": "llmChain_2-input-chainName-string"
248
                    }
249
                ],
250
                "inputAnchors": [
251
                    {
252
                        "label": "Language Model",
253
                        "name": "model",
254
                        "type": "BaseLanguageModel",
255
                        "id": "llmChain_2-input-model-BaseLanguageModel"
256
                    },
257
                    {
258
                        "label": "Prompt",
259
                        "name": "prompt",
260
                        "type": "BasePromptTemplate",
261
                        "id": "llmChain_2-input-prompt-BasePromptTemplate"
262
                    },
263
                    {
264
                        "label": "Output Parser",
265
                        "name": "outputParser",
266
                        "type": "BaseLLMOutputParser",
267
                        "optional": true,
268
                        "id": "llmChain_2-input-outputParser-BaseLLMOutputParser"
269
                    },
270
                    {
271
                        "label": "Input Moderation",
272
                        "description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
273
                        "name": "inputModeration",
274
                        "type": "Moderation",
275
                        "optional": true,
276
                        "list": true,
277
                        "id": "llmChain_2-input-inputModeration-Moderation"
278
                    }
279
                ],
280
                "inputs": {
281
                    "model": "{{chatOpenAI_0.data.instance}}",
282
                    "prompt": "{{promptTemplate_0.data.instance}}",
283
                    "outputParser": "",
284
                    "chainName": "RephraseQuestion",
285
                    "inputModeration": ""
286
                },
287
                "outputAnchors": [
288
                    {
289
                        "name": "output",
290
                        "label": "Output",
291
                        "type": "options",
292
                        "options": [
293
                            {
294
                                "id": "llmChain_2-output-llmChain-LLMChain|BaseChain|Runnable",
295
                                "name": "llmChain",
296
                                "label": "LLM Chain",
297
                                "type": "LLMChain | BaseChain | Runnable"
298
                            },
299
                            {
300
                                "id": "llmChain_2-output-outputPrediction-string|json",
301
                                "name": "outputPrediction",
302
                                "label": "Output Prediction",
303
                                "type": "string | json"
304
                            }
305
                        ],
306
                        "default": "llmChain"
307
                    }
308
                ],
309
                "outputs": {
310
                    "output": "outputPrediction"
311
                },
312
                "selected": false
313
            },
314
            "selected": false,
315
            "positionAbsolute": {
316
                "x": 756.2678342825631,
317
                "y": -244.07972550448233
318
            },
319
            "dragging": false
320
        },
321
        {
322
            "width": 300,
323
            "height": 456,
324
            "id": "llmChain_1",
325
            "position": {
326
                "x": 2684.08901232628,
327
                "y": -301.4742415779482
328
            },
329
            "type": "customNode",
330
            "data": {
331
                "id": "llmChain_1",
332
                "label": "LLM Chain",
333
                "version": 3,
334
                "name": "llmChain",
335
                "type": "LLMChain",
336
                "baseClasses": ["LLMChain", "BaseChain", "Runnable"],
337
                "category": "Chains",
338
                "description": "Chain to run queries against LLMs",
339
                "inputParams": [
340
                    {
341
                        "label": "Chain Name",
342
                        "name": "chainName",
343
                        "type": "string",
344
                        "placeholder": "Name Your Chain",
345
                        "optional": true,
346
                        "id": "llmChain_1-input-chainName-string"
347
                    }
348
                ],
349
                "inputAnchors": [
350
                    {
351
                        "label": "Language Model",
352
                        "name": "model",
353
                        "type": "BaseLanguageModel",
354
                        "id": "llmChain_1-input-model-BaseLanguageModel"
355
                    },
356
                    {
357
                        "label": "Prompt",
358
                        "name": "prompt",
359
                        "type": "BasePromptTemplate",
360
                        "id": "llmChain_1-input-prompt-BasePromptTemplate"
361
                    },
362
                    {
363
                        "label": "Output Parser",
364
                        "name": "outputParser",
365
                        "type": "BaseLLMOutputParser",
366
                        "optional": true,
367
                        "id": "llmChain_1-input-outputParser-BaseLLMOutputParser"
368
                    },
369
                    {
370
                        "label": "Input Moderation",
371
                        "description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
372
                        "name": "inputModeration",
373
                        "type": "Moderation",
374
                        "optional": true,
375
                        "list": true,
376
                        "id": "llmChain_1-input-inputModeration-Moderation"
377
                    }
378
                ],
379
                "inputs": {
380
                    "model": "{{chatOpenAI_1.data.instance}}",
381
                    "prompt": "{{chatPromptTemplate_0.data.instance}}",
382
                    "outputParser": "",
383
                    "chainName": "FinalResponse",
384
                    "inputModeration": ""
385
                },
386
                "outputAnchors": [
387
                    {
388
                        "name": "output",
389
                        "label": "Output",
390
                        "type": "options",
391
                        "options": [
392
                            {
393
                                "id": "llmChain_1-output-llmChain-LLMChain|BaseChain|Runnable",
394
                                "name": "llmChain",
395
                                "label": "LLM Chain",
396
                                "type": "LLMChain | BaseChain | Runnable"
397
                            },
398
                            {
399
                                "id": "llmChain_1-output-outputPrediction-string|json",
400
                                "name": "outputPrediction",
401
                                "label": "Output Prediction",
402
                                "type": "string | json"
403
                            }
404
                        ],
405
                        "default": "llmChain"
406
                    }
407
                ],
408
                "outputs": {
409
                    "output": "llmChain"
410
                },
411
                "selected": false
412
            },
413
            "selected": false,
414
            "positionAbsolute": {
415
                "x": 2684.08901232628,
416
                "y": -301.4742415779482
417
            },
418
            "dragging": false
419
        },
420
        {
421
            "width": 300,
422
            "height": 574,
423
            "id": "chatOpenAI_0",
424
            "position": {
425
                "x": 339.96857057520754,
426
                "y": -732.8078068632885
427
            },
428
            "type": "customNode",
429
            "data": {
430
                "id": "chatOpenAI_0",
431
                "label": "ChatOpenAI",
432
                "version": 6.0,
433
                "name": "chatOpenAI",
434
                "type": "ChatOpenAI",
435
                "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
436
                "category": "Chat Models",
437
                "description": "Wrapper around OpenAI large language models that use the Chat endpoint",
438
                "inputParams": [
439
                    {
440
                        "label": "Connect Credential",
441
                        "name": "credential",
442
                        "type": "credential",
443
                        "credentialNames": ["openAIApi"],
444
                        "id": "chatOpenAI_0-input-credential-credential"
445
                    },
446
                    {
447
                        "label": "Model Name",
448
                        "name": "modelName",
449
                        "type": "asyncOptions",
450
                        "loadMethod": "listModels",
451
                        "default": "gpt-3.5-turbo",
452
                        "id": "chatOpenAI_0-input-modelName-options"
453
                    },
454
                    {
455
                        "label": "Temperature",
456
                        "name": "temperature",
457
                        "type": "number",
458
                        "step": 0.1,
459
                        "default": 0.9,
460
                        "optional": true,
461
                        "id": "chatOpenAI_0-input-temperature-number"
462
                    },
463
                    {
464
                        "label": "Max Tokens",
465
                        "name": "maxTokens",
466
                        "type": "number",
467
                        "step": 1,
468
                        "optional": true,
469
                        "additionalParams": true,
470
                        "id": "chatOpenAI_0-input-maxTokens-number"
471
                    },
472
                    {
473
                        "label": "Top Probability",
474
                        "name": "topP",
475
                        "type": "number",
476
                        "step": 0.1,
477
                        "optional": true,
478
                        "additionalParams": true,
479
                        "id": "chatOpenAI_0-input-topP-number"
480
                    },
481
                    {
482
                        "label": "Frequency Penalty",
483
                        "name": "frequencyPenalty",
484
                        "type": "number",
485
                        "step": 0.1,
486
                        "optional": true,
487
                        "additionalParams": true,
488
                        "id": "chatOpenAI_0-input-frequencyPenalty-number"
489
                    },
490
                    {
491
                        "label": "Presence Penalty",
492
                        "name": "presencePenalty",
493
                        "type": "number",
494
                        "step": 0.1,
495
                        "optional": true,
496
                        "additionalParams": true,
497
                        "id": "chatOpenAI_0-input-presencePenalty-number"
498
                    },
499
                    {
500
                        "label": "Timeout",
501
                        "name": "timeout",
502
                        "type": "number",
503
                        "step": 1,
504
                        "optional": true,
505
                        "additionalParams": true,
506
                        "id": "chatOpenAI_0-input-timeout-number"
507
                    },
508
                    {
509
                        "label": "BasePath",
510
                        "name": "basepath",
511
                        "type": "string",
512
                        "optional": true,
513
                        "additionalParams": true,
514
                        "id": "chatOpenAI_0-input-basepath-string"
515
                    },
516
                    {
517
                        "label": "BaseOptions",
518
                        "name": "baseOptions",
519
                        "type": "json",
520
                        "optional": true,
521
                        "additionalParams": true,
522
                        "id": "chatOpenAI_0-input-baseOptions-json"
523
                    },
524
                    {
525
                        "label": "Allow Image Uploads",
526
                        "name": "allowImageUploads",
527
                        "type": "boolean",
528
                        "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",
529
                        "default": false,
530
                        "optional": true,
531
                        "id": "chatOpenAI_0-input-allowImageUploads-boolean"
532
                    },
533
                    {
534
                        "label": "Image Resolution",
535
                        "description": "This parameter controls the resolution in which the model views the image.",
536
                        "name": "imageResolution",
537
                        "type": "options",
538
                        "options": [
539
                            {
540
                                "label": "Low",
541
                                "name": "low"
542
                            },
543
                            {
544
                                "label": "High",
545
                                "name": "high"
546
                            },
547
                            {
548
                                "label": "Auto",
549
                                "name": "auto"
550
                            }
551
                        ],
552
                        "default": "low",
553
                        "optional": false,
554
                        "additionalParams": true,
555
                        "id": "chatOpenAI_0-input-imageResolution-options"
556
                    }
557
                ],
558
                "inputAnchors": [
559
                    {
560
                        "label": "Cache",
561
                        "name": "cache",
562
                        "type": "BaseCache",
563
                        "optional": true,
564
                        "id": "chatOpenAI_0-input-cache-BaseCache"
565
                    }
566
                ],
567
                "inputs": {
568
                    "cache": "",
569
                    "modelName": "gpt-3.5-turbo-16k",
570
                    "temperature": "0",
571
                    "maxTokens": "",
572
                    "topP": "",
573
                    "frequencyPenalty": "",
574
                    "presencePenalty": "",
575
                    "timeout": "",
576
                    "basepath": "",
577
                    "baseOptions": "",
578
                    "allowImageUploads": true,
579
                    "imageResolution": "low"
580
                },
581
                "outputAnchors": [
582
                    {
583
                        "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
584
                        "name": "chatOpenAI",
585
                        "label": "ChatOpenAI",
586
                        "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable"
587
                    }
588
                ],
589
                "outputs": {},
590
                "selected": false
591
            },
592
            "selected": false,
593
            "positionAbsolute": {
594
                "x": 339.96857057520754,
595
                "y": -732.8078068632885
596
            },
597
            "dragging": false
598
        },
599
        {
600
            "width": 300,
601
            "height": 574,
602
            "id": "chatOpenAI_1",
603
            "position": {
604
                "x": 2291.510577325338,
605
                "y": -785.9138727666948
606
            },
607
            "type": "customNode",
608
            "data": {
609
                "id": "chatOpenAI_1",
610
                "label": "ChatOpenAI",
611
                "version": 6.0,
612
                "name": "chatOpenAI",
613
                "type": "ChatOpenAI",
614
                "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"],
615
                "category": "Chat Models",
616
                "description": "Wrapper around OpenAI large language models that use the Chat endpoint",
617
                "inputParams": [
618
                    {
619
                        "label": "Connect Credential",
620
                        "name": "credential",
621
                        "type": "credential",
622
                        "credentialNames": ["openAIApi"],
623
                        "id": "chatOpenAI_1-input-credential-credential"
624
                    },
625
                    {
626
                        "label": "Model Name",
627
                        "name": "modelName",
628
                        "type": "asyncOptions",
629
                        "loadMethod": "listModels",
630
                        "default": "gpt-3.5-turbo",
631
                        "id": "chatOpenAI_1-input-modelName-options"
632
                    },
633
                    {
634
                        "label": "Temperature",
635
                        "name": "temperature",
636
                        "type": "number",
637
                        "step": 0.1,
638
                        "default": 0.9,
639
                        "optional": true,
640
                        "id": "chatOpenAI_1-input-temperature-number"
641
                    },
642
                    {
643
                        "label": "Max Tokens",
644
                        "name": "maxTokens",
645
                        "type": "number",
646
                        "step": 1,
647
                        "optional": true,
648
                        "additionalParams": true,
649
                        "id": "chatOpenAI_1-input-maxTokens-number"
650
                    },
651
                    {
652
                        "label": "Top Probability",
653
                        "name": "topP",
654
                        "type": "number",
655
                        "step": 0.1,
656
                        "optional": true,
657
                        "additionalParams": true,
658
                        "id": "chatOpenAI_1-input-topP-number"
659
                    },
660
                    {
661
                        "label": "Frequency Penalty",
662
                        "name": "frequencyPenalty",
663
                        "type": "number",
664
                        "step": 0.1,
665
                        "optional": true,
666
                        "additionalParams": true,
667
                        "id": "chatOpenAI_1-input-frequencyPenalty-number"
668
                    },
669
                    {
670
                        "label": "Presence Penalty",
671
                        "name": "presencePenalty",
672
                        "type": "number",
673
                        "step": 0.1,
674
                        "optional": true,
675
                        "additionalParams": true,
676
                        "id": "chatOpenAI_1-input-presencePenalty-number"
677
                    },
678
                    {
679
                        "label": "Timeout",
680
                        "name": "timeout",
681
                        "type": "number",
682
                        "step": 1,
683
                        "optional": true,
684
                        "additionalParams": true,
685
                        "id": "chatOpenAI_1-input-timeout-number"
686
                    },
687
                    {
688
                        "label": "BasePath",
689
                        "name": "basepath",
690
                        "type": "string",
691
                        "optional": true,
692
                        "additionalParams": true,
693
                        "id": "chatOpenAI_1-input-basepath-string"
694
                    },
695
                    {
696
                        "label": "BaseOptions",
697
                        "name": "baseOptions",
698
                        "type": "json",
699
                        "optional": true,
700
                        "additionalParams": true,
701
                        "id": "chatOpenAI_1-input-baseOptions-json"
702
                    },
703
                    {
704
                        "label": "Allow Image Uploads",
705
                        "name": "allowImageUploads",
706
                        "type": "boolean",
707
                        "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",
708
                        "default": false,
709
                        "optional": true,
710
                        "id": "chatOpenAI_1-input-allowImageUploads-boolean"
711
                    },
712
                    {
713
                        "label": "Image Resolution",
714
                        "description": "This parameter controls the resolution in which the model views the image.",
715
                        "name": "imageResolution",
716
                        "type": "options",
717
                        "options": [
718
                            {
719
                                "label": "Low",
720
                                "name": "low"
721
                            },
722
                            {
723
                                "label": "High",
724
                                "name": "high"
725
                            },
726
                            {
727
                                "label": "Auto",
728
                                "name": "auto"
729
                            }
730
                        ],
731
                        "default": "low",
732
                        "optional": false,
733
                        "additionalParams": true,
734
                        "id": "chatOpenAI_1-input-imageResolution-options"
735
                    }
736
                ],
737
                "inputAnchors": [
738
                    {
739
                        "label": "Cache",
740
                        "name": "cache",
741
                        "type": "BaseCache",
742
                        "optional": true,
743
                        "id": "chatOpenAI_1-input-cache-BaseCache"
744
                    }
745
                ],
746
                "inputs": {
747
                    "cache": "",
748
                    "modelName": "gpt-3.5-turbo-16k",
749
                    "temperature": "0",
750
                    "maxTokens": "",
751
                    "topP": "",
752
                    "frequencyPenalty": "",
753
                    "presencePenalty": "",
754
                    "timeout": "",
755
                    "basepath": "",
756
                    "baseOptions": "",
757
                    "allowImageUploads": true,
758
                    "imageResolution": "low"
759
                },
760
                "outputAnchors": [
761
                    {
762
                        "id": "chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
763
                        "name": "chatOpenAI",
764
                        "label": "ChatOpenAI",
765
                        "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable"
766
                    }
767
                ],
768
                "outputs": {},
769
                "selected": false
770
            },
771
            "selected": false,
772
            "positionAbsolute": {
773
                "x": 2291.510577325338,
774
                "y": -785.9138727666948
775
            },
776
            "dragging": false
777
        },
778
        {
779
            "width": 300,
780
            "height": 654,
781
            "id": "singlestore_0",
782
            "position": {
783
                "x": 1530.532503048084,
784
                "y": -657.3586990397077
785
            },
786
            "type": "customNode",
787
            "data": {
788
                "id": "singlestore_0",
789
                "label": "SingleStore",
790
                "version": 1,
791
                "name": "singlestore",
792
                "type": "SingleStore",
793
                "baseClasses": ["SingleStore", "VectorStoreRetriever", "BaseRetriever"],
794
                "category": "Vector Stores",
795
                "description": "Upsert embedded data and perform similarity search upon query using SingleStore, a fast and distributed cloud relational database",
796
                "inputParams": [
797
                    {
798
                        "label": "Connect Credential",
799
                        "name": "credential",
800
                        "type": "credential",
801
                        "description": "Needed when using SingleStore cloud hosted",
802
                        "optional": true,
803
                        "credentialNames": ["singleStoreApi"],
804
                        "id": "singlestore_0-input-credential-credential"
805
                    },
806
                    {
807
                        "label": "Host",
808
                        "name": "host",
809
                        "type": "string",
810
                        "id": "singlestore_0-input-host-string"
811
                    },
812
                    {
813
                        "label": "Database",
814
                        "name": "database",
815
                        "type": "string",
816
                        "id": "singlestore_0-input-database-string"
817
                    },
818
                    {
819
                        "label": "Table Name",
820
                        "name": "tableName",
821
                        "type": "string",
822
                        "placeholder": "embeddings",
823
                        "additionalParams": true,
824
                        "optional": true,
825
                        "id": "singlestore_0-input-tableName-string"
826
                    },
827
                    {
828
                        "label": "Content Column Name",
829
                        "name": "contentColumnName",
830
                        "type": "string",
831
                        "placeholder": "content",
832
                        "additionalParams": true,
833
                        "optional": true,
834
                        "id": "singlestore_0-input-contentColumnName-string"
835
                    },
836
                    {
837
                        "label": "Vector Column Name",
838
                        "name": "vectorColumnName",
839
                        "type": "string",
840
                        "placeholder": "vector",
841
                        "additionalParams": true,
842
                        "optional": true,
843
                        "id": "singlestore_0-input-vectorColumnName-string"
844
                    },
845
                    {
846
                        "label": "Metadata Column Name",
847
                        "name": "metadataColumnName",
848
                        "type": "string",
849
                        "placeholder": "metadata",
850
                        "additionalParams": true,
851
                        "optional": true,
852
                        "id": "singlestore_0-input-metadataColumnName-string"
853
                    },
854
                    {
855
                        "label": "Top K",
856
                        "name": "topK",
857
                        "placeholder": "4",
858
                        "type": "number",
859
                        "additionalParams": true,
860
                        "optional": true,
861
                        "id": "singlestore_0-input-topK-number"
862
                    }
863
                ],
864
                "inputAnchors": [
865
                    {
866
                        "label": "Document",
867
                        "name": "document",
868
                        "type": "Document",
869
                        "list": true,
870
                        "optional": true,
871
                        "id": "singlestore_0-input-document-Document"
872
                    },
873
                    {
874
                        "label": "Embeddings",
875
                        "name": "embeddings",
876
                        "type": "Embeddings",
877
                        "id": "singlestore_0-input-embeddings-Embeddings"
878
                    }
879
                ],
880
                "inputs": {
881
                    "document": "",
882
                    "embeddings": "{{openAIEmbeddings_0.data.instance}}",
883
                    "host": "",
884
                    "database": "",
885
                    "tableName": "",
886
                    "contentColumnName": "",
887
                    "vectorColumnName": "",
888
                    "metadataColumnName": "",
889
                    "topK": ""
890
                },
891
                "outputAnchors": [
892
                    {
893
                        "name": "output",
894
                        "label": "Output",
895
                        "type": "options",
896
                        "options": [
897
                            {
898
                                "id": "singlestore_0-output-retriever-SingleStore|VectorStoreRetriever|BaseRetriever",
899
                                "name": "retriever",
900
                                "label": "SingleStore Retriever",
901
                                "type": "SingleStore | VectorStoreRetriever | BaseRetriever"
902
                            },
903
                            {
904
                                "id": "singlestore_0-output-vectorStore-SingleStore|VectorStore",
905
                                "name": "vectorStore",
906
                                "label": "SingleStore Vector Store",
907
                                "type": "SingleStore | VectorStore"
908
                            }
909
                        ],
910
                        "default": "retriever"
911
                    }
912
                ],
913
                "outputs": {
914
                    "output": "vectorStore"
915
                },
916
                "selected": false
917
            },
918
            "selected": false,
919
            "positionAbsolute": {
920
                "x": 1530.532503048084,
921
                "y": -657.3586990397077
922
            },
923
            "dragging": false
924
        },
925
        {
926
            "width": 300,
927
            "height": 329,
928
            "id": "openAIEmbeddings_0",
929
            "position": {
930
                "x": 1154.293946350955,
931
                "y": -589.6072684085893
932
            },
933
            "type": "customNode",
934
            "data": {
935
                "id": "openAIEmbeddings_0",
936
                "label": "OpenAI Embeddings",
937
                "version": 3,
938
                "name": "openAIEmbeddings",
939
                "type": "OpenAIEmbeddings",
940
                "baseClasses": ["OpenAIEmbeddings", "Embeddings"],
941
                "category": "Embeddings",
942
                "description": "OpenAI API to generate embeddings for a given text",
943
                "inputParams": [
944
                    {
945
                        "label": "Connect Credential",
946
                        "name": "credential",
947
                        "type": "credential",
948
                        "credentialNames": ["openAIApi"],
949
                        "id": "openAIEmbeddings_0-input-credential-credential"
950
                    },
951
                    {
952
                        "label": "Model Name",
953
                        "name": "modelName",
954
                        "type": "asyncOptions",
955
                        "loadMethod": "listModels",
956
                        "default": "text-embedding-ada-002",
957
                        "id": "openAIEmbeddings_0-input-modelName-options"
958
                    },
959
                    {
960
                        "label": "Strip New Lines",
961
                        "name": "stripNewLines",
962
                        "type": "boolean",
963
                        "optional": true,
964
                        "additionalParams": true,
965
                        "id": "openAIEmbeddings_0-input-stripNewLines-boolean"
966
                    },
967
                    {
968
                        "label": "Batch Size",
969
                        "name": "batchSize",
970
                        "type": "number",
971
                        "optional": true,
972
                        "additionalParams": true,
973
                        "id": "openAIEmbeddings_0-input-batchSize-number"
974
                    },
975
                    {
976
                        "label": "Timeout",
977
                        "name": "timeout",
978
                        "type": "number",
979
                        "optional": true,
980
                        "additionalParams": true,
981
                        "id": "openAIEmbeddings_0-input-timeout-number"
982
                    },
983
                    {
984
                        "label": "BasePath",
985
                        "name": "basepath",
986
                        "type": "string",
987
                        "optional": true,
988
                        "additionalParams": true,
989
                        "id": "openAIEmbeddings_0-input-basepath-string"
990
                    }
991
                ],
992
                "inputAnchors": [],
993
                "inputs": {
994
                    "stripNewLines": "",
995
                    "batchSize": "",
996
                    "timeout": "",
997
                    "basepath": "",
998
                    "modelName": "text-embedding-ada-002"
999
                },
1000
                "outputAnchors": [
1001
                    {
1002
                        "id": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings",
1003
                        "name": "openAIEmbeddings",
1004
                        "label": "OpenAIEmbeddings",
1005
                        "type": "OpenAIEmbeddings | Embeddings"
1006
                    }
1007
                ],
1008
                "outputs": {},
1009
                "selected": false
1010
            },
1011
            "selected": false,
1012
            "positionAbsolute": {
1013
                "x": 1154.293946350955,
1014
                "y": -589.6072684085893
1015
            },
1016
            "dragging": false
1017
        }
1018
    ],
1019
    "edges": [
1020
        {
1021
            "source": "vectorStoreToDocument_0",
1022
            "sourceHandle": "vectorStoreToDocument_0-output-text-string|json",
1023
            "target": "chatPromptTemplate_0",
1024
            "targetHandle": "chatPromptTemplate_0-input-promptValues-json",
1025
            "type": "buttonedge",
1026
            "id": "vectorStoreToDocument_0-vectorStoreToDocument_0-output-text-string|json-chatPromptTemplate_0-chatPromptTemplate_0-input-promptValues-json",
1027
            "data": {
1028
                "label": ""
1029
            }
1030
        },
1031
        {
1032
            "source": "promptTemplate_0",
1033
            "sourceHandle": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable",
1034
            "target": "llmChain_2",
1035
            "targetHandle": "llmChain_2-input-prompt-BasePromptTemplate",
1036
            "type": "buttonedge",
1037
            "id": "promptTemplate_0-promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable-llmChain_2-llmChain_2-input-prompt-BasePromptTemplate",
1038
            "data": {
1039
                "label": ""
1040
            }
1041
        },
1042
        {
1043
            "source": "llmChain_2",
1044
            "sourceHandle": "llmChain_2-output-outputPrediction-string|json",
1045
            "target": "vectorStoreToDocument_0",
1046
            "targetHandle": "vectorStoreToDocument_0-input-query-string",
1047
            "type": "buttonedge",
1048
            "id": "llmChain_2-llmChain_2-output-outputPrediction-string|json-vectorStoreToDocument_0-vectorStoreToDocument_0-input-query-string",
1049
            "data": {
1050
                "label": ""
1051
            }
1052
        },
1053
        {
1054
            "source": "chatPromptTemplate_0",
1055
            "sourceHandle": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable",
1056
            "target": "llmChain_1",
1057
            "targetHandle": "llmChain_1-input-prompt-BasePromptTemplate",
1058
            "type": "buttonedge",
1059
            "id": "chatPromptTemplate_0-chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable-llmChain_1-llmChain_1-input-prompt-BasePromptTemplate",
1060
            "data": {
1061
                "label": ""
1062
            }
1063
        },
1064
        {
1065
            "source": "chatOpenAI_0",
1066
            "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
1067
            "target": "llmChain_2",
1068
            "targetHandle": "llmChain_2-input-model-BaseLanguageModel",
1069
            "type": "buttonedge",
1070
            "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_2-llmChain_2-input-model-BaseLanguageModel",
1071
            "data": {
1072
                "label": ""
1073
            }
1074
        },
1075
        {
1076
            "source": "chatOpenAI_1",
1077
            "sourceHandle": "chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
1078
            "target": "llmChain_1",
1079
            "targetHandle": "llmChain_1-input-model-BaseLanguageModel",
1080
            "type": "buttonedge",
1081
            "id": "chatOpenAI_1-chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_1-llmChain_1-input-model-BaseLanguageModel",
1082
            "data": {
1083
                "label": ""
1084
            }
1085
        },
1086
        {
1087
            "source": "singlestore_0",
1088
            "sourceHandle": "singlestore_0-output-vectorStore-SingleStore|VectorStore",
1089
            "target": "vectorStoreToDocument_0",
1090
            "targetHandle": "vectorStoreToDocument_0-input-vectorStore-VectorStore",
1091
            "type": "buttonedge",
1092
            "id": "singlestore_0-singlestore_0-output-vectorStore-SingleStore|VectorStore-vectorStoreToDocument_0-vectorStoreToDocument_0-input-vectorStore-VectorStore",
1093
            "data": {
1094
                "label": ""
1095
            }
1096
        },
1097
        {
1098
            "source": "openAIEmbeddings_0",
1099
            "sourceHandle": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings",
1100
            "target": "singlestore_0",
1101
            "targetHandle": "singlestore_0-input-embeddings-Embeddings",
1102
            "type": "buttonedge",
1103
            "id": "openAIEmbeddings_0-openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings-singlestore_0-singlestore_0-input-embeddings-Embeddings",
1104
            "data": {
1105
                "label": ""
1106
            }
1107
        }
1108
    ]
1109
}
1110

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

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

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

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