njerschow/openai-api

Content Filter LogProps is null

jamalavedra opened this issue · 1 comments

After applying the content filter like so:

var content_to_classify = gptResponse.data["choices"][0]["text"];

const gptFilterResponse = await openai.complete({
engine: "content-filter-alpha-c4",
prompt: "<|endoftext|>" + content_to_classify + "\n--\nLabel:",
maxTokens: 1,
temperature: 0,
topP: 1,
presencePenalty: 0,
frequencyPenalty: 0,
});

I get the following output:
{
id: 'cmpl-3NMfxu1YGjNTNeWSeNXnktFboYLoM',
object: 'text_completion',
created: 1626697721,
model: 'toxicity-double-18',
choices: [ { text: '2', index: 0, logprobs: null, finish_reason: 'length' } ]
}

While the output label is fine, I'm not getting the logprobs to evaluate how sure the filter is in "2".

Found the issue.
The request to the content filter must include logprobs:10.