It does not work if I do this:
const OpenAI = require('openai'); const openai = new OpenAI({ apiKey: [[CHATGPTAPIKEY]] }); async function main() { const completion = await openai.chat.completions.create({ model: [[MODEL]], messages: [ {"role": "system", "content": "You are a "+[[COMMENTSTYLE]]+" assistant."}, {"role": "user", "content": [[SAVED_TEXT]]} ], temperature: [[TEMPERATURE2]], max_tokens: 150, stop: ["\n", "User:"], n: 1 }); [[OUTPUT]] = completion.choices[0]; } main();[How to] If variable is empty, break loop and move to next
-
I made a bot which takes image url from site A and posts it on site B. Sometimes there is no image url on site A and bot posts blank post (without image) on site B. I want to make a bot break if there is no image url. I tried IF logic function:
IF
[[LINK_URL]]==null
BreakBut it doesn't work, i tried also
IF
[[LINK_URL]]==0
Breakdoesn't work neither. How to do that?
-
@cezar said in [How to] If variable is empty, break loop and move to next:
It doesn't work, i tried
Before setting conditions, you should find out what value is in the variable if the image is not found. Most likely this condition will work:
[[LINK_URL]] == "" -
@Fox Thank you for this info.
I think it is the right place to ask how to do the reverse work.
I do mean i would like to set a variable to empty. I have the error message : Variable value is emptyThanks a lot for the time
Edit : Oh my Bad sorry!
I forgot i ve seen previously in the forum that increasing variable with 0 was doing it!
So problem solved!
