From e7a58fc700d02f44756476a1b6def2439c64d3e0 Mon Sep 17 00:00:00 2001 From: Henry Heng Date: Thu, 11 Apr 2024 22:54:51 +0100 Subject: [PATCH] Feature/Add topP to Azure (#2160) add topP to Azure --- .../chatmodels/AzureChatOpenAI/AzureChatOpenAI.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/components/nodes/chatmodels/AzureChatOpenAI/AzureChatOpenAI.ts b/packages/components/nodes/chatmodels/AzureChatOpenAI/AzureChatOpenAI.ts index a78a5bd8..77c7643b 100644 --- a/packages/components/nodes/chatmodels/AzureChatOpenAI/AzureChatOpenAI.ts +++ b/packages/components/nodes/chatmodels/AzureChatOpenAI/AzureChatOpenAI.ts @@ -84,6 +84,14 @@ class AzureChatOpenAI_ChatModels implements INode { optional: true, additionalParams: true }, + { + label: 'Top Probability', + name: 'topP', + type: 'number', + step: 0.1, + optional: true, + additionalParams: true + }, { label: 'Frequency Penalty', name: 'frequencyPenalty', @@ -152,6 +160,7 @@ class AzureChatOpenAI_ChatModels implements INode { const timeout = nodeData.inputs?.timeout as string const streaming = nodeData.inputs?.streaming as boolean const cache = nodeData.inputs?.cache as BaseCache + const topP = nodeData.inputs?.topP as string const credentialData = await getCredentialData(nodeData.credential ?? '', options) const azureOpenAIApiKey = getCredentialParam('azureOpenAIApiKey', credentialData, nodeData) @@ -177,6 +186,7 @@ class AzureChatOpenAI_ChatModels implements INode { if (presencePenalty) obj.presencePenalty = parseFloat(presencePenalty) if (timeout) obj.timeout = parseInt(timeout, 10) if (cache) obj.cache = cache + if (topP) obj.topP = parseFloat(topP) const multiModalOption: IMultiModalOption = { image: {