Flowise
711 строк · 29.7 Кб
1{
2"description": "Use OpenAI Tool Agent and Chain to automatically decide which API to call, generating url and body request from conversation",
3"categories": "Buffer Memory,ChainTool,API Chain,ChatOpenAI,OpenAI Tool Agent,Langchain",
4"framework": "Langchain",
5"nodes": [
6{
7"width": 300,
8"height": 540,
9"id": "openApiChain_1",
10"position": {
11"x": 1203.1825726424859,
12"y": 300.7226683414998
13},
14"type": "customNode",
15"data": {
16"id": "openApiChain_1",
17"label": "OpenAPI Chain",
18"version": 2,
19"name": "openApiChain",
20"type": "OpenAPIChain",
21"baseClasses": ["OpenAPIChain", "BaseChain"],
22"category": "Chains",
23"description": "Chain that automatically select and call APIs based only on an OpenAPI spec",
24"inputParams": [
25{
26"label": "YAML Link",
27"name": "yamlLink",
28"type": "string",
29"placeholder": "https://api.speak.com/openapi.yaml",
30"description": "If YAML link is provided, uploaded YAML File will be ignored and YAML link will be used instead",
31"id": "openApiChain_1-input-yamlLink-string"
32},
33{
34"label": "YAML File",
35"name": "yamlFile",
36"type": "file",
37"fileType": ".yaml",
38"description": "If YAML link is provided, uploaded YAML File will be ignored and YAML link will be used instead",
39"id": "openApiChain_1-input-yamlFile-file"
40},
41{
42"label": "Headers",
43"name": "headers",
44"type": "json",
45"additionalParams": true,
46"optional": true,
47"id": "openApiChain_1-input-headers-json"
48}
49],
50"inputAnchors": [
51{
52"label": "ChatOpenAI Model",
53"name": "model",
54"type": "ChatOpenAI",
55"id": "openApiChain_1-input-model-ChatOpenAI"
56},
57{
58"label": "Input Moderation",
59"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
60"name": "inputModeration",
61"type": "Moderation",
62"optional": true,
63"list": true,
64"id": "openApiChain_1-input-inputModeration-Moderation"
65}
66],
67"inputs": {
68"inputModeration": "",
69"model": "{{chatOpenAI_1.data.instance}}",
70"yamlLink": "https://gist.githubusercontent.com/roaldnefs/053e505b2b7a807290908fe9aa3e1f00/raw/0a212622ebfef501163f91e23803552411ed00e4/openapi.yaml",
71"headers": ""
72},
73"outputAnchors": [
74{
75"id": "openApiChain_1-output-openApiChain-OpenAPIChain|BaseChain",
76"name": "openApiChain",
77"label": "OpenAPIChain",
78"type": "OpenAPIChain | BaseChain"
79}
80],
81"outputs": {},
82"selected": false
83},
84"selected": false,
85"positionAbsolute": {
86"x": 1203.1825726424859,
87"y": 300.7226683414998
88},
89"dragging": false
90},
91{
92"width": 300,
93"height": 670,
94"id": "chatOpenAI_1",
95"position": {
96"x": 792.3201947594027,
97"y": 293.61889966751846
98},
99"type": "customNode",
100"data": {
101"id": "chatOpenAI_1",
102"label": "ChatOpenAI",
103"version": 6.0,
104"name": "chatOpenAI",
105"type": "ChatOpenAI",
106"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
107"category": "Chat Models",
108"description": "Wrapper around OpenAI large language models that use the Chat endpoint",
109"inputParams": [
110{
111"label": "Connect Credential",
112"name": "credential",
113"type": "credential",
114"credentialNames": ["openAIApi"],
115"id": "chatOpenAI_1-input-credential-credential"
116},
117{
118"label": "Model Name",
119"name": "modelName",
120"type": "asyncOptions",
121"loadMethod": "listModels",
122"default": "gpt-3.5-turbo",
123"id": "chatOpenAI_1-input-modelName-options"
124},
125{
126"label": "Temperature",
127"name": "temperature",
128"type": "number",
129"default": 0.9,
130"optional": true,
131"id": "chatOpenAI_1-input-temperature-number"
132},
133{
134"label": "Max Tokens",
135"name": "maxTokens",
136"type": "number",
137"optional": true,
138"additionalParams": true,
139"id": "chatOpenAI_1-input-maxTokens-number"
140},
141{
142"label": "Top Probability",
143"name": "topP",
144"type": "number",
145"optional": true,
146"additionalParams": true,
147"id": "chatOpenAI_1-input-topP-number"
148},
149{
150"label": "Frequency Penalty",
151"name": "frequencyPenalty",
152"type": "number",
153"optional": true,
154"additionalParams": true,
155"id": "chatOpenAI_1-input-frequencyPenalty-number"
156},
157{
158"label": "Presence Penalty",
159"name": "presencePenalty",
160"type": "number",
161"optional": true,
162"additionalParams": true,
163"id": "chatOpenAI_1-input-presencePenalty-number"
164},
165{
166"label": "Timeout",
167"name": "timeout",
168"type": "number",
169"optional": true,
170"additionalParams": true,
171"id": "chatOpenAI_1-input-timeout-number"
172},
173{
174"label": "BasePath",
175"name": "basepath",
176"type": "string",
177"optional": true,
178"additionalParams": true,
179"id": "chatOpenAI_1-input-basepath-string"
180},
181{
182"label": "BaseOptions",
183"name": "baseOptions",
184"type": "json",
185"optional": true,
186"additionalParams": true,
187"id": "chatOpenAI_1-input-baseOptions-json"
188},
189{
190"label": "Allow Image Uploads",
191"name": "allowImageUploads",
192"type": "boolean",
193"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",
194"default": false,
195"optional": true,
196"id": "chatOpenAI_1-input-allowImageUploads-boolean"
197},
198{
199"label": "Image Resolution",
200"description": "This parameter controls the resolution in which the model views the image.",
201"name": "imageResolution",
202"type": "options",
203"options": [
204{
205"label": "Low",
206"name": "low"
207},
208{
209"label": "High",
210"name": "high"
211},
212{
213"label": "Auto",
214"name": "auto"
215}
216],
217"default": "low",
218"optional": false,
219"additionalParams": true,
220"id": "chatOpenAI_1-input-imageResolution-options"
221}
222],
223"inputAnchors": [
224{
225"label": "Cache",
226"name": "cache",
227"type": "BaseCache",
228"optional": true,
229"id": "chatOpenAI_1-input-cache-BaseCache"
230}
231],
232"inputs": {
233"modelName": "gpt-3.5-turbo",
234"temperature": 0.9,
235"maxTokens": "",
236"topP": "",
237"frequencyPenalty": "",
238"presencePenalty": "",
239"timeout": "",
240"basepath": "",
241"baseOptions": "",
242"allowImageUploads": true,
243"imageResolution": "low"
244},
245"outputAnchors": [
246{
247"id": "chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
248"name": "chatOpenAI",
249"label": "ChatOpenAI",
250"type": "ChatOpenAI | BaseChatModel | BaseLanguageModel"
251}
252],
253"outputs": {},
254"selected": false
255},
256"selected": false,
257"positionAbsolute": {
258"x": 792.3201947594027,
259"y": 293.61889966751846
260},
261"dragging": false
262},
263{
264"width": 300,
265"height": 601,
266"id": "chainTool_0",
267"position": {
268"x": 1635.3466862861876,
269"y": 272.3189405402944
270},
271"type": "customNode",
272"data": {
273"id": "chainTool_0",
274"label": "Chain Tool",
275"version": 1,
276"name": "chainTool",
277"type": "ChainTool",
278"baseClasses": ["ChainTool", "DynamicTool", "Tool", "StructuredTool"],
279"category": "Tools",
280"description": "Use a chain as allowed tool for agent",
281"inputParams": [
282{
283"label": "Chain Name",
284"name": "name",
285"type": "string",
286"placeholder": "state-of-union-qa",
287"id": "chainTool_0-input-name-string"
288},
289{
290"label": "Chain Description",
291"name": "description",
292"type": "string",
293"rows": 3,
294"placeholder": "State of the Union QA - useful for when you need to ask questions about the most recent state of the union address.",
295"id": "chainTool_0-input-description-string"
296},
297{
298"label": "Return Direct",
299"name": "returnDirect",
300"type": "boolean",
301"optional": true,
302"id": "chainTool_0-input-returnDirect-boolean"
303}
304],
305"inputAnchors": [
306{
307"label": "Base Chain",
308"name": "baseChain",
309"type": "BaseChain",
310"id": "chainTool_0-input-baseChain-BaseChain"
311}
312],
313"inputs": {
314"name": "comic-qa",
315"description": "useful for when you need to ask question about comic",
316"returnDirect": false,
317"baseChain": "{{openApiChain_1.data.instance}}"
318},
319"outputAnchors": [
320{
321"id": "chainTool_0-output-chainTool-ChainTool|DynamicTool|Tool|StructuredTool",
322"name": "chainTool",
323"label": "ChainTool",
324"type": "ChainTool | DynamicTool | Tool | StructuredTool"
325}
326],
327"outputs": {},
328"selected": false
329},
330"selected": false,
331"positionAbsolute": {
332"x": 1635.3466862861876,
333"y": 272.3189405402944
334},
335"dragging": false
336},
337{
338"width": 300,
339"height": 670,
340"id": "chatOpenAI_2",
341"position": {
342"x": 1645.450699499575,
343"y": 992.6341744217375
344},
345"type": "customNode",
346"data": {
347"id": "chatOpenAI_2",
348"label": "ChatOpenAI",
349"version": 6.0,
350"name": "chatOpenAI",
351"type": "ChatOpenAI",
352"baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
353"category": "Chat Models",
354"description": "Wrapper around OpenAI large language models that use the Chat endpoint",
355"inputParams": [
356{
357"label": "Connect Credential",
358"name": "credential",
359"type": "credential",
360"credentialNames": ["openAIApi"],
361"id": "chatOpenAI_2-input-credential-credential"
362},
363{
364"label": "Model Name",
365"name": "modelName",
366"type": "asyncOptions",
367"loadMethod": "listModels",
368"default": "gpt-3.5-turbo",
369"id": "chatOpenAI_2-input-modelName-options"
370},
371{
372"label": "Temperature",
373"name": "temperature",
374"type": "number",
375"default": 0.9,
376"optional": true,
377"id": "chatOpenAI_2-input-temperature-number"
378},
379{
380"label": "Max Tokens",
381"name": "maxTokens",
382"type": "number",
383"optional": true,
384"additionalParams": true,
385"id": "chatOpenAI_2-input-maxTokens-number"
386},
387{
388"label": "Top Probability",
389"name": "topP",
390"type": "number",
391"optional": true,
392"additionalParams": true,
393"id": "chatOpenAI_2-input-topP-number"
394},
395{
396"label": "Frequency Penalty",
397"name": "frequencyPenalty",
398"type": "number",
399"optional": true,
400"additionalParams": true,
401"id": "chatOpenAI_2-input-frequencyPenalty-number"
402},
403{
404"label": "Presence Penalty",
405"name": "presencePenalty",
406"type": "number",
407"optional": true,
408"additionalParams": true,
409"id": "chatOpenAI_2-input-presencePenalty-number"
410},
411{
412"label": "Timeout",
413"name": "timeout",
414"type": "number",
415"optional": true,
416"additionalParams": true,
417"id": "chatOpenAI_2-input-timeout-number"
418},
419{
420"label": "BasePath",
421"name": "basepath",
422"type": "string",
423"optional": true,
424"additionalParams": true,
425"id": "chatOpenAI_2-input-basepath-string"
426},
427{
428"label": "BaseOptions",
429"name": "baseOptions",
430"type": "json",
431"optional": true,
432"additionalParams": true,
433"id": "chatOpenAI_2-input-baseOptions-json"
434},
435{
436"label": "Allow Image Uploads",
437"name": "allowImageUploads",
438"type": "boolean",
439"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",
440"default": false,
441"optional": true,
442"id": "chatOpenAI_2-input-allowImageUploads-boolean"
443},
444{
445"label": "Image Resolution",
446"description": "This parameter controls the resolution in which the model views the image.",
447"name": "imageResolution",
448"type": "options",
449"options": [
450{
451"label": "Low",
452"name": "low"
453},
454{
455"label": "High",
456"name": "high"
457},
458{
459"label": "Auto",
460"name": "auto"
461}
462],
463"default": "low",
464"optional": false,
465"additionalParams": true,
466"id": "chatOpenAI_2-input-imageResolution-options"
467}
468],
469"inputAnchors": [
470{
471"label": "Cache",
472"name": "cache",
473"type": "BaseCache",
474"optional": true,
475"id": "chatOpenAI_2-input-cache-BaseCache"
476}
477],
478"inputs": {
479"modelName": "gpt-3.5-turbo",
480"temperature": 0.9,
481"maxTokens": "",
482"topP": "",
483"frequencyPenalty": "",
484"presencePenalty": "",
485"timeout": "",
486"basepath": "",
487"baseOptions": "",
488"allowImageUploads": true,
489"imageResolution": "low"
490},
491"outputAnchors": [
492{
493"id": "chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
494"name": "chatOpenAI",
495"label": "ChatOpenAI",
496"type": "ChatOpenAI | BaseChatModel | BaseLanguageModel"
497}
498],
499"outputs": {},
500"selected": false
501},
502"selected": false,
503"positionAbsolute": {
504"x": 1645.450699499575,
505"y": 992.6341744217375
506},
507"dragging": false
508},
509{
510"width": 300,
511"height": 376,
512"id": "bufferMemory_0",
513"position": {
514"x": 1148.8461056155377,
515"y": 967.8215757228843
516},
517"type": "customNode",
518"data": {
519"id": "bufferMemory_0",
520"label": "Buffer Memory",
521"version": 2,
522"name": "bufferMemory",
523"type": "BufferMemory",
524"baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"],
525"category": "Memory",
526"description": "Retrieve chat messages stored in database",
527"inputParams": [
528{
529"label": "Session Id",
530"name": "sessionId",
531"type": "string",
532"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>",
533"default": "",
534"additionalParams": true,
535"optional": true,
536"id": "bufferMemory_0-input-sessionId-string"
537},
538{
539"label": "Memory Key",
540"name": "memoryKey",
541"type": "string",
542"default": "chat_history",
543"additionalParams": true,
544"id": "bufferMemory_0-input-memoryKey-string"
545}
546],
547"inputAnchors": [],
548"inputs": {
549"sessionId": "",
550"memoryKey": "chat_history"
551},
552"outputAnchors": [
553{
554"id": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory",
555"name": "bufferMemory",
556"label": "BufferMemory",
557"type": "BufferMemory | BaseChatMemory | BaseMemory"
558}
559],
560"outputs": {},
561"selected": false
562},
563"positionAbsolute": {
564"x": 1148.8461056155377,
565"y": 967.8215757228843
566},
567"selected": false
568},
569{
570"id": "openAIToolAgent_0",
571"position": {
572"x": 2083.8842813850474,
573"y": 749.3536850926545
574},
575"type": "customNode",
576"data": {
577"id": "openAIToolAgent_0",
578"label": "OpenAI Tool Agent",
579"version": 1,
580"name": "openAIToolAgent",
581"type": "AgentExecutor",
582"baseClasses": ["AgentExecutor", "BaseChain", "Runnable"],
583"category": "Agents",
584"description": "Agent that uses OpenAI Function Calling to pick the tools and args to call",
585"inputParams": [
586{
587"label": "System Message",
588"name": "systemMessage",
589"type": "string",
590"rows": 4,
591"optional": true,
592"additionalParams": true,
593"id": "openAIToolAgent_0-input-systemMessage-string"
594},
595{
596"label": "Max Iterations",
597"name": "maxIterations",
598"type": "number",
599"optional": true,
600"additionalParams": true,
601"id": "openAIToolAgent_0-input-maxIterations-number"
602}
603],
604"inputAnchors": [
605{
606"label": "Tools",
607"name": "tools",
608"type": "Tool",
609"list": true,
610"id": "openAIToolAgent_0-input-tools-Tool"
611},
612{
613"label": "Memory",
614"name": "memory",
615"type": "BaseChatMemory",
616"id": "openAIToolAgent_0-input-memory-BaseChatMemory"
617},
618{
619"label": "OpenAI/Azure Chat Model",
620"name": "model",
621"type": "BaseChatModel",
622"id": "openAIToolAgent_0-input-model-BaseChatModel"
623},
624{
625"label": "Input Moderation",
626"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
627"name": "inputModeration",
628"type": "Moderation",
629"optional": true,
630"list": true,
631"id": "openAIToolAgent_0-input-inputModeration-Moderation"
632}
633],
634"inputs": {
635"tools": ["{{chainTool_0.data.instance}}"],
636"memory": "{{bufferMemory_0.data.instance}}",
637"model": "{{chatOpenAI_2.data.instance}}",
638"systemMessage": "",
639"inputModeration": ""
640},
641"outputAnchors": [
642{
643"id": "openAIToolAgent_0-output-openAIToolAgent-AgentExecutor|BaseChain|Runnable",
644"name": "openAIToolAgent",
645"label": "AgentExecutor",
646"description": "Agent that uses OpenAI Function Calling to pick the tools and args to call",
647"type": "AgentExecutor | BaseChain | Runnable"
648}
649],
650"outputs": {},
651"selected": false
652},
653"width": 300,
654"height": 433,
655"selected": false,
656"positionAbsolute": {
657"x": 2083.8842813850474,
658"y": 749.3536850926545
659},
660"dragging": false
661}
662],
663"edges": [
664{
665"source": "chatOpenAI_1",
666"sourceHandle": "chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
667"target": "openApiChain_1",
668"targetHandle": "openApiChain_1-input-model-ChatOpenAI",
669"type": "buttonedge",
670"id": "chatOpenAI_1-chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-openApiChain_1-openApiChain_1-input-model-ChatOpenAI",
671"data": {
672"label": ""
673}
674},
675{
676"source": "openApiChain_1",
677"sourceHandle": "openApiChain_1-output-openApiChain-OpenAPIChain|BaseChain",
678"target": "chainTool_0",
679"targetHandle": "chainTool_0-input-baseChain-BaseChain",
680"type": "buttonedge",
681"id": "openApiChain_1-openApiChain_1-output-openApiChain-OpenAPIChain|BaseChain-chainTool_0-chainTool_0-input-baseChain-BaseChain",
682"data": {
683"label": ""
684}
685},
686{
687"source": "chainTool_0",
688"sourceHandle": "chainTool_0-output-chainTool-ChainTool|DynamicTool|Tool|StructuredTool",
689"target": "openAIToolAgent_0",
690"targetHandle": "openAIToolAgent_0-input-tools-Tool",
691"type": "buttonedge",
692"id": "chainTool_0-chainTool_0-output-chainTool-ChainTool|DynamicTool|Tool|StructuredTool-openAIToolAgent_0-openAIToolAgent_0-input-tools-Tool"
693},
694{
695"source": "bufferMemory_0",
696"sourceHandle": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory",
697"target": "openAIToolAgent_0",
698"targetHandle": "openAIToolAgent_0-input-memory-BaseChatMemory",
699"type": "buttonedge",
700"id": "bufferMemory_0-bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory-openAIToolAgent_0-openAIToolAgent_0-input-memory-BaseChatMemory"
701},
702{
703"source": "chatOpenAI_2",
704"sourceHandle": "chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
705"target": "openAIToolAgent_0",
706"targetHandle": "openAIToolAgent_0-input-model-BaseChatModel",
707"type": "buttonedge",
708"id": "chatOpenAI_2-chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-openAIToolAgent_0-openAIToolAgent_0-input-model-BaseChatModel"
709}
710]
711}
712