#Open AI nodejs package spitting out random stuff
17 messages · Page 1 of 1 (latest)
hello!
why don´t you complete the completion object?
maybe something as follows...
$curlbody = [
"prompt" => $this->sourceoftruth . $this->prompt . $history_string . $this->message . "\n" . $this->assistantname . ':',
"temperature" => (float) $temperature,
"max_tokens" => (int) $maxlength,
"top_p" => (float) $topp,
"frequency_penalty" => (float) $frequency,
"presence_penalty" => (float) $presence,
"stop" => $this->username . ":"
];
and I think it is better to use one of these engines:
'gpt-3.5-turbo-0301' => 'chat'
'gpt-3.5-turbo' => 'chat'
I hope it helps.
Regards!
I have no idea what that is, is that a different langauge than Node?
I tried selefting gpt-3.5-turbo but it said that “this is a chat completion”
ok ok... try something like this:
const promptText = ${sourceOfTruth}${prompt}${historyString}${message}\n${assistantName}:;
const completion = await openai.createCompletion({
model: 'gpt-3.5-turbo',
prompt: promptText,
temperature: parseFloat(temperature),
max_tokens: parseInt(maxlength, 10),
top_p: parseFloat(topp),
frequency_penalty: parseFloat(frequency),
presence_penalty: parseFloat(presence),
stop: [${username}:]
});
sourceOfTruth is not really needed
but I think you should give more context creating $prompt and $historyString