@isaacjaco49111 said in join a resource with a variable:
@Fox I understand, so for example if I have 20 accounts and I want to obtain resource 18, should I create 18 resources?
Create one resource and put the data of 20 accounts in it
This is probably a noob question but I dont know how to take what I output to via console.log in this code, to a BAS variable I can use later in BAS. Here is the code:
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
});
console.log(completion.choices[0]);
}
main();
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();