ArunKr commited on
Commit
d6dac6e
·
verified ·
1 Parent(s): 062d2b1

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. n8n/posts.json +81 -0
n8n/posts.json ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "OpenAI → GitHub JSON Save",
3
+ "nodes": [
4
+ {
5
+ "id": "1",
6
+ "name": "OpenAI Chat",
7
+ "type": "n8n-nodes-base.openAi",
8
+ "typeVersion": 1,
9
+ "position": [300, 300],
10
+ "parameters": {
11
+ "resource": "chat",
12
+ "operation": "create",
13
+ "model": "gpt-4o-mini",
14
+ "messages": [
15
+ {
16
+ "role": "user",
17
+ "content": "Write a short summary about Artificial Intelligence"
18
+ }
19
+ ]
20
+ },
21
+ "credentials": {
22
+ "openAiApi": "YOUR_OPENAI_API_CREDENTIAL"
23
+ }
24
+ },
25
+ {
26
+ "id": "2",
27
+ "name": "Prepare JSON File",
28
+ "type": "n8n-nodes-base.function",
29
+ "typeVersion": 1,
30
+ "position": [600, 300],
31
+ "parameters": {
32
+ "functionCode": "const message = $json.data[0].message.content;\n\nconst fileJson = {\n timestamp: new Date().toISOString(),\n model: \"gpt-4o-mini\",\n message\n};\n\nconst jsonString = JSON.stringify(fileJson, null, 2);\n\nreturn [{\n json: {\n fileContent: Buffer.from(jsonString).toString('base64'),\n fileName: `openai_${Date.now()}.json`\n }\n}];"
33
+ }
34
+ },
35
+ {
36
+ "id": "3",
37
+ "name": "Save to GitHub",
38
+ "type": "n8n-nodes-base.github",
39
+ "typeVersion": 1,
40
+ "position": [900, 300],
41
+ "parameters": {
42
+ "resource": "file",
43
+ "operation": "create",
44
+ "owner": "your-github-username",
45
+ "repository": "your-repository",
46
+ "filePath": "ai_outputs/{{ $json.fileName }}",
47
+ "binaryData": false,
48
+ "fileContent": "={{ $json.fileContent }}",
49
+ "commitMessage": "Save OpenAI response JSON via n8n",
50
+ "branch": "main"
51
+ },
52
+ "credentials": {
53
+ "githubApi": "YOUR_GITHUB_API_TOKEN"
54
+ }
55
+ }
56
+ ],
57
+ "connections": {
58
+ "OpenAI Chat": {
59
+ "main": [
60
+ [
61
+ {
62
+ "node": "Prepare JSON File",
63
+ "type": "main",
64
+ "index": 0
65
+ }
66
+ ]
67
+ ]
68
+ },
69
+ "Prepare JSON File": {
70
+ "main": [
71
+ [
72
+ {
73
+ "node": "Save to GitHub",
74
+ "type": "main",
75
+ "index": 0
76
+ }
77
+ ]
78
+ ]
79
+ }
80
+ }
81
+ }