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 do I set text from variable into a another variable?
-
I have JS code . How to set the contents (text) of the [[LIST_WITH_FILE_CONTENT]] variable
in the variablelet list =instead of this text
When I consider every thing that grows Holds in perfection but a little moment, Vaunt in their youthful sap, at height decrease, And wear their brave state out of memoryIn this JS-code:
let list = `When I consider every thing that grows Holds in perfection but a little moment, Vaunt in their youthful sap, at height decrease, And wear their brave state out of memory`.split('\n'); for(let i = 0, temp = []; i < list.length; i++) { if(temp.includes(list[i].toLowerCase())) { list.splice(i, 1); i--; } else { temp.push(list[i].toLowerCase()); } } console.log(list); [[LIST_WITH_FILE_CONTENT]]=list;I tried putting it that way, but I get the error TypeError: _BAS_VARIABLES.LIST_WITH_FILE_CONTENT.filter.split is not a function
Here's how, but I get an error:let list = [[LIST_WITH_FILE_CONTENT]].split('\n'); for(let i = 0, temp = []; i < list.length; i++) { if(temp.includes(list[i].toLowerCase())) { list.splice(i, 1); i--; } else { temp.push(list[i].toLowerCase()); } } console.log(list); [[LIST_WITH_FILE_CONTENT]]=list;