-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0171_Readbinaryfiles_Code_Automation_Webhook.json
More file actions
758 lines (758 loc) · 20.7 KB
/
Copy path0171_Readbinaryfiles_Code_Automation_Webhook.json
File metadata and controls
758 lines (758 loc) · 20.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
{
"id": "147",
"meta": {
"instanceId": "dfdeafd1c3ed2ee08eeab8c2fa0c3f522066931ed8138ccd35dc20a1e69decd3"
},
"name": "OpenAI-model-examples",
"tags": [],
"nodes": [
{
"id": "ad6dc2cd-21cc-4563-86ba-f78cc4a55543",
"name": "When clicking \"Execute Workflow\"",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-640,
380
],
"parameters": {},
"typeVersion": 1
},
{
"id": "b370da23-ead4-4221-b7fe-a9d943f7fbb9",
"name": "davinci-003-complete",
"type": "n8n-nodes-base.openAi",
"position": [
1160,
60
],
"parameters": {
"prompt": "={{ $json.text }}\n\nTl;dr:",
"options": {
"maxTokens": 500
}
},
"credentials": {
"openAiApi": {
"id": "63",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "5e04f355-36c0-4540-8e65-68118cb73135",
"name": "ChatGPT-ex2",
"type": "n8n-nodes-base.openAi",
"position": [
1160,
740
],
"parameters": {
"prompt": {
"messages": [
{
"role": "system",
"content": "=You are an assistant. Always add 5 emojis to the end of your answer."
},
{
"content": "=Write tl;dr of the wollowing text: {{ $json.text}}"
}
]
},
"options": {
"maxTokens": 500,
"temperature": 0.8
},
"resource": "chat"
},
"credentials": {
"openAiApi": {
"id": "63",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "16a7cf80-16e3-44f9-b15c-7501417fe38f",
"name": "davinci-003-edit",
"type": "n8n-nodes-base.openAi",
"position": [
1340,
60
],
"parameters": {
"input": "={{ $json.text }}",
"options": {},
"operation": "edit",
"instruction": "translate to German"
},
"credentials": {
"openAiApi": {
"id": "63",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "95254870-65c3-4714-83fb-20ba2c0ca007",
"name": "ChatGPT-ex1.1",
"type": "n8n-nodes-base.openAi",
"position": [
1160,
380
],
"parameters": {
"prompt": {
"messages": [
{
"content": "=Write a Tl;dr of the followint text: {{ $json.text }}"
}
]
},
"options": {
"maxTokens": 500
},
"resource": "chat"
},
"credentials": {
"openAiApi": {
"id": "63",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "be9c4820-18b0-46fd-a5a0-51a5dc3ebed5",
"name": "ChatGPT-ex1.2",
"type": "n8n-nodes-base.openAi",
"position": [
1340,
380
],
"parameters": {
"prompt": {
"messages": [
{
"content": "=Translate to German the following text: {{ $json.message.content }}"
}
]
},
"options": {
"maxTokens": 500
},
"resource": "chat"
},
"credentials": {
"openAiApi": {
"id": "63",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "c52c875b-5270-44ac-bfca-ce25124e3d04",
"name": "Text-example",
"type": "n8n-nodes-base.code",
"position": [
540,
380
],
"parameters": {
"jsCode": "return [\n {\n \"text\": \"Science Underground with your host, Anissa Ramirez. In this episode, how to stop your bathroom mirror from fogging up with a little dash of science. I'm Anissa Ramirez and this is Science Underground. We've all been there. You come out of the shower and you go to the mirror and you can't see yourself because the mirror is fogged up. You can't see anything until you first clear off the surface. Every morning it's the same thing. Shower, fog, shower, fog, shower, fog. There's gotta be a better way. Well, there is. Before you take the next shower, wipe a bit of shaving cream on the surface of the mirror and keep it there for about 30 seconds. Then wipe it off. The next time you take a shower, that part of the mirror that was covered with shaving cream will be amazingly fog free. And the shaving cream will keep the water from fogging up for a few weeks. So what's going on? Well, the fog on your mirror is made out of little itty bitty water droplets. If you were to look at the surface of the mirror under the microscope, you will see that the surface looks like a newly waxed car. The water forms beads, preventing you from seeing yourself in the mirror. When you add shaving cream to the surface of the mirror, the water droplets are no longer beads. They are a thin, smoothed out layer of water. Just like the surface of an old car that hasn't been waxed. Scientists would say that the shaving cream has changed the surface tension of the mirror. So there you have it. There's the answer. The secret to fogless mirrors is shaving cream. A little dab of science will do you. I'm Anissa Ramirez, and this was Science Underground.\"\n }\n];"
},
"typeVersion": 1
},
{
"id": "45d3bad7-0e9a-426b-b4e9-b3568181d9dc",
"name": "Code-ex3.1",
"type": "n8n-nodes-base.code",
"position": [
1160,
1100
],
"parameters": {
"jsCode": "var intext = $input.first().json;\n\nvar messages = [\n {\"role\": \"system\", \"content\": \"You are a helpful assistant. Write a Tl;dr of each user message\"},\n {\"role\": \"user\", \"content\": intext.text}\n];\n\nreturn {\"messages\":messages};"
},
"typeVersion": 1
},
{
"id": "4db3de05-51a7-46ea-a818-508bdcb04582",
"name": "ChatGPT-ex3.1",
"type": "n8n-nodes-base.httpRequest",
"position": [
1340,
1100
],
"parameters": {
"url": "https://api.openai.com/v1/chat/completions",
"method": "POST",
"options": {},
"sendBody": true,
"authentication": "predefinedCredentialType",
"bodyParameters": {
"parameters": [
{
"name": "model",
"value": "gpt-3.5-turbo"
},
{
"name": "temperature",
"value": "={{ parseFloat(0.8) }}"
},
{
"name": "n",
"value": "={{ Number(1) }}"
},
{
"name": "max_tokens",
"value": "={{ Number(500) }}"
},
{
"name": "messages",
"value": "={{ $json.messages }}"
}
]
},
"nodeCredentialType": "openAiApi"
},
"credentials": {
"openAiApi": {
"id": "63",
"name": "OpenAi account"
}
},
"typeVersion": 3
},
{
"id": "709fcd7c-deb3-469d-b16b-62d4d36d100d",
"name": "ChatGPT-ex3.2",
"type": "n8n-nodes-base.openAi",
"position": [
1880,
1100
],
"parameters": {
"prompt": {
"messages": [
{
"role": "system",
"content": "=You are now a DALLE-2 prompt generation tool that will generate a suitable prompt. Write a promt to create a cover image relevant to the user input. The image should be in a comic style of the 60-s."
},
{
"content": "={{ $json.choices[0].message.content }}"
}
]
},
"options": {
"maxTokens": 500,
"temperature": 0.8
},
"resource": "chat"
},
"credentials": {
"openAiApi": {
"id": "63",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "6b32cc45-5ba2-4605-b690-3929ec9acecf",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
900,
-60
],
"parameters": {
"width": 746.6347949130579,
"height": 295.50954755505853,
"content": "## The old way of using text completion and text edit\n### Davinci model is 10 times more expensive then ChatGPT, consider switching to the new API:\nhttps://openai.com/blog/introducing-chatgpt-and-whisper-apis\n"
},
"typeVersion": 1
},
{
"id": "3cc74d77-7b02-40fd-83d8-f540d5ff34ab",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-160,
260
],
"parameters": {
"width": 428.4578974150008,
"height": 316.6202633391793,
"content": "## Whisper-1 example\n### Prepare your audio file and send it to whisper-1 transcription model"
},
"typeVersion": 1
},
{
"id": "6ba8069a-485c-497c-8b27-4c7562fbccab",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
380,
280
],
"parameters": {
"width": 421.9002034748082,
"height": 302.4086532331564,
"content": "## An example of transcribed text\n### Please pause this node when using real audio files"
},
"typeVersion": 1
},
{
"id": "c71001e6-b80f-41dd-bcdd-10927014b374",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
900,
280
],
"parameters": {
"width": 747.8556016477869,
"height": 288.18470714667706,
"content": "## ChatGPT example 1.1 and 1.2 \n### Write a Tl;dr of the text input\n### Translate it to German\n### only user content provided"
},
"typeVersion": 1
},
{
"id": "4605be68-4c57-404f-8624-e095c8e86ff9",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
900,
620
],
"parameters": {
"width": 742.9723747088658,
"height": 288.18470714667706,
"content": "## ChatGPT example 2 \n### Use system content to provide general instruction\n### Manual setup of system and user content"
},
"typeVersion": 1
},
{
"id": "f5b72d7a-655a-4cc9-b722-b75429889d1d",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
900,
960
],
"parameters": {
"width": 739.309954504675,
"height": 288.18470714667706,
"content": "## ChatGPT example 3.1\n### When using ChatGPT programmatically, create an array of system / user / assistant contents and append them one after another\n### Call ChatGPT API via HTTP Request node to provide all messages at once"
},
"typeVersion": 1
},
{
"id": "a003a4db-1960-4867-8dfe-3114cf0742f3",
"name": "DALLE-ex3.3",
"type": "n8n-nodes-base.openAi",
"position": [
2060,
1100
],
"parameters": {
"prompt": "={{ $json.message.content }}",
"options": {
"n": 4,
"size": "512x512"
},
"resource": "image"
},
"credentials": {
"openAiApi": {
"id": "63",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "d71a01ff-4d47-4675-964c-c47820d3989b",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
1720,
960
],
"parameters": {
"width": 611.1252473579985,
"height": 284.52228694248623,
"content": "## ChatGPT example 3.2 & DALLE-2 example 3.3\n### Use ChatGPT to create a prompt for a cover image of the Tl;dr message\n### Use OpenAI node to generate 4 images using the auto-generated prompt"
},
"typeVersion": 1
},
{
"id": "f5a55cfe-c110-4833-9668-1f1ba895860f",
"name": "ChatGPT-ex4",
"type": "n8n-nodes-base.openAi",
"position": [
1240,
1420
],
"parameters": {
"model": "gpt-3.5-turbo-0301",
"prompt": {
"messages": [
{
"content": "={{ $json.prompt }}"
}
]
},
"options": {
"maxTokens": 500,
"temperature": 0.5
},
"resource": "chat"
},
"credentials": {
"openAiApi": {
"id": "63",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "8a9f7a20-187c-4494-8005-b10d066d04e2",
"name": "Set-ex4",
"type": "n8n-nodes-base.set",
"position": [
1060,
1420
],
"parameters": {
"values": {
"string": [
{
"name": "model",
"value": "code-davinci-002"
},
{
"name": "suffix",
"value": "</svg>"
},
{
"name": "prompt",
"value": "=Create an HTML code with and SVG tag that contains random shapes of various colors. Include triangles, lines, ellipses and other shapes"
}
]
},
"options": {},
"keepOnlySet": true
},
"typeVersion": 1
},
{
"id": "68fcc6a2-761c-42ac-8778-313c8db7d53c",
"name": "HTML-ex4",
"type": "n8n-nodes-base.html",
"position": [
1420,
1420
],
"parameters": {
"html": "{{$json.message.content }}"
},
"typeVersion": 1
},
{
"id": "1f70cf3f-b6a9-4ea7-9486-c7565e6951b7",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
900,
1300
],
"parameters": {
"width": 739.309954504675,
"height": 288.18470714667706,
"content": "## ChatGPT example 4\n### Generate HTML code that contains SVG image"
},
"typeVersion": 1
},
{
"id": "d857acd9-ea74-44d2-ac89-66b1fac4645f",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
900,
1640
],
"parameters": {
"width": 739.309954504675,
"height": 288.18470714667706,
"content": "## ChatGPT example 5\n### Provide several outputs. Useful for quick replies (i.e. in Gmail / Outlook)"
},
"typeVersion": 1
},
{
"id": "fe64533a-4cd4-4adc-a48a-8abf3f2d61d7",
"name": "ChatGPT-ex",
"type": "n8n-nodes-base.openAi",
"position": [
1160,
1760
],
"parameters": {
"model": "gpt-3.5-turbo-0301",
"prompt": {
"messages": [
{
"role": "system",
"content": "Act as an e-mail client. Provide a five to eight word answers to a given user messages."
},
{
"content": "Hi There! My name is Jack.\n\nI'm sending you an overview of my pricelist attached.\nCould you please reply to me within 3 days?\n\nBest regards and have a nice day,\nJack"
}
]
},
"options": {
"n": 3,
"maxTokens": 15,
"temperature": 0.8
},
"resource": "chat"
},
"credentials": {
"openAiApi": {
"id": "63",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "6c9f8a70-99ae-4310-8e6a-26cc6f75b3a2",
"name": "LoadMP3",
"type": "n8n-nodes-base.readBinaryFiles",
"disabled": true,
"position": [
-80,
380
],
"parameters": {
"fileSelector": "/home/node/.n8n/OpenAI-article/Using Science to Stop Your Mirror From Fogging Up.mp3"
},
"typeVersion": 1
},
{
"id": "0edc1996-6484-4e62-a47b-5666dfbb3546",
"name": "Whisper-transcribe",
"type": "n8n-nodes-base.httpRequest",
"disabled": true,
"position": [
100,
380
],
"parameters": {
"url": "https://api.openai.com/v1/audio/transcriptions",
"method": "POST",
"options": {},
"sendBody": true,
"contentType": "multipart-form-data",
"authentication": "predefinedCredentialType",
"bodyParameters": {
"parameters": [
{
"name": "model",
"value": "whisper-1"
},
{
"name": "file",
"parameterType": "formBinaryData",
"inputDataFieldName": "data"
}
]
},
"nodeCredentialType": "openAiApi"
},
"credentials": {
"openAiApi": {
"id": "63",
"name": "OpenAi account"
}
},
"typeVersion": 3
},
{
"id": "c12ba294-bdcd-4ece-8370-fa6a83a8ef0b",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-840,
260
],
"parameters": {
"width": 596.9600747621192,
"height": 320.63203364295396,
"content": "## Do not run the whole workflow, it's rather slow\n### Better execute the last node of each branch or simply disconnect branches that are not needed"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"callerPolicy": "workflowsFromSameOwner",
"saveManualExecutions": false,
"saveDataSuccessExecution": "none"
},
"versionId": "972cd971-9e7e-4a1d-b3fb-6f061e23e96f",
"connections": {
"LoadMP3": {
"main": [
[
{
"node": "Whisper-transcribe",
"type": "main",
"index": 0
}
]
]
},
"Set-ex4": {
"main": [
[
{
"node": "ChatGPT-ex4",
"type": "main",
"index": 0
}
]
]
},
"Code-ex3.1": {
"main": [
[
{
"node": "ChatGPT-ex3.1",
"type": "main",
"index": 0
}
]
]
},
"ChatGPT-ex4": {
"main": [
[
{
"node": "HTML-ex4",
"type": "main",
"index": 0
}
]
]
},
"Text-example": {
"main": [
[
{
"node": "davinci-003-complete",
"type": "main",
"index": 0
},
{
"node": "ChatGPT-ex1.1",
"type": "main",
"index": 0
},
{
"node": "ChatGPT-ex2",
"type": "main",
"index": 0
},
{
"node": "Code-ex3.1",
"type": "main",
"index": 0
}
]
]
},
"ChatGPT-ex1.1": {
"main": [
[
{
"node": "ChatGPT-ex1.2",
"type": "main",
"index": 0
}
]
]
},
"ChatGPT-ex3.1": {
"main": [
[
{
"node": "ChatGPT-ex3.2",
"type": "main",
"index": 0
}
]
]
},
"ChatGPT-ex3.2": {
"main": [
[
{
"node": "DALLE-ex3.3",
"type": "main",
"index": 0
}
]
]
},
"Whisper-transcribe": {
"main": [
[
{
"node": "Text-example",
"type": "main",
"index": 0
}
]
]
},
"davinci-003-complete": {
"main": [
[
{
"node": "davinci-003-edit",
"type": "main",
"index": 0
}
]
]
},
"When clicking \"Execute Workflow\"": {
"main": [
[
{
"node": "LoadMP3",
"type": "main",
"index": 0
},
{
"node": "Set-ex4",
"type": "main",
"index": 0
},
{
"node": "ChatGPT-ex",
"type": "main",
"index": 0
}
]
]
}
}
}