You can use Make.com or Integromat with the OpenAI API to generate a JavaScript Code snippet. To do this, you need to register with OpenAI and create an API key. I can only recommend to go to a paid plan, because then you get fewer times to see that openai is overloaded at the moment.
| Field | Value |
|---|---|
| Input-Field | {"json":{"APIKEY":"INSERT-YOUR-APIKEY","prompt":"/* Create an array in javascript of weather temperatures for Los Angeles */"}} |
| JS-Code-Field | const openai = new OpenAI({ apiKey: input.json.APIKEY}); const completion = await openai.chat.completions.create({ messages: [{ role: "user", content: input.json.prompt }], model: "gpt-3.5-turbo"}); return completion.choices; |
| Output-Field | { output: "{\"output\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"var weatherTemperatures = [];\"},\"logprobs\":null,\"finish_reason\":\"stop\"}]}" } |