|
[ |
|
{ |
|
"id": "e6da46131ceed4fb", |
|
"type": "tab", |
|
"label": "OpenAI API", |
|
"disabled": false, |
|
"info": "", |
|
"env": [] |
|
}, |
|
{ |
|
"id": "bf51565be34158ba", |
|
"type": "http request", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"method": "POST", |
|
"ret": "obj", |
|
"paytoqs": "ignore", |
|
"url": "https://api.openai.com/v1/chat/completions", |
|
"tls": "", |
|
"persist": false, |
|
"proxy": "", |
|
"insecureHTTPParser": false, |
|
"authType": "bearer", |
|
"senderr": false, |
|
"headers": [], |
|
"x": 430, |
|
"y": 240, |
|
"wires": [ |
|
[ |
|
"7627281c058b8a40" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "7efe3e431a7e6d00", |
|
"type": "template", |
|
"z": "e6da46131ceed4fb", |
|
"name": "Message", |
|
"field": "payload", |
|
"fieldType": "msg", |
|
"format": "handlebars", |
|
"syntax": "mustache", |
|
"template": "Hello bot!", |
|
"output": "str", |
|
"x": 200, |
|
"y": 120, |
|
"wires": [ |
|
[ |
|
"a86e4dd004486738" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "c31cc49404b315e8", |
|
"type": "inject", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"props": [ |
|
{ |
|
"p": "payload" |
|
}, |
|
{ |
|
"p": "topic", |
|
"vt": "str" |
|
}, |
|
{ |
|
"p": "chatID", |
|
"v": "123456789", |
|
"vt": "str" |
|
} |
|
], |
|
"repeat": "", |
|
"crontab": "", |
|
"once": false, |
|
"onceDelay": 0.1, |
|
"topic": "", |
|
"payload": "", |
|
"payloadType": "date", |
|
"x": 160, |
|
"y": 80, |
|
"wires": [ |
|
[ |
|
"7efe3e431a7e6d00" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "0a2a8c300fbe892c", |
|
"type": "link in", |
|
"z": "e6da46131ceed4fb", |
|
"name": "chatgpt_in", |
|
"links": [], |
|
"x": 55, |
|
"y": 160, |
|
"wires": [ |
|
[ |
|
"a86e4dd004486738" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "ee232ed4b483a468", |
|
"type": "link out", |
|
"z": "e6da46131ceed4fb", |
|
"name": "chatgpt_out", |
|
"mode": "return", |
|
"links": [], |
|
"x": 715, |
|
"y": 260, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "7627281c058b8a40", |
|
"type": "change", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"rules": [ |
|
{ |
|
"t": "set", |
|
"p": "payload", |
|
"pt": "msg", |
|
"to": "payload.choices[0].message.content", |
|
"tot": "msg" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 470, |
|
"y": 280, |
|
"wires": [ |
|
[ |
|
"d821f5e73ad30717" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "a86e4dd004486738", |
|
"type": "change", |
|
"z": "e6da46131ceed4fb", |
|
"name": "Change model config", |
|
"rules": [ |
|
{ |
|
"t": "set", |
|
"p": "gpt_config.model", |
|
"pt": "msg", |
|
"to": "gpt-3.5-turbo", |
|
"tot": "str" |
|
}, |
|
{ |
|
"t": "set", |
|
"p": "gpt_config.system", |
|
"pt": "msg", |
|
"to": "You reply to the emails as a customer support employee for IT support. Maximum 50 words.", |
|
"tot": "str" |
|
}, |
|
{ |
|
"t": "set", |
|
"p": "gpt_config.temperature", |
|
"pt": "msg", |
|
"to": "1", |
|
"tot": "num" |
|
}, |
|
{ |
|
"t": "set", |
|
"p": "gpt_config.top_p", |
|
"pt": "msg", |
|
"to": "1", |
|
"tot": "num" |
|
}, |
|
{ |
|
"t": "set", |
|
"p": "gpt_config.presence_penalty", |
|
"pt": "msg", |
|
"to": "0", |
|
"tot": "num" |
|
}, |
|
{ |
|
"t": "set", |
|
"p": "gpt_config.frequency_penalty", |
|
"pt": "msg", |
|
"to": "0", |
|
"tot": "num" |
|
}, |
|
{ |
|
"t": "set", |
|
"p": "gpt_config.max_tokens", |
|
"pt": "msg", |
|
"to": "2048", |
|
"tot": "num" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 260, |
|
"y": 160, |
|
"wires": [ |
|
[ |
|
"4d9239f766dd1ee5" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "9b5be63de486af3c", |
|
"type": "comment", |
|
"z": "e6da46131ceed4fb", |
|
"name": "[Link]Chat API Reference ", |
|
"info": "https://platform.openai.com/docs/api-reference/chat/create\n\nhttps://platform.openai.com/docs/guides/chat/introduction", |
|
"x": 590, |
|
"y": 160, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "15c9b2befc9785da", |
|
"type": "comment", |
|
"z": "e6da46131ceed4fb", |
|
"name": "Save conversation history", |
|
"info": "This will save the conversation\nhistory, input and response,\nfor the last 6 messages for\neach platform to a file.\nYou can use a database, like Postgress or\nNoSQL variants. ", |
|
"x": 590, |
|
"y": 580, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "ee86db05dc050f8e", |
|
"type": "function", |
|
"z": "e6da46131ceed4fb", |
|
"name": "Config chat model", |
|
"func": "/* \n * E.g. input for history\n * msg.gpt_history = [{ \"role\": \"assistant\", \"content\": \"The Los Angeles Dodgers won the World Series in 2020.\" },\n * { \"role\": \"user\", \"content\": \"Where was it played?\" } ]\n */\n\nmsg.gpt_messages = [ { \"role\": \"system\", \"content\": msg.gpt_config.system } ];\n\nif (msg.gpt_history){\n msg.gpt_messages = msg.gpt_messages.concat(msg.gpt_history);\n}\n\nmsg.gpt_messages = msg.gpt_messages.concat({ \"role\": \"user\", \"content\": msg.payload });\n\nmsg.payload =\n{\n \"model\": msg.gpt_config.model,\n \"messages\": msg.gpt_messages,\n \"temperature\": msg.gpt_config.temperature,\n \"top_p\": msg.gpt_config.top_p,\n \"presence_penalty\": msg.gpt_config.presence_penalty,\n \"frequency_penalty\": msg.gpt_config.frequency_penalty,\n \"max_tokens\": msg.gpt_config.max_tokens\n}\n\ndelete (msg.gpt_config);\ndelete (msg.gpt_history);\n\nreturn msg;", |
|
"outputs": 1, |
|
"noerr": 0, |
|
"initialize": "", |
|
"finalize": "", |
|
"libs": [], |
|
"x": 370, |
|
"y": 200, |
|
"wires": [ |
|
[ |
|
"bf51565be34158ba" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "eb00035c36ac739f", |
|
"type": "switch", |
|
"z": "e6da46131ceed4fb", |
|
"name": "Check if RedBot or WhatsApp personal", |
|
"property": "originalMessage", |
|
"propertyType": "msg", |
|
"rules": [ |
|
{ |
|
"t": "hask", |
|
"v": "chatId", |
|
"vt": "str" |
|
}, |
|
{ |
|
"t": "else" |
|
} |
|
], |
|
"checkall": "true", |
|
"repair": false, |
|
"outputs": 2, |
|
"x": 260, |
|
"y": 520, |
|
"wires": [ |
|
[ |
|
"e7f70d3b76fd56f9" |
|
], |
|
[ |
|
"4fa4c728be999a0f" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "e7f70d3b76fd56f9", |
|
"type": "change", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"rules": [ |
|
{ |
|
"t": "set", |
|
"p": "saveID", |
|
"pt": "msg", |
|
"to": "originalMessage.chatId", |
|
"tot": "msg" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 540, |
|
"y": 500, |
|
"wires": [ |
|
[ |
|
"1fb6c955238349a9" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "4fa4c728be999a0f", |
|
"type": "change", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"rules": [ |
|
{ |
|
"t": "set", |
|
"p": "saveID", |
|
"pt": "msg", |
|
"to": "chatID", |
|
"tot": "msg" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 540, |
|
"y": 540, |
|
"wires": [ |
|
[ |
|
"1fb6c955238349a9" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "1fb6c955238349a9", |
|
"type": "change", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"rules": [ |
|
{ |
|
"t": "set", |
|
"p": "filename", |
|
"pt": "msg", |
|
"to": "\"/data/chat_save/\" & saveID & \".json\"", |
|
"tot": "jsonata" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 750, |
|
"y": 480, |
|
"wires": [ |
|
[ |
|
"5c1c0ced602a4506" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "d821f5e73ad30717", |
|
"type": "switch", |
|
"z": "e6da46131ceed4fb", |
|
"name": "Status code 200", |
|
"property": "statusCode", |
|
"propertyType": "msg", |
|
"rules": [ |
|
{ |
|
"t": "eq", |
|
"v": "200", |
|
"vt": "str" |
|
}, |
|
{ |
|
"t": "else" |
|
} |
|
], |
|
"checkall": "true", |
|
"repair": false, |
|
"outputs": 2, |
|
"x": 500, |
|
"y": 320, |
|
"wires": [ |
|
[ |
|
"ee232ed4b483a468", |
|
"ea69b2ae2fb4ecc0" |
|
], |
|
[ |
|
"f05579cea6eddee7" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "f05579cea6eddee7", |
|
"type": "debug", |
|
"z": "e6da46131ceed4fb", |
|
"name": "API Error", |
|
"active": true, |
|
"tosidebar": false, |
|
"console": false, |
|
"tostatus": false, |
|
"complete": "true", |
|
"targetType": "full", |
|
"statusVal": "", |
|
"statusType": "auto", |
|
"x": 760, |
|
"y": 340, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "dd3306028f512ae0", |
|
"type": "link in", |
|
"z": "e6da46131ceed4fb", |
|
"name": "gpt_history_in", |
|
"links": [ |
|
"4d9239f766dd1ee5" |
|
], |
|
"x": 55, |
|
"y": 440, |
|
"wires": [ |
|
[ |
|
"57cbe5d7e145265a" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "05ea0c20ec7661be", |
|
"type": "comment", |
|
"z": "e6da46131ceed4fb", |
|
"name": "Check if history exist", |
|
"info": "Verify if a file with the specific saveID exist.", |
|
"x": 570, |
|
"y": 380, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "5c1c0ced602a4506", |
|
"type": "file in", |
|
"z": "e6da46131ceed4fb", |
|
"name": "Get conversation", |
|
"filename": "filename", |
|
"filenameType": "msg", |
|
"format": "utf8", |
|
"chunk": false, |
|
"sendError": false, |
|
"encoding": "none", |
|
"allProps": false, |
|
"x": 770, |
|
"y": 520, |
|
"wires": [ |
|
[ |
|
"f9fbd684daf9ee90" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "f9fbd684daf9ee90", |
|
"type": "json", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"property": "payload", |
|
"action": "", |
|
"pretty": false, |
|
"x": 830, |
|
"y": 560, |
|
"wires": [ |
|
[ |
|
"37211b0a377a4b0e" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "08d23a700481c2d0", |
|
"type": "function", |
|
"z": "e6da46131ceed4fb", |
|
"name": "Save current and last N", |
|
"func": "/* \n * Save the current response and delete older than N limit\n */\n//Remove first array element, \"role\":\"system\"\nmsg.gpt_messages.shift();\nvar gpt_response = [{ \"role\": \"assistant\", \"content\": msg.payload }]; \nvar current_conversation = msg.gpt_messages.concat(gpt_response);\n//Get the last N from history\ncurrent_conversation = current_conversation.slice(-(msg.maximum_histroy * 2));\nmsg.payload = current_conversation;\nreturn msg;", |
|
"outputs": 1, |
|
"noerr": 0, |
|
"initialize": "", |
|
"finalize": "", |
|
"libs": [], |
|
"x": 470, |
|
"y": 660, |
|
"wires": [ |
|
[ |
|
"10b56afb812da49f" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "57cbe5d7e145265a", |
|
"type": "change", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"rules": [ |
|
{ |
|
"t": "set", |
|
"p": "gpt_asked", |
|
"pt": "msg", |
|
"to": "payload", |
|
"tot": "msg" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 330, |
|
"y": 440, |
|
"wires": [ |
|
[ |
|
"962dd3ca8a41dbfc" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "10b56afb812da49f", |
|
"type": "file", |
|
"z": "e6da46131ceed4fb", |
|
"name": "Save conversation", |
|
"filename": "filename", |
|
"filenameType": "msg", |
|
"appendNewline": false, |
|
"createDir": true, |
|
"overwriteFile": "true", |
|
"encoding": "none", |
|
"x": 710, |
|
"y": 660, |
|
"wires": [ |
|
[] |
|
] |
|
}, |
|
{ |
|
"id": "8048cf0539ac4f55", |
|
"type": "link out", |
|
"z": "e6da46131ceed4fb", |
|
"name": "gpt_history_out", |
|
"mode": "link", |
|
"links": [ |
|
"81c7c2f4545507e7" |
|
], |
|
"x": 1105, |
|
"y": 600, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "4d9239f766dd1ee5", |
|
"type": "link out", |
|
"z": "e6da46131ceed4fb", |
|
"name": "chatgpt_out", |
|
"mode": "link", |
|
"links": [ |
|
"dd3306028f512ae0" |
|
], |
|
"x": 405, |
|
"y": 160, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "81c7c2f4545507e7", |
|
"type": "link in", |
|
"z": "e6da46131ceed4fb", |
|
"name": "link in 1", |
|
"links": [ |
|
"8048cf0539ac4f55" |
|
], |
|
"x": 235, |
|
"y": 200, |
|
"wires": [ |
|
[ |
|
"ee86db05dc050f8e" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "37211b0a377a4b0e", |
|
"type": "change", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"rules": [ |
|
{ |
|
"t": "set", |
|
"p": "gpt_history", |
|
"pt": "msg", |
|
"to": "payload", |
|
"tot": "msg" |
|
}, |
|
{ |
|
"t": "set", |
|
"p": "payload", |
|
"pt": "msg", |
|
"to": "gpt_asked", |
|
"tot": "msg" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 820, |
|
"y": 600, |
|
"wires": [ |
|
[ |
|
"8048cf0539ac4f55" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "00b3fd403c2f6aac", |
|
"type": "comment", |
|
"z": "e6da46131ceed4fb", |
|
"name": "Call the ChatGPT API", |
|
"info": "", |
|
"x": 580, |
|
"y": 40, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "e0e0c2930abdfb07", |
|
"type": "link in", |
|
"z": "e6da46131ceed4fb", |
|
"name": "gpt_history_save_in", |
|
"links": [ |
|
"ea69b2ae2fb4ecc0" |
|
], |
|
"x": 55, |
|
"y": 660, |
|
"wires": [ |
|
[ |
|
"f3b2ddeeb67dcdc6" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "ea69b2ae2fb4ecc0", |
|
"type": "link out", |
|
"z": "e6da46131ceed4fb", |
|
"name": "chatgpt_out", |
|
"mode": "link", |
|
"links": [ |
|
"e0e0c2930abdfb07" |
|
], |
|
"x": 715, |
|
"y": 300, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "fa2a85103c4924fb", |
|
"type": "catch", |
|
"z": "e6da46131ceed4fb", |
|
"name": "If file not found", |
|
"scope": [ |
|
"5c1c0ced602a4506" |
|
], |
|
"uncaught": false, |
|
"x": 980, |
|
"y": 520, |
|
"wires": [ |
|
[ |
|
"8048cf0539ac4f55" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "f3b2ddeeb67dcdc6", |
|
"type": "change", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"rules": [ |
|
{ |
|
"t": "set", |
|
"p": "maximum_histroy", |
|
"pt": "msg", |
|
"to": "6", |
|
"tot": "num" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 210, |
|
"y": 660, |
|
"wires": [ |
|
[ |
|
"08d23a700481c2d0" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "88698f105ae398f1", |
|
"type": "http request", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"method": "POST", |
|
"ret": "obj", |
|
"paytoqs": "ignore", |
|
"url": "https://api.openai.com/v1/images/generations", |
|
"tls": "", |
|
"persist": false, |
|
"proxy": "", |
|
"insecureHTTPParser": false, |
|
"authType": "bearer", |
|
"senderr": false, |
|
"headers": [], |
|
"x": 290, |
|
"y": 900, |
|
"wires": [ |
|
[ |
|
"4fd1ba17724cc32f" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "24112cb41f1f983f", |
|
"type": "template", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"field": "payload", |
|
"fieldType": "msg", |
|
"format": "json", |
|
"syntax": "mustache", |
|
"template": "{\n \"prompt\": \"{{payload.img_prompt}}\",\n \"n\": 1,\n \"size\": \"{{payload.resolution}}\"\n}", |
|
"output": "json", |
|
"x": 260, |
|
"y": 860, |
|
"wires": [ |
|
[ |
|
"88698f105ae398f1" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "da0254b711276bdc", |
|
"type": "image", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"width": 160, |
|
"data": "payload", |
|
"dataType": "msg", |
|
"thumbnail": false, |
|
"active": true, |
|
"pass": false, |
|
"outputs": 0, |
|
"x": 360, |
|
"y": 980, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "2cfdfff15961b9d6", |
|
"type": "inject", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"props": [ |
|
{ |
|
"p": "payload.img_prompt", |
|
"v": "A cute cat.", |
|
"vt": "str" |
|
}, |
|
{ |
|
"p": "topic", |
|
"vt": "str" |
|
} |
|
], |
|
"repeat": "", |
|
"crontab": "", |
|
"once": false, |
|
"onceDelay": 0.1, |
|
"topic": "", |
|
"x": 150, |
|
"y": 780, |
|
"wires": [ |
|
[ |
|
"1e8787cff0ccfe81" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "4fd1ba17724cc32f", |
|
"type": "change", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"rules": [ |
|
{ |
|
"t": "set", |
|
"p": "payload", |
|
"pt": "msg", |
|
"to": "payload.data[0].url", |
|
"tot": "msg" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 320, |
|
"y": 940, |
|
"wires": [ |
|
[ |
|
"da0254b711276bdc", |
|
"5268a38e5582c90e" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "982664b0a0fd715a", |
|
"type": "comment", |
|
"z": "e6da46131ceed4fb", |
|
"name": "Bonus: create image with \"dall-e-2\" and send it", |
|
"info": "", |
|
"x": 650, |
|
"y": 720, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "cc9b2b14ee514bbe", |
|
"type": "link in", |
|
"z": "e6da46131ceed4fb", |
|
"name": "openai_dalle_in", |
|
"links": [], |
|
"x": 55, |
|
"y": 820, |
|
"wires": [ |
|
[ |
|
"1e8787cff0ccfe81" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "1e8787cff0ccfe81", |
|
"type": "change", |
|
"z": "e6da46131ceed4fb", |
|
"name": "Set resolution", |
|
"rules": [ |
|
{ |
|
"t": "set", |
|
"p": "payload.resolution", |
|
"pt": "msg", |
|
"to": "256x256", |
|
"tot": "str" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 220, |
|
"y": 820, |
|
"wires": [ |
|
[ |
|
"24112cb41f1f983f" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "5268a38e5582c90e", |
|
"type": "link out", |
|
"z": "e6da46131ceed4fb", |
|
"name": "openai_dalle_out", |
|
"mode": "return", |
|
"links": [], |
|
"x": 495, |
|
"y": 940, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "962dd3ca8a41dbfc", |
|
"type": "switch", |
|
"z": "e6da46131ceed4fb", |
|
"name": "Check if is email", |
|
"property": "from", |
|
"propertyType": "msg", |
|
"rules": [ |
|
{ |
|
"t": "nnull" |
|
}, |
|
{ |
|
"t": "else" |
|
} |
|
], |
|
"checkall": "true", |
|
"repair": false, |
|
"outputs": 2, |
|
"x": 320, |
|
"y": 480, |
|
"wires": [ |
|
[ |
|
"893f58f851b0fb7d" |
|
], |
|
[ |
|
"eb00035c36ac739f" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "893f58f851b0fb7d", |
|
"type": "change", |
|
"z": "e6da46131ceed4fb", |
|
"name": "", |
|
"rules": [ |
|
{ |
|
"t": "set", |
|
"p": "saveID", |
|
"pt": "msg", |
|
"to": "from", |
|
"tot": "msg" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 540, |
|
"y": 460, |
|
"wires": [ |
|
[ |
|
"1fb6c955238349a9" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "bdc1531b0db774c0", |
|
"type": "tab", |
|
"label": "ChatGPT - Email response", |
|
"disabled": false, |
|
"info": "", |
|
"env": [] |
|
}, |
|
{ |
|
"id": "1fbbc2fd3c5aef46", |
|
"type": "e-mail in", |
|
"z": "bdc1531b0db774c0", |
|
"name": "Email in", |
|
"protocol": "IMAP", |
|
"server": "outlook.office365.com", |
|
"useSSL": true, |
|
"autotls": "always", |
|
"port": "993", |
|
"box": "INBOX", |
|
"disposition": "Read", |
|
"criteria": "UNSEEN", |
|
"repeat": "10", |
|
"fetch": "auto", |
|
"inputs": 0, |
|
"x": 170, |
|
"y": 320, |
|
"wires": [ |
|
[ |
|
"0845f55f72a53031" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "4e2b1d95b0730506", |
|
"type": "e-mail", |
|
"z": "bdc1531b0db774c0", |
|
"server": "smtp-mail.outlook.com", |
|
"port": "587", |
|
"secure": false, |
|
"tls": true, |
|
"name": "", |
|
"dname": "Email output", |
|
"x": 610, |
|
"y": 160, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "77aef4c29312a425", |
|
"type": "inject", |
|
"z": "bdc1531b0db774c0", |
|
"name": "Inject email body & subject", |
|
"props": [ |
|
{ |
|
"p": "payload" |
|
}, |
|
{ |
|
"p": "topic", |
|
"vt": "str" |
|
} |
|
], |
|
"repeat": "", |
|
"crontab": "", |
|
"once": false, |
|
"onceDelay": 0.1, |
|
"topic": "This is a test Email from Node-RED", |
|
"payload": "Test email from Node-RED ChatGPT.", |
|
"payloadType": "str", |
|
"x": 210, |
|
"y": 160, |
|
"wires": [ |
|
[ |
|
"4e2b1d95b0730506" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "46bb8f78aa171d14", |
|
"type": "inject", |
|
"z": "bdc1531b0db774c0", |
|
"name": "Inject to HTML", |
|
"props": [ |
|
{ |
|
"p": "payload.generated_text", |
|
"v": "Test email from Node-RED ChatGPT.", |
|
"vt": "str" |
|
}, |
|
{ |
|
"p": "payload.img_url", |
|
"v": "https://picsum.photos/seed/picsum/256/256", |
|
"vt": "str" |
|
}, |
|
{ |
|
"p": "payload.img_prompt", |
|
"v": "a cute cat with green eyes", |
|
"vt": "str" |
|
}, |
|
{ |
|
"p": "topic", |
|
"vt": "str" |
|
}, |
|
{ |
|
"p": "to", |
|
"v": "[email protected]", |
|
"vt": "str" |
|
} |
|
], |
|
"repeat": "", |
|
"crontab": "", |
|
"once": false, |
|
"onceDelay": 0.1, |
|
"topic": "This is a test Email from Node-RED", |
|
"x": 180, |
|
"y": 200, |
|
"wires": [ |
|
[ |
|
"22e035cb5a9832f5" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "504a92166128ce1b", |
|
"type": "link call", |
|
"z": "bdc1531b0db774c0", |
|
"name": "", |
|
"links": [ |
|
"0a2a8c300fbe892c" |
|
], |
|
"linkType": "static", |
|
"timeout": "60", |
|
"x": 450, |
|
"y": 440, |
|
"wires": [ |
|
[ |
|
"18782e8eec2d74fa" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "d789180f7c2c5fd1", |
|
"type": "template", |
|
"z": "bdc1531b0db774c0", |
|
"name": "Ask GPT to respond", |
|
"field": "payload", |
|
"fieldType": "msg", |
|
"format": "handlebars", |
|
"syntax": "mustache", |
|
"template": "Respond to email with subject {{topic}} this content:\n{{payload}}", |
|
"output": "str", |
|
"x": 400, |
|
"y": 400, |
|
"wires": [ |
|
[ |
|
"504a92166128ce1b" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "f6b820180918c26a", |
|
"type": "template", |
|
"z": "bdc1531b0db774c0", |
|
"name": "Ask GPT to create prompt for Dall-e 2", |
|
"field": "payload", |
|
"fieldType": "msg", |
|
"format": "handlebars", |
|
"syntax": "mustache", |
|
"template": "Generate 10 one word tags, comma delimited, for this subject: {{topic}}", |
|
"output": "str", |
|
"x": 410, |
|
"y": 520, |
|
"wires": [ |
|
[ |
|
"087560c898efb069" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "087560c898efb069", |
|
"type": "link call", |
|
"z": "bdc1531b0db774c0", |
|
"name": "", |
|
"links": [ |
|
"0a2a8c300fbe892c" |
|
], |
|
"linkType": "static", |
|
"timeout": "60", |
|
"x": 510, |
|
"y": 560, |
|
"wires": [ |
|
[ |
|
"d8cc4079d1b2a9f8" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "48de465c1bc11465", |
|
"type": "link call", |
|
"z": "bdc1531b0db774c0", |
|
"name": "", |
|
"links": [ |
|
"cc9b2b14ee514bbe" |
|
], |
|
"linkType": "static", |
|
"timeout": "30", |
|
"x": 540, |
|
"y": 640, |
|
"wires": [ |
|
[ |
|
"05bcb447bf58143a", |
|
"fe665ab327d104d3" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "d8cc4079d1b2a9f8", |
|
"type": "change", |
|
"z": "bdc1531b0db774c0", |
|
"name": "", |
|
"rules": [ |
|
{ |
|
"t": "move", |
|
"p": "payload", |
|
"pt": "msg", |
|
"to": "payload.img_prompt", |
|
"tot": "msg" |
|
}, |
|
{ |
|
"t": "set", |
|
"p": "img_prompt", |
|
"pt": "msg", |
|
"to": "payload.img_prompt", |
|
"tot": "msg" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 520, |
|
"y": 600, |
|
"wires": [ |
|
[ |
|
"48de465c1bc11465" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "05bcb447bf58143a", |
|
"type": "change", |
|
"z": "bdc1531b0db774c0", |
|
"name": "", |
|
"rules": [ |
|
{ |
|
"t": "move", |
|
"p": "payload", |
|
"pt": "msg", |
|
"to": "payload.img_url", |
|
"tot": "msg" |
|
}, |
|
{ |
|
"t": "move", |
|
"p": "generated_text", |
|
"pt": "msg", |
|
"to": "payload.generated_text", |
|
"tot": "msg" |
|
}, |
|
{ |
|
"t": "move", |
|
"p": "img_prompt", |
|
"pt": "msg", |
|
"to": "payload.img_prompt", |
|
"tot": "msg" |
|
}, |
|
{ |
|
"t": "move", |
|
"p": "from", |
|
"pt": "msg", |
|
"to": "to", |
|
"tot": "msg" |
|
}, |
|
{ |
|
"t": "delete", |
|
"p": "html", |
|
"pt": "msg" |
|
}, |
|
{ |
|
"t": "delete", |
|
"p": "headers", |
|
"pt": "msg" |
|
}, |
|
{ |
|
"t": "delete", |
|
"p": "attachments", |
|
"pt": "msg" |
|
}, |
|
{ |
|
"t": "delete", |
|
"p": "header", |
|
"pt": "msg" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 740, |
|
"y": 640, |
|
"wires": [ |
|
[ |
|
"4af63bd7921275fd" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "18782e8eec2d74fa", |
|
"type": "change", |
|
"z": "bdc1531b0db774c0", |
|
"name": "", |
|
"rules": [ |
|
{ |
|
"t": "move", |
|
"p": "payload", |
|
"pt": "msg", |
|
"to": "generated_text", |
|
"tot": "msg" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 450, |
|
"y": 480, |
|
"wires": [ |
|
[ |
|
"f6b820180918c26a" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "caedb828f4c91a03", |
|
"type": "link in", |
|
"z": "bdc1531b0db774c0", |
|
"name": "email_response_in", |
|
"links": [ |
|
"4af63bd7921275fd" |
|
], |
|
"x": 235, |
|
"y": 240, |
|
"wires": [ |
|
[ |
|
"22e035cb5a9832f5" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "4af63bd7921275fd", |
|
"type": "link out", |
|
"z": "bdc1531b0db774c0", |
|
"name": "email_response_out", |
|
"mode": "link", |
|
"links": [ |
|
"caedb828f4c91a03" |
|
], |
|
"x": 865, |
|
"y": 640, |
|
"wires": [] |
|
}, |
|
{ |
|
"id": "0845f55f72a53031", |
|
"type": "function", |
|
"z": "bdc1531b0db774c0", |
|
"name": "Till the replay", |
|
"func": "//If this is a replay message, only pick the part till the replay, e.g. \"On Friday ..\"\nlet text = msg.payload;\nlet pattern = /[\\S\\s*]*(?=(\\u21b5|....|)On\\s+([^,])+.([^,])+.([^@])+)/g;\nlet match = text.match(pattern); \n\nif (match) {\n let extractedText = match[0].trim();\n msg.payload = extractedText;\n}\nreturn msg;", |
|
"outputs": 1, |
|
"noerr": 0, |
|
"initialize": "", |
|
"finalize": "", |
|
"libs": [], |
|
"x": 170, |
|
"y": 360, |
|
"wires": [ |
|
[ |
|
"5b80422576d9d1a4" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "5b80422576d9d1a4", |
|
"type": "change", |
|
"z": "bdc1531b0db774c0", |
|
"name": "", |
|
"rules": [ |
|
{ |
|
"t": "set", |
|
"p": "originalMail", |
|
"pt": "msg", |
|
"to": "payload", |
|
"tot": "msg" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 160, |
|
"y": 400, |
|
"wires": [ |
|
[ |
|
"d789180f7c2c5fd1" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "22e035cb5a9832f5", |
|
"type": "template", |
|
"z": "bdc1531b0db774c0", |
|
"name": "HTML Template", |
|
"field": "payload", |
|
"fieldType": "msg", |
|
"format": "html", |
|
"syntax": "mustache", |
|
"template": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional //EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\">\n<head>\n<!--[if gte mso 9]>\n<xml>\n <o:OfficeDocumentSettings>\n <o:AllowPNG/>\n <o:PixelsPerInch>96</o:PixelsPerInch>\n </o:OfficeDocumentSettings>\n</xml>\n<![endif]-->\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta name=\"x-apple-disable-message-reformatting\">\n <!--[if !mso]><!--><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><!--<![endif]-->\n <title></title>\n \n <style type=\"text/css\">\n @media only screen and (min-width: 520px) {\n .u-row {\n width: 500px !important;\n }\n .u-row .u-col {\n vertical-align: top;\n }\n\n .u-row .u-col-100 {\n width: 500px !important;\n }\n\n}\n\n@media (max-width: 520px) {\n .u-row-container {\n max-width: 100% !important;\n padding-left: 0px !important;\n padding-right: 0px !important;\n }\n .u-row .u-col {\n min-width: 320px !important;\n max-width: 100% !important;\n display: block !important;\n }\n .u-row {\n width: 100% !important;\n }\n .u-col {\n width: 100% !important;\n }\n .u-col > div {\n margin: 0 auto;\n }\n}\nbody {\n margin: 0;\n padding: 0;\n}\n\ntable,\ntr,\ntd {\n vertical-align: top;\n border-collapse: collapse;\n}\n\np {\n margin: 0;\n}\n\n.ie-container table,\n.mso-container table {\n table-layout: fixed;\n}\n\n* {\n line-height: inherit;\n}\n\na[x-apple-data-detectors='true'] {\n color: inherit !important;\n text-decoration: none !important;\n}\n\n@media (max-width: 480px) {\n .hide-mobile {\n max-height: 0px;\n overflow: hidden;\n display: none !important;\n }\n}\n\ntable, td { color: #000000; } #u_body a { color: #0000ee; text-decoration: underline; }\n </style>\n \n \n\n</head>\n\n<body class=\"clean-body u_body\" style=\"margin: 0;padding: 0;-webkit-text-size-adjust: 100%;background-color: #ffffff;color: #000000\">\n <!--[if IE]><div class=\"ie-container\"><![endif]-->\n <!--[if mso]><div class=\"mso-container\"><![endif]-->\n <table id=\"u_body\" style=\"border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;min-width: 320px;Margin: 0 auto;background-color: #ffffff;width:100%\" cellpadding=\"0\" cellspacing=\"0\">\n <tbody>\n <tr style=\"vertical-align: top\">\n <td style=\"word-break: break-word;border-collapse: collapse !important;vertical-align: top\">\n <!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td align=\"center\" style=\"background-color: #ffffff;\"><![endif]-->\n \n\n<div class=\"u-row-container\" style=\"padding: 20px;background-color: transparent\">\n <div class=\"u-row\" style=\"Margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #b9b9b9;\">\n <div style=\"border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;\">\n <!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"padding: 20px;background-color: transparent;\" align=\"center\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width:500px;\"><tr style=\"background-color: #b9b9b9;\"><![endif]-->\n \n<!--[if (mso)|(IE)]><td align=\"center\" width=\"500\" style=\"width: 500px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;\" valign=\"top\"><![endif]-->\n<div class=\"u-col u-col-100\" style=\"max-width: 320px;min-width: 500px;display: table-cell;vertical-align: top;\">\n <div style=\"height: 100%;width: 100% !important;\">\n <!--[if (!mso)&(!IE)]><!--><div style=\"box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;\"><!--<![endif]-->\n \n<table style=\"font-family:arial,helvetica,sans-serif;\" role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\">\n <tbody>\n <tr>\n <td style=\"overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;\" align=\"left\">\n \n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td style=\"padding-right: 0px;padding-left: 0px;\" align=\"center\">\n \n <img align=\"center\" border=\"0\" src=\"{{payload.img_url}}\" alt=\"{{payload.img_prompt}}\" title=\"{{payload.img_prompt}}\" style=\"outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: inline-block !important;border: none;height: auto;float: none;width: 100%;max-width: 100%;\" width=\"100\"/>\n \n </td>\n </tr>\n</table>\n\n </td>\n </tr>\n </tbody>\n</table>\n\n<table style=\"font-family:arial,helvetica,sans-serif;\" role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\">\n <tbody>\n <tr>\n <td style=\"overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;\" align=\"left\">\n \n <h1 style=\"margin: 0px; line-height: 140%; text-align: left; word-wrap: break-word; font-size: 22px; \">Image description</h1>\n\n </td>\n </tr>\n </tbody>\n</table>\n\n<table style=\"font-family:arial,helvetica,sans-serif;\" role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\">\n <tbody>\n <tr>\n <td style=\"overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;\" align=\"left\">\n \n <div style=\"line-height: 140%; text-align: left; word-wrap: break-word;\">\n <p style=\"line-height: 140%;\">This is an image description: {{payload.img_prompt}}</p>\n </div>\n\n </td>\n </tr>\n </tbody>\n</table>\n\n<table style=\"font-family:arial,helvetica,sans-serif;\" role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\">\n <tbody>\n <tr>\n <td style=\"overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;\" align=\"left\">\n \n <h1 style=\"margin: 0px; line-height: 140%; text-align: left; word-wrap: break-word; font-size: 22px; \">ChatGPT generated content</h1>\n\n </td>\n </tr>\n </tbody>\n</table>\n\n<table style=\"font-family:arial,helvetica,sans-serif;\" role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\">\n <tbody>\n <tr>\n <td style=\"overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;\" align=\"left\">\n \n <div style=\"line-height: 140%; text-align: left; word-wrap: break-word;\">\n <p style=\"line-height: 140%;\">ChatGPT generated content: {{payload.generated_text}}</p>\n </div>\n\n </td>\n </tr>\n </tbody>\n</table>\n\n<table style=\"font-family:arial,helvetica,sans-serif;\" role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\">\n <tbody>\n <tr>\n <td style=\"overflow-wrap:break-word;word-break:break-word;padding:12px;font-family:arial,helvetica,sans-serif;\" align=\"left\">\n \n<div class=\"menu\" style=\"text-align:center\">\n<!--[if (mso)|(IE)]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\"><tr><![endif]-->\n\n <!--[if (mso)|(IE)]><td style=\"padding:5px 15px\"><![endif]-->\n \n <a href=\"https://che-adrian.medium.com/\" target=\"_blank\" style=\"padding:5px 15px;display:inline-block;color:#0068A5;font-size:14px;text-decoration:none\" >\n Open Website\n </a>\n \n <!--[if (mso)|(IE)]></td><![endif]-->\n \n <!--[if (mso)|(IE)]><td style=\"padding:5px 15px\"><![endif]-->\n <span style=\"padding:5px 15px;display:inline-block;color:#444444;font-size:14px;\" class=\"hide-mobile\">\n -\n </span>\n <!--[if (mso)|(IE)]></td><![endif]-->\n \n\n <!--[if (mso)|(IE)]><td style=\"padding:5px 15px\"><![endif]-->\n \n <a href=\"https://che-adrian.medium.com/\" target=\"_blank\" style=\"padding:5px 15px;display:inline-block;color:#0068A5;font-size:14px;text-decoration:none\" >\n About us\n </a>\n \n <!--[if (mso)|(IE)]></td><![endif]-->\n \n\n<!--[if (mso)|(IE)]></tr></table><![endif]-->\n</div>\n\n </td>\n </tr>\n </tbody>\n</table>\n\n<table style=\"font-family:arial,helvetica,sans-serif;\" role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\">\n <tbody>\n <tr>\n <td style=\"overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;\" align=\"left\">\n \n <table height=\"0px\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;border-top: 1px solid #BBBBBB;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%\">\n <tbody>\n <tr style=\"vertical-align: top\">\n <td style=\"word-break: break-word;border-collapse: collapse !important;vertical-align: top;font-size: 0px;line-height: 0px;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%\">\n <span> </span>\n </td>\n </tr>\n </tbody>\n </table>\n\n </td>\n </tr>\n </tbody>\n</table>\n\n<table style=\"font-family:arial,helvetica,sans-serif;\" role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\">\n <tbody>\n <tr>\n <td style=\"overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;\" align=\"left\">\n \n <h1 style=\"margin: 0px; line-height: 140%; text-align: left; word-wrap: break-word; font-size: 22px; \">Footer</h1>\n\n </td>\n </tr>\n </tbody>\n</table>\n\n<table style=\"font-family:arial,helvetica,sans-serif;\" role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\">\n <tbody>\n <tr>\n <td style=\"overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;\" align=\"left\">\n \n <div style=\"line-height: 140%; text-align: left; word-wrap: break-word;\">\n <p style=\"line-height: 140%;\">This email was generated with the help of Dall-e 2 and ChatGPT</p>\n </div>\n\n </td>\n </tr>\n </tbody>\n</table>\n\n <!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->\n </div>\n</div>\n<!--[if (mso)|(IE)]></td><![endif]-->\n <!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->\n </div>\n </div>\n</div>\n\n\n <!--[if (mso)|(IE)]></td></tr></table><![endif]-->\n </td>\n </tr>\n </tbody>\n </table>\n <!--[if mso]></div><![endif]-->\n <!--[if IE]></div><![endif]-->\n</body>\n\n</html>", |
|
"output": "str", |
|
"x": 420, |
|
"y": 200, |
|
"wires": [ |
|
[ |
|
"4e2b1d95b0730506" |
|
] |
|
] |
|
}, |
|
{ |
|
"id": "3f00ca79b193a2b7", |
|
"type": "change", |
|
"z": "bdc1531b0db774c0", |
|
"name": "", |
|
"rules": [ |
|
{ |
|
"t": "set", |
|
"p": "payload", |
|
"pt": "msg", |
|
"to": "", |
|
"tot": "str" |
|
} |
|
], |
|
"action": "", |
|
"property": "", |
|
"from": "", |
|
"to": "", |
|
"reg": false, |
|
"x": 540, |
|
"y": 300, |
|
"wires": [ |
|
[] |
|
] |
|
}, |
|
{ |
|
"id": "fe665ab327d104d3", |
|
"type": "image", |
|
"z": "bdc1531b0db774c0", |
|
"name": "", |
|
"width": 160, |
|
"data": "payload", |
|
"dataType": "msg", |
|
"thumbnail": false, |
|
"active": true, |
|
"pass": false, |
|
"outputs": 0, |
|
"x": 560, |
|
"y": 680, |
|
"wires": [] |
|
} |
|
] |
Check out this repository: https://github.com/cheadrian/node-red-flows