Untitled

 avatar
unknown
plain_text
2 years ago
12 kB
48
Indexable
[{"id":"86f77e6cfc3a4575","type":"inject","z":"55a918692c53dec6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":140,"wires":[["f1373de5e1db7dae"]]},{"id":"f1373de5e1db7dae","type":"function","z":"55a918692c53dec6","name":"images/generations","func":"// 바닷가에서 우주선 위에서 뛰고 있는 웰시코기 강아지 그림을 하나 그려주세요. \n// Draw a picture of a Welsh Corgi puppy jumping on a spaceship at the beach.\n// Picture of a Welsh Corgi puppy watching the Qatar World Cup football match\n// A Jindo dog riding an elevator at the top of Baekdu Mountain\n// A painting of Elon Musk flying to Mars in space\n// A\n// An illustration of a mysterious sloth prince having fun in his spaceship in space\n// An illustration of the mysterious Prince Pikachu attending his coronation in space\n// An illustration of the mysterious Prince Pikachu attending his coronation while being celebrated by several people in space.\n// Welsh corgi puppy at the coronation ceremony amidst congratulations from space\n// Photos where the goddess meets the mysterious sky castle\n// Art painting where the goddess meets the mystical sky castle\n// Mysterious White Tiger and White Goddess A work of art that exudes a mysterious atmosphere\n// An astronaut riding a horse in the style of Andy Warhol 앤디 워홀 스타일의 말을 타고 있는 우주비행사\n// An astronaut riding a horse in a photorealistic style\n// An astronaut lounging in a tropical resort in space in a vaporwave style\n// An astronaut playing basketball with cats in space in a photorealistic style\n// Michael Jordan can't dunk in realistic style\nmsg.api = 'images/generations';\nmsg.params = {\n    \"prompt\": msg.payload,\n    \"n\": 1,\n    \"size\": \"1024x1024\"\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":140,"wires":[["ba366f521e37fd45"]]},{"id":"ba366f521e37fd45","type":"openai","z":"55a918692c53dec6","name":"","api":"","creds":"cc2050a953749795","x":550,"y":140,"wires":[["378f26337a7f8b69","ef5d7cb19c851f20"]]},{"id":"378f26337a7f8b69","type":"function","z":"55a918692c53dec6","name":"set res","func":"msg.payload = msg.payload.data;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":140,"wires":[["cde0d11b62104a2f"]]},{"id":"cde0d11b62104a2f","type":"split","z":"55a918692c53dec6","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":830,"y":140,"wires":[["bffb7932e532a632"]]},{"id":"bffb7932e532a632","type":"delay","z":"55a918692c53dec6","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":990,"y":140,"wires":[["b3d74d3fd8e74377"]]},{"id":"b3d74d3fd8e74377","type":"function","z":"55a918692c53dec6","name":"set url","func":"// msg.url = 'https://oaidalleapiprodscus.blob.core.windows.net/private/org-SmxuoMSGDcf6Id0DvHHr9RvB/user-b1aKLHzDKrM2Qf4lXFQmgLc6/img-SCLTb2ewE6eMW58Etzdfylpb.png?st=2022-12-12T03%3A48%3A08Z&se=2022-12-12T05%3A48%3A08Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2022-12-12T03%3A18%3A35Z&ske=2022-12-13T03%3A18%3A35Z&sks=b&skv=2021-08-06&sig=TpyjubAqF061ToVFtweYxXgzoBa%2BUDy2wmh/8AS9pq4%3D';\nmsg.url = msg.payload.url;\nfor(var i in msg.url.split('/')){\n    // node.error(i);\n    if (msg.url.split('/')[i].indexOf('.png')>-1){\n        // node.error(msg.url.split('/')[i].split('.png')[0]);\n        msg.filename = msg.url.split('/')[i].split('.png')[0] + '.png';\n    }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":330,"y":180,"wires":[["f76b58745b113f21"]]},{"id":"f76b58745b113f21","type":"http request","z":"55a918692c53dec6","name":"file download","method":"GET","ret":"bin","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":570,"y":180,"wires":[["945fd306662fe5f1"]]},{"id":"945fd306662fe5f1","type":"function","z":"55a918692c53dec6","name":"set filename","func":"msg.filename = ''+msg.filename \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":180,"wires":[["c5187586957870b2"]]},{"id":"c5187586957870b2","type":"file","z":"55a918692c53dec6","name":"","filename":"/config/www/chatgpt.jpg","filenameType":"str","appendNewline":true,"createDir":true,"overwriteFile":"true","encoding":"none","x":990,"y":180,"wires":[["e091107e26ad46a7"]]},{"id":"e091107e26ad46a7","type":"image","z":"55a918692c53dec6","name":"","width":160,"data":"payload","dataType":"msg","thumbnail":true,"active":true,"pass":true,"outputs":1,"x":1220,"y":180,"wires":[[]]},{"id":"83da6cc7c801df82","type":"server-state-changed","z":"55a918692c53dec6","name":"","server":"81ffd19b.25c18","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_text.aiart","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":60,"wires":[["f1373de5e1db7dae","0793fcc2a7be95bc"]]},{"id":"0793fcc2a7be95bc","type":"debug","z":"55a918692c53dec6","name":"debug 64","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":440,"y":60,"wires":[]},{"id":"ef5d7cb19c851f20","type":"debug","z":"55a918692c53dec6","name":"debug 65","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":740,"y":80,"wires":[]},{"id":"da268b7e30a3a198","type":"server-state-changed","z":"55a918692c53dec6","name":"","server":"81ffd19b.25c18","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_text.chatgpt","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":260,"wires":[["fdff85e643c5691a"]]},{"id":"fdff85e643c5691a","type":"function","z":"55a918692c53dec6","name":"completions","func":"msg.api = 'completions';\nmsg.params = {\n    \"model\": \"text-davinci-003\",\n    \"prompt\": msg.payload,\n    \"max_tokens\": 1000,\n    \"temperature\": 0\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":300,"wires":[["206cd30770cf63b1"]]},{"id":"646d319c2f87a8ab","type":"inject","z":"55a918692c53dec6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"what is a poem","payloadType":"str","x":160,"y":360,"wires":[["fdff85e643c5691a"]]},{"id":"206cd30770cf63b1","type":"openai","z":"55a918692c53dec6","name":"","api":"","creds":"cc2050a953749795","x":450,"y":300,"wires":[["cc4aef271161f6ad"]]},{"id":"cc4aef271161f6ad","type":"change","z":"55a918692c53dec6","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.choices[0].text","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":300,"wires":[["ca19abb05cd1d86d","4a0ffd62d938e993","43bbda43c671bf98"]]},{"id":"4a0ffd62d938e993","type":"api-call-service","z":"55a918692c53dec6","name":"notify assfirmation","server":"81ffd19b.25c18","version":5,"debugenabled":false,"domain":"notify","service":"alexa_media_echo_dot","areaId":[],"deviceId":[],"entityId":[],"data":"{    \"message\":  msg.payload  ,    \"data\": {        \"type\": \"tts\"    }}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":810,"y":260,"wires":[[]]},{"id":"ca19abb05cd1d86d","type":"debug","z":"55a918692c53dec6","name":"debug 57","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":900,"y":300,"wires":[]},{"id":"43bbda43c671bf98","type":"string","z":"55a918692c53dec6","name":"","methods":[{"name":"left","params":[{"type":"num","value":"230"}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":730,"y":340,"wires":[["623333aef0637b71"]]},{"id":"623333aef0637b71","type":"string","z":"55a918692c53dec6","name":"","methods":[{"name":"truncate","params":[{"type":"num","value":"244"},{"type":"str","value":""}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":870,"y":360,"wires":[["a5e951e64e05f8b6"]]},{"id":"a5e951e64e05f8b6","type":"contrib-json","z":"55a918692c53dec6","engine":"JSONSelect","command":"jq","expr":":root","complete":"property","prop":"payload","name":"","x":990,"y":380,"wires":[["a6b9834e95f33792"]]},{"id":"a6b9834e95f33792","type":"json","z":"55a918692c53dec6","name":"","property":"payload","action":"","pretty":false,"x":1110,"y":380,"wires":[["2c3f237f2c05a130"]]},{"id":"2c3f237f2c05a130","type":"template","z":"55a918692c53dec6","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n    \"work\": \"{{payload}}\"\n} ","output":"str","x":1220,"y":320,"wires":[["a7f4e65ec6aa71fd","348969fa056cb464"]]},{"id":"348969fa056cb464","type":"mqtt out","z":"55a918692c53dec6","name":"","topic":"chatgpt/ai","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"4dab380.a1f1bc8","x":1380,"y":360,"wires":[]},{"id":"a7f4e65ec6aa71fd","type":"debug","z":"55a918692c53dec6","name":"debug 63","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1400,"y":400,"wires":[]},{"id":"cc2050a953749795","type":"openaiApiKey","name":""},{"id":"81ffd19b.25c18","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"4dab380.a1f1bc8","type":"mqtt-broker","name":"HA","broker":"10.0.0.240","port":"1883","clientid":"","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]
Editor is loading...