The idea is: Add options for “frequency penalty” and “presence penalty” in openai node
The newly created openai node has options for temperature, topP, best_of etc. but it is missing options for “frequency penalty” and “presence penalty” which is required to create a fine tuned prompt.
The feature request is to add options for “frequency penalty” and “presence penalty” in openai node
I think it would be beneficial to add this because: frequency penalty and presence penalty is required to engineer an optimised prompt for better output out of OpenAI / GPT3
Any resources to support this?
OpenAI Completions API Reference
Are you willing to work on this?
I am not a programmer, but looking at the structure of OpenAI Node I think the following will be the code to be added to textdescription.ts
for frequency penalty
{
displayName: ‘Frequency Penalty’,
name: 'frequency_penalty',
default: 0,
typeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },
description:
'Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.',
type: 'number',
routing: {
send: {
type: 'body',
property: 'frequency_penalty',
},
},
},
for presence penalty
{
displayName: ‘Presence Penalty’,
name: ‘presence_penalty',
default: 0,
typeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },
description:
'Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.',
type: 'number',
routing: {
send: {
type: 'body',
property: 'presence_penalty',
},
},
},