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();nodejs functions
-
Sometimes when I run a node js snippet of code it does not give me the response form the executed code.
How do I make it wait for the response before skipping past it? New to this are thanks. -
@hellomembersha said in nodejs functions:
Sometimes when I run a node js snippet of code it does not give me the response form the executed code.
How do I make it wait for the response before skipping past it? New to this are thanks.https://community.bablosoft.com/topic/4450/websocket-на-node-js/6