Skip to content

Instantly share code, notes, and snippets.

@gdziuba
Last active June 13, 2024 16:13
Show Gist options
  • Save gdziuba/073548c276832e804f037f3212014e60 to your computer and use it in GitHub Desktop.
Save gdziuba/073548c276832e804f037f3212014e60 to your computer and use it in GitHub Desktop.
ChatGPT Assistant Integration (API version v2)

ChatGPT Assistant Integration

Updates

  • Removed the need for a dependency called "String" and replaced with a function
  • Upgraded to v2 of the API

What is a ChatGPT Assistant?

A ChatGPT assistant is an artificial intelligence model developed by OpenAI. It's designed to generate human-like text based on the input it's given. GPT stands for "Generative Pretrained Transformer", which is a type of language processing AI model. The model has been trained on a diverse range of internet text, but it doesn't know specific documents or sources it was trained on. It's a tool that can be used for a variety of tasks, such as drafting emails, writing code, creating written content, answering questions, tutoring, translating languages, simulating characters for video games, and much more.

Example Assistant Integrations in this Flow

Create Assistant: This flow creates a new assistant. It starts with an inject node that sets the assistant's name, instructions, tools, and model. The HTTP request node then sends a POST request to the OpenAI API to create the assistant. The assistant's ID is stored in the flow context for later use.

List Assistants: This flow lists all the assistants that have been created. It starts with an inject node that triggers the flow. The HTTP request node sends a GET request to the OpenAI API to retrieve the list of assistants. The results are then displayed in the debug node.

Delete Assistant: This flow deletes an assistant. It starts with an inject node that sets the assistant's ID. The template node constructs the URL for the HTTP request node, which sends a DELETE request to the OpenAI API to delete the assistant. The results are then displayed in the debug node.

Adjust Assistant Instructions and Models: This flow adjusts the instructions and model of an assistant. It starts with an inject node that sets the assistant's ID, new instructions, and new model. The change node prepares the payload for the HTTP request node, which sends a POST request to the OpenAI API to update the assistant. The results are then displayed in the debug node.

Create Thread and Run: This flow creates a new thread and runs it. It starts with an inject node that sets the assistant's ID and the message to be sent. The subflow node then handles the creation of the thread, sending of the message, and retrieval of the response. The results are then displayed in the debug node.

Please note that you need to provide your OpenAI API key in each of the HTTP request nodes for these flows to work.

ChatGPT Assistant API Documentation

[{"id":"28ea9176af24b3f7","type":"group","z":"cca0ad61e3720bcb","name":"Create Assistant","style":{"label":true},"nodes":["4567b9bf5a391a9e","a99a086bb262e5c2","f431cb8902d869f2","9085857a877f7f57","828c5ee4f90b8b16"],"x":54,"y":59,"w":912,"h":82},{"id":"4567b9bf5a391a9e","type":"http request","z":"cca0ad61e3720bcb","g":"28ea9176af24b3f7","name":"P /v2/assistants","method":"POST","ret":"obj","paytoqs":"ignore","url":"https://api.openai.com/v1/assistants","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"Accept","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"other","keyValue":"OpenAI-Beta","valueType":"other","valueValue":"assistants=v2"}],"x":480,"y":100,"wires":[["a99a086bb262e5c2"]]},{"id":"a99a086bb262e5c2","type":"change","z":"cca0ad61e3720bcb","g":"28ea9176af24b3f7","name":"","rules":[{"t":"set","p":"assistant_id","pt":"flow","to":"payload.id","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":100,"wires":[["f431cb8902d869f2"]]},{"id":"f431cb8902d869f2","type":"debug","z":"cca0ad61e3720bcb","g":"28ea9176af24b3f7","name":"debug 27","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":860,"y":100,"wires":[]},{"id":"9085857a877f7f57","type":"change","z":"cca0ad61e3720bcb","g":"28ea9176af24b3f7","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.instructions","pt":"msg","to":"instructions","tot":"msg"},{"t":"set","p":"payload.name","pt":"msg","to":"name","tot":"msg"},{"t":"set","p":"payload.tools","pt":"msg","to":"[{\"type\": \"code_interpreter\"}]","tot":"json"},{"t":"set","p":"payload.model","pt":"msg","to":"model","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":100,"wires":[["4567b9bf5a391a9e"]]},{"id":"828c5ee4f90b8b16","type":"inject","z":"cca0ad61e3720bcb","g":"28ea9176af24b3f7","name":"","props":[{"p":"instructions","v":"You are a personal math tutor. When asked a question, write and run Python code to answer the question.","vt":"str"},{"p":"name","v":"Math Tutor 3","vt":"str"},{"p":"tools","v":"[{\"type\": \"code_interpreter\"}]","vt":"json"},{"p":"model","v":"gpt-4o","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":150,"y":100,"wires":[["9085857a877f7f57"]]},{"id":"a4e1104c93395af5","type":"group","z":"cca0ad61e3720bcb","name":"List Assistants","style":{"label":true},"nodes":["1e1476913553ebb8","60604c72c04dc406","2fe5efbb4d03aca2"],"x":54,"y":159,"w":592,"h":82},{"id":"1e1476913553ebb8","type":"inject","z":"cca0ad61e3720bcb","g":"a4e1104c93395af5","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":200,"wires":[["60604c72c04dc406"]]},{"id":"60604c72c04dc406","type":"http request","z":"cca0ad61e3720bcb","g":"a4e1104c93395af5","name":"G /v1/assistants","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://api.openai.com/v1/assistants","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"Accept","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"other","keyValue":"OpenAI-Beta","valueType":"other","valueValue":"assistants=v2"}],"x":320,"y":200,"wires":[["2fe5efbb4d03aca2"]]},{"id":"2fe5efbb4d03aca2","type":"debug","z":"cca0ad61e3720bcb","g":"a4e1104c93395af5","name":"debug 28","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":540,"y":200,"wires":[]},{"id":"c97483efe6918d76","type":"group","z":"cca0ad61e3720bcb","name":"Delete Assistant","style":{"label":true},"nodes":["2265cbf6c21ed5da","a18bb7c4daaea33d","5c76528cd187eab0","01e5d7946f5e78b8"],"x":54,"y":259,"w":772,"h":82},{"id":"2265cbf6c21ed5da","type":"inject","z":"cca0ad61e3720bcb","g":"c97483efe6918d76","name":"","props":[{"p":"assistant_id","v":"asst_BljkUvdO2kzjIS8XVlo2pRFE","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":150,"y":300,"wires":[["01e5d7946f5e78b8"]]},{"id":"a18bb7c4daaea33d","type":"http request","z":"cca0ad61e3720bcb","g":"c97483efe6918d76","name":"Delete /v1/assistants/{assistant_id}","method":"DELETE","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"Accept","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"other","keyValue":"OpenAI-Beta","valueType":"other","valueValue":"assistants=v2"}],"x":500,"y":300,"wires":[["5c76528cd187eab0"]]},{"id":"5c76528cd187eab0","type":"debug","z":"cca0ad61e3720bcb","g":"c97483efe6918d76","name":"debug 29","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":720,"y":300,"wires":[]},{"id":"01e5d7946f5e78b8","type":"template","z":"cca0ad61e3720bcb","g":"c97483efe6918d76","name":"","field":"url","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"https://api.openai.com/v1/assistants/{{assistant_id}}","output":"str","x":280,"y":300,"wires":[["a18bb7c4daaea33d"]]},{"id":"a0a51984333a716b","type":"group","z":"cca0ad61e3720bcb","name":"Adjust Assistant Instructions and Models","style":{"label":true},"nodes":["5b7ab1ad7c1cec95","ec4270f80ef7a4ec","69d0f7d377c1f18a","cb22c03487a30d33","c4aab450b7c57c76"],"x":54,"y":359,"w":1052,"h":82},{"id":"5b7ab1ad7c1cec95","type":"http request","z":"cca0ad61e3720bcb","g":"a0a51984333a716b","name":"P https://api.openai.com/v1/assistants/{assistant_id}","method":"POST","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"Accept","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"other","keyValue":"OpenAI-Beta","valueType":"other","valueValue":"assistants=v2"}],"x":730,"y":400,"wires":[["cb22c03487a30d33"]]},{"id":"ec4270f80ef7a4ec","type":"template","z":"cca0ad61e3720bcb","g":"a0a51984333a716b","name":"","field":"url","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"https://api.openai.com/v1/assistants/{{assistant}}","output":"str","x":460,"y":400,"wires":[["5b7ab1ad7c1cec95"]]},{"id":"69d0f7d377c1f18a","type":"inject","z":"cca0ad61e3720bcb","g":"a0a51984333a716b","name":"","props":[{"p":"instructions","v":"You will add the two numbers I give you together","vt":"str"},{"p":"model","v":"gpt-4o","vt":"str"},{"p":"assistant","v":"asst_xyFvrgCSF0FrhBsHNMxsDuiz","vt":"str"},{"p":"tools","v":"[{\"type\": \"code_interpreter\"}]","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":150,"y":400,"wires":[["c4aab450b7c57c76"]]},{"id":"cb22c03487a30d33","type":"debug","z":"cca0ad61e3720bcb","g":"a0a51984333a716b","name":"debug 30","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1000,"y":400,"wires":[]},{"id":"c4aab450b7c57c76","type":"change","z":"cca0ad61e3720bcb","g":"a0a51984333a716b","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.instructions","pt":"msg","to":"instructions","tot":"msg"},{"t":"set","p":"payload.model","pt":"msg","to":"model","tot":"msg"},{"t":"set","p":"payload.tools","pt":"msg","to":"tools","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":400,"wires":[["ec4270f80ef7a4ec"]]},{"id":"8180f92255152d0d","type":"group","z":"cca0ad61e3720bcb","name":"Create Thread and Run","style":{"label":true},"nodes":["610395b9862dfb10","9e14af3be8a75fc3","7bdbd43e0d6125db"],"x":54,"y":459,"w":592,"h":82},{"id":"c67b9cc1d861cdbf","type":"subflow","name":"Subflow 2","info":"","in":[{"x":560,"y":240,"wires":[{"id":"6eb7df2eeeab06a7"}]}],"out":[{"x":1660,"y":780,"wires":[{"id":"f3330fc281544259","port":0}]}],"status":{"x":1660,"y":400,"wires":[{"id":"91d73f7b0a6e6008","port":0},{"id":"770bb187b096a1b3","port":0},{"id":"b05e12cb2729af52","port":0},{"id":"120d5ed2846e721d","port":0},{"id":"60fa27bda3c48bec","port":0},{"id":"38a90d6290c0cf80","port":0}]}},{"id":"6eb7df2eeeab06a7","type":"http request","z":"c67b9cc1d861cdbf","g":"e4516372d4eb7b49","name":"P v1/threads","method":"POST","ret":"obj","paytoqs":"ignore","url":"https://api.openai.com/v1/threads","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"Accept","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"other","keyValue":"OpenAI-Beta","valueType":"other","valueValue":"assistants=v2"}],"x":790,"y":240,"wires":[["674cce04775beeda"]]},{"id":"b46a01eb6293830d","type":"http request","z":"c67b9cc1d861cdbf","g":"bef73895f43aa857","name":"P v1/threads/thread_id/messages","method":"POST","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"Accept","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"other","keyValue":"OpenAI-Beta","valueType":"other","valueValue":"assistants=v2"}],"x":1040,"y":360,"wires":[["770bb187b096a1b3","22678cb717e870e3"]]},{"id":"6ce2dcb77d02a8f7","type":"template","z":"c67b9cc1d861cdbf","g":"bef73895f43aa857","name":"","field":"url","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"https://api.openai.com/v1/threads/{{payload.id}}/messages","output":"str","x":380,"y":360,"wires":[["67a63a0a97eb15b6"]]},{"id":"bf852c5c298ac429","type":"http request","z":"c67b9cc1d861cdbf","g":"0d752b795c40d617","name":"G v1/threads/thread_id/runs","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"Accept","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"other","keyValue":"OpenAI-Beta","valueType":"other","valueValue":"assistants=v2"}],"x":460,"y":480,"wires":[["ecde1eba42e4f6e2"]]},{"id":"cc2aa6929302b2a2","type":"template","z":"c67b9cc1d861cdbf","g":"0d752b795c40d617","name":"","field":"url","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"https://api.openai.com/v1/threads/{{thread}}/runs","output":"str","x":240,"y":480,"wires":[["bf852c5c298ac429"]]},{"id":"674cce04775beeda","type":"change","z":"c67b9cc1d861cdbf","g":"e4516372d4eb7b49","name":"","rules":[{"t":"set","p":"thread","pt":"msg","to":"payload.id","tot":"msg"},{"t":"set","p":"assistant","pt":"msg","to":"assistant_id","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":240,"wires":[["91d73f7b0a6e6008","01818dc70a295263"]]},{"id":"bbe24f48643f8777","type":"http request","z":"c67b9cc1d861cdbf","g":"0d752b795c40d617","name":"P /v1/threads/{thread_id}/runs","method":"POST","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"Accept","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"other","keyValue":"OpenAI-Beta","valueType":"other","valueValue":"assistants=v2"}],"x":950,"y":480,"wires":[["83ae1099e23c0a08","b05e12cb2729af52"]]},{"id":"b7b9ed88dfec1bcf","type":"http request","z":"c67b9cc1d861cdbf","g":"e038a90c5e31e217","name":"G /v1/threads/{thread_ID}/runs/{run_id}","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"Accept","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"other","keyValue":"OpenAI-Beta","valueType":"other","valueValue":"assistants=v2"}],"x":810,"y":660,"wires":[["700ee122747c81ae"]]},{"id":"700ee122747c81ae","type":"switch","z":"c67b9cc1d861cdbf","g":"e038a90c5e31e217","name":"","property":"payload.status","propertyType":"msg","rules":[{"t":"eq","v":"in_progress","vt":"str"},{"t":"eq","v":"completed","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1030,"y":660,"wires":[["e5676280d77d712c","60fa27bda3c48bec"],["9710ac9e37b4a232"],["38a90d6290c0cf80"]]},{"id":"e5676280d77d712c","type":"delay","z":"c67b9cc1d861cdbf","g":"e038a90c5e31e217","name":"Random Timer","pauseType":"random","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"2","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":920,"y":600,"wires":[["b7b9ed88dfec1bcf"]]},{"id":"83ae1099e23c0a08","type":"template","z":"c67b9cc1d861cdbf","g":"e038a90c5e31e217","name":"","field":"url","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"https://api.openai.com/v1/threads/{{thread}}/runs/{{payload.id}}","output":"str","x":500,"y":660,"wires":[["b7b9ed88dfec1bcf"]]},{"id":"f3330fc281544259","type":"http request","z":"c67b9cc1d861cdbf","g":"5ff9aba947e50aeb","name":"G /v1/threads/{thread_id}/messages","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"Accept","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"other","keyValue":"OpenAI-Beta","valueType":"other","valueValue":"assistants=v2"}],"x":940,"y":780,"wires":[["120d5ed2846e721d"]]},{"id":"9710ac9e37b4a232","type":"template","z":"c67b9cc1d861cdbf","g":"5ff9aba947e50aeb","name":"","field":"url","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"https://api.openai.com/v1/threads/{{thread}}/messages","output":"str","x":720,"y":780,"wires":[["f3330fc281544259"]]},{"id":"91d73f7b0a6e6008","type":"change","z":"c67b9cc1d861cdbf","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Create Thread","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1380,"y":260,"wires":[[]]},{"id":"770bb187b096a1b3","type":"change","z":"c67b9cc1d861cdbf","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Passed Message","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1380,"y":360,"wires":[[]]},{"id":"b05e12cb2729af52","type":"change","z":"c67b9cc1d861cdbf","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Run","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1380,"y":460,"wires":[[]]},{"id":"120d5ed2846e721d","type":"change","z":"c67b9cc1d861cdbf","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Done","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1380,"y":740,"wires":[[]]},{"id":"60fa27bda3c48bec","type":"change","z":"c67b9cc1d861cdbf","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Waiting for Result","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1380,"y":580,"wires":[[]]},{"id":"67a63a0a97eb15b6","type":"change","z":"c67b9cc1d861cdbf","g":"bef73895f43aa857","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.role","pt":"msg","to":"user","tot":"str"},{"t":"set","p":"payload.content","pt":"msg","to":"message","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":360,"wires":[["d0fd6ef8b0bff7d8"]]},{"id":"ecde1eba42e4f6e2","type":"change","z":"c67b9cc1d861cdbf","g":"0d752b795c40d617","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.assistant_id","pt":"msg","to":"assistant","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":480,"wires":[["bbe24f48643f8777"]]},{"id":"38a90d6290c0cf80","type":"change","z":"c67b9cc1d861cdbf","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Error","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1380,"y":660,"wires":[[]]},{"id":"67a914a7e48af706","type":"comment","z":"c67b9cc1d861cdbf","name":"API Key","info":"You will have to get an API key from OpenAI \nand enter in each of the http requests nodes ","x":960,"y":80,"wires":[]},{"id":"d0fd6ef8b0bff7d8","type":"function","z":"c67b9cc1d861cdbf","g":"bef73895f43aa857","name":"decodeHTMLEntries","func":"// Function to decode HTML entities\nfunction decodeHTMLEntities(text) {\n // Ensure the input is a string\n text = String(text);\n\n const entities = {\n 'amp': '&',\n 'apos': \"'\",\n 'lt': '<',\n 'gt': '>',\n 'quot': '\"',\n '#39': \"'\"\n };\n\n return text.replace(/&([^;]+);/g, (entity, entityCode) => {\n let match;\n\n if (entities[entityCode]) {\n return entities[entityCode];\n } else if (match = entityCode.match(/^#x([\\da-fA-F]+)$/)) {\n return String.fromCharCode(parseInt(match[1], 16));\n } else if (match = entityCode.match(/^#(\\d+)$/)) {\n return String.fromCharCode(~~match[1]);\n } else {\n return entity;\n }\n });\n}\n\n// Use the function to decode the payload\nmsg.payload = decodeHTMLEntities(msg.payload);\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":360,"wires":[["b46a01eb6293830d"]]},{"id":"01818dc70a295263","type":"junction","z":"c67b9cc1d861cdbf","x":120,"y":360,"wires":[["6ce2dcb77d02a8f7"]]},{"id":"22678cb717e870e3","type":"junction","z":"c67b9cc1d861cdbf","x":120,"y":440,"wires":[["cc2aa6929302b2a2"]]},{"id":"e4516372d4eb7b49","type":"group","z":"c67b9cc1d861cdbf","name":"Create Thread","style":{"label":true},"nodes":["6eb7df2eeeab06a7","674cce04775beeda"],"x":694,"y":199,"w":412,"h":82},{"id":"bef73895f43aa857","type":"group","z":"c67b9cc1d861cdbf","name":"Create Message","style":{"label":true},"nodes":["b46a01eb6293830d","6ce2dcb77d02a8f7","67a63a0a97eb15b6","d0fd6ef8b0bff7d8"],"x":294,"y":319,"w":912,"h":82},{"id":"0d752b795c40d617","type":"group","z":"c67b9cc1d861cdbf","name":"List Runs and Starts Runs","style":{"label":true},"nodes":["bf852c5c298ac429","cc2aa6929302b2a2","bbe24f48643f8777","ecde1eba42e4f6e2"],"x":154,"y":439,"w":952,"h":82},{"id":"e038a90c5e31e217","type":"group","z":"c67b9cc1d861cdbf","name":"Check for Results","style":{"label":true},"nodes":["b7b9ed88dfec1bcf","700ee122747c81ae","e5676280d77d712c","83ae1099e23c0a08"],"x":414,"y":559,"w":692,"h":149.5},{"id":"5ff9aba947e50aeb","type":"group","z":"c67b9cc1d861cdbf","name":"Show Results","style":{"label":true},"nodes":["f3330fc281544259","9710ac9e37b4a232"],"x":634,"y":739,"w":472,"h":82},{"id":"610395b9862dfb10","type":"inject","z":"cca0ad61e3720bcb","g":"8180f92255152d0d","name":"","props":[{"p":"message","v":"Hello &amp; welcome to Node-RED! &lt;Enjoy coding&gt; &quot;Best regards&quot; &#39;Grey&#39;","vt":"str"},{"p":"assistant_id","v":"asst_xyFvrgCSF0FrhBsHNMxsDuiz","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":150,"y":500,"wires":[["9e14af3be8a75fc3"]]},{"id":"9e14af3be8a75fc3","type":"subflow:c67b9cc1d861cdbf","z":"cca0ad61e3720bcb","g":"8180f92255152d0d","name":"Call Chat GPT Assistant","x":330,"y":500,"wires":[["7bdbd43e0d6125db"]]},{"id":"7bdbd43e0d6125db","type":"debug","z":"cca0ad61e3720bcb","g":"8180f92255152d0d","name":"debug 31","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":540,"y":500,"wires":[]}]
@gdziuba
Copy link
Author

gdziuba commented Nov 23, 2023

Try gpt-3.5-turbo

@mattscholer
Copy link

Try gpt-3.5-turbo

That worked, Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment