Flowise
336 строк · 13.2 Кб
1{
2"description": "Basic example of stateless (no memory) LLM Chain with a Prompt Template and LLM Model",
3"categories": "OpenAI,LLM Chain,Langchain",
4"framework": "Langchain",
5"nodes": [
6{
7"width": 300,
8"height": 475,
9"id": "promptTemplate_0",
10"position": {
11"x": 517.7412884791509,
12"y": 506.7411400888471
13},
14"type": "customNode",
15"data": {
16"id": "promptTemplate_0",
17"label": "Prompt Template",
18"version": 1,
19"name": "promptTemplate",
20"type": "PromptTemplate",
21"baseClasses": ["PromptTemplate", "BaseStringPromptTemplate", "BasePromptTemplate"],
22"category": "Prompts",
23"description": "Schema to represent a basic prompt for an LLM",
24"inputParams": [
25{
26"label": "Template",
27"name": "template",
28"type": "string",
29"rows": 4,
30"placeholder": "What is a good name for a company that makes {product}?",
31"id": "promptTemplate_0-input-template-string"
32},
33{
34"label": "Format Prompt Values",
35"name": "promptValues",
36"type": "json",
37"optional": true,
38"acceptVariable": true,
39"list": true,
40"id": "promptTemplate_0-input-promptValues-json"
41}
42],
43"inputAnchors": [],
44"inputs": {
45"template": "What is a good name for a company that makes {product}?",
46"promptValues": ""
47},
48"outputAnchors": [
49{
50"id": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
51"name": "promptTemplate",
52"label": "PromptTemplate",
53"type": "PromptTemplate | BaseStringPromptTemplate | BasePromptTemplate"
54}
55],
56"outputs": {},
57"selected": false
58},
59"selected": false,
60"positionAbsolute": {
61"x": 517.7412884791509,
62"y": 506.7411400888471
63},
64"dragging": false
65},
66{
67"width": 300,
68"height": 574,
69"id": "openAI_0",
70"position": {
71"x": 513.3297923232442,
72"y": -112.67554802812833
73},
74"type": "customNode",
75"data": {
76"id": "openAI_0",
77"label": "OpenAI",
78"version": 4.0,
79"name": "openAI",
80"type": "OpenAI",
81"baseClasses": ["OpenAI", "BaseLLM", "BaseLanguageModel"],
82"category": "LLMs",
83"description": "Wrapper around OpenAI large language models",
84"inputParams": [
85{
86"label": "Connect Credential",
87"name": "credential",
88"type": "credential",
89"credentialNames": ["openAIApi"],
90"id": "openAI_0-input-credential-credential"
91},
92{
93"label": "Model Name",
94"name": "modelName",
95"type": "asyncOptions",
96"loadMethod": "listModels",
97"default": "gpt-3.5-turbo-instruct",
98"id": "openAI_0-input-modelName-options"
99},
100{
101"label": "Temperature",
102"name": "temperature",
103"type": "number",
104"default": 0.7,
105"optional": true,
106"id": "openAI_0-input-temperature-number"
107},
108{
109"label": "Max Tokens",
110"name": "maxTokens",
111"type": "number",
112"optional": true,
113"additionalParams": true,
114"id": "openAI_0-input-maxTokens-number"
115},
116{
117"label": "Top Probability",
118"name": "topP",
119"type": "number",
120"optional": true,
121"additionalParams": true,
122"id": "openAI_0-input-topP-number"
123},
124{
125"label": "Best Of",
126"name": "bestOf",
127"type": "number",
128"optional": true,
129"additionalParams": true,
130"id": "openAI_0-input-bestOf-number"
131},
132{
133"label": "Frequency Penalty",
134"name": "frequencyPenalty",
135"type": "number",
136"optional": true,
137"additionalParams": true,
138"id": "openAI_0-input-frequencyPenalty-number"
139},
140{
141"label": "Presence Penalty",
142"name": "presencePenalty",
143"type": "number",
144"optional": true,
145"additionalParams": true,
146"id": "openAI_0-input-presencePenalty-number"
147},
148{
149"label": "Batch Size",
150"name": "batchSize",
151"type": "number",
152"optional": true,
153"additionalParams": true,
154"id": "openAI_0-input-batchSize-number"
155},
156{
157"label": "Timeout",
158"name": "timeout",
159"type": "number",
160"optional": true,
161"additionalParams": true,
162"id": "openAI_0-input-timeout-number"
163},
164{
165"label": "BasePath",
166"name": "basepath",
167"type": "string",
168"optional": true,
169"additionalParams": true,
170"id": "openAI_0-input-basepath-string"
171}
172],
173"inputAnchors": [
174{
175"label": "Cache",
176"name": "cache",
177"type": "BaseCache",
178"optional": true,
179"id": "openAI_0-input-cache-BaseCache"
180}
181],
182"inputs": {
183"modelName": "gpt-3.5-turbo-instruct",
184"temperature": 0.7,
185"maxTokens": "",
186"topP": "",
187"bestOf": "",
188"frequencyPenalty": "",
189"presencePenalty": "",
190"batchSize": "",
191"timeout": "",
192"basepath": ""
193},
194"outputAnchors": [
195{
196"id": "openAI_0-output-openAI-OpenAI|BaseLLM|BaseLanguageModel",
197"name": "openAI",
198"label": "OpenAI",
199"type": "OpenAI | BaseLLM | BaseLanguageModel"
200}
201],
202"outputs": {},
203"selected": false
204},
205"selected": false,
206"positionAbsolute": {
207"x": 513.3297923232442,
208"y": -112.67554802812833
209},
210"dragging": false
211},
212{
213"width": 300,
214"height": 456,
215"id": "llmChain_0",
216"position": {
217"x": 919.263534910828,
218"y": 318.465734712124
219},
220"type": "customNode",
221"data": {
222"id": "llmChain_0",
223"label": "LLM Chain",
224"version": 3,
225"name": "llmChain",
226"type": "LLMChain",
227"baseClasses": ["LLMChain", "BaseChain", "Runnable"],
228"category": "Chains",
229"description": "Chain to run queries against LLMs",
230"inputParams": [
231{
232"label": "Chain Name",
233"name": "chainName",
234"type": "string",
235"placeholder": "Name Your Chain",
236"optional": true,
237"id": "llmChain_0-input-chainName-string"
238}
239],
240"inputAnchors": [
241{
242"label": "Language Model",
243"name": "model",
244"type": "BaseLanguageModel",
245"id": "llmChain_0-input-model-BaseLanguageModel"
246},
247{
248"label": "Prompt",
249"name": "prompt",
250"type": "BasePromptTemplate",
251"id": "llmChain_0-input-prompt-BasePromptTemplate"
252},
253{
254"label": "Output Parser",
255"name": "outputParser",
256"type": "BaseLLMOutputParser",
257"optional": true,
258"id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
259},
260{
261"label": "Input Moderation",
262"description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
263"name": "inputModeration",
264"type": "Moderation",
265"optional": true,
266"list": true,
267"id": "llmChain_0-input-inputModeration-Moderation"
268}
269],
270"inputs": {
271"model": "{{openAI_0.data.instance}}",
272"prompt": "{{promptTemplate_0.data.instance}}",
273"outputParser": "",
274"chainName": "",
275"inputModeration": ""
276},
277"outputAnchors": [
278{
279"name": "output",
280"label": "Output",
281"type": "options",
282"options": [
283{
284"id": "llmChain_0-output-llmChain-LLMChain|BaseChain|Runnable",
285"name": "llmChain",
286"label": "LLM Chain",
287"type": "LLMChain | BaseChain | Runnable"
288},
289{
290"id": "llmChain_0-output-outputPrediction-string|json",
291"name": "outputPrediction",
292"label": "Output Prediction",
293"type": "string | json"
294}
295],
296"default": "llmChain"
297}
298],
299"outputs": {
300"output": "llmChain"
301},
302"selected": false
303},
304"selected": false,
305"positionAbsolute": {
306"x": 919.263534910828,
307"y": 318.465734712124
308},
309"dragging": false
310}
311],
312"edges": [
313{
314"source": "openAI_0",
315"sourceHandle": "openAI_0-output-openAI-OpenAI|BaseLLM|BaseLanguageModel",
316"target": "llmChain_0",
317"targetHandle": "llmChain_0-input-model-BaseLanguageModel",
318"type": "buttonedge",
319"id": "openAI_0-openAI_0-output-openAI-OpenAI|BaseLLM|BaseLanguageModel-llmChain_0-llmChain_0-input-model-BaseLanguageModel",
320"data": {
321"label": ""
322}
323},
324{
325"source": "promptTemplate_0",
326"sourceHandle": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
327"target": "llmChain_0",
328"targetHandle": "llmChain_0-input-prompt-BasePromptTemplate",
329"type": "buttonedge",
330"id": "promptTemplate_0-promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate-llmChain_0-llmChain_0-input-prompt-BasePromptTemplate",
331"data": {
332"label": ""
333}
334}
335]
336}
337