From 04c058a34e7c306141592691fa646ef6480bbc03 Mon Sep 17 00:00:00 2001 From: Ashish Ahuja <54350798+avainfotech2019@users.noreply.github.com> Date: Thu, 2 Feb 2023 17:48:11 +0530 Subject: [PATCH] feat(OpenAI Node): Add frequency-penalty and presence-penalty (#5137) --- .../nodes/OpenAi/TextDescription.ts | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/packages/nodes-base/nodes/OpenAi/TextDescription.ts b/packages/nodes-base/nodes/OpenAi/TextDescription.ts index dc55a5ef65..e79acfe142 100644 --- a/packages/nodes-base/nodes/OpenAi/TextDescription.ts +++ b/packages/nodes-base/nodes/OpenAi/TextDescription.ts @@ -379,6 +379,21 @@ const sharedOperations: INodeProperties[] = [ }, }, }, + { + 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', + }, + }, + }, { displayName: 'Maximum Number of Tokens', name: 'maxTokens', @@ -415,6 +430,21 @@ const sharedOperations: INodeProperties[] = [ }, }, }, + { + 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', + }, + }, + }, { displayName: 'Sampling Temperature', name: 'temperature',