Skip to content

Commit a781576

Browse files
authored
Feature/custom model name for gemini (#3088)
custom model name for gemini
1 parent 75f779f commit a781576

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Diff for: packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class GoogleGenerativeAI_ChatModels implements INode {
2121
constructor() {
2222
this.label = 'ChatGoogleGenerativeAI'
2323
this.name = 'chatGoogleGenerativeAI'
24-
this.version = 2.0
24+
this.version = 2.1
2525
this.type = 'ChatGoogleGenerativeAI'
2626
this.icon = 'GoogleGemini.svg'
2727
this.category = 'Chat Models'
@@ -49,6 +49,14 @@ class GoogleGenerativeAI_ChatModels implements INode {
4949
loadMethod: 'listModels',
5050
default: 'gemini-pro'
5151
},
52+
{
53+
label: 'Custom Model Name',
54+
name: 'customModelName',
55+
type: 'string',
56+
placeholder: 'gemini-1.5-pro-exp-0801',
57+
description: 'Custom model name to use. If provided, it will override the model selected',
58+
additionalParams: true
59+
},
5260
{
5361
label: 'Temperature',
5462
name: 'temperature',
@@ -165,6 +173,7 @@ class GoogleGenerativeAI_ChatModels implements INode {
165173

166174
const temperature = nodeData.inputs?.temperature as string
167175
const modelName = nodeData.inputs?.modelName as string
176+
const customModelName = nodeData.inputs?.customModelName as string
168177
const maxOutputTokens = nodeData.inputs?.maxOutputTokens as string
169178
const topP = nodeData.inputs?.topP as string
170179
const topK = nodeData.inputs?.topK as string
@@ -177,7 +186,7 @@ class GoogleGenerativeAI_ChatModels implements INode {
177186

178187
const obj: Partial<GoogleGenerativeAIChatInput> = {
179188
apiKey: apiKey,
180-
modelName: modelName,
189+
modelName: customModelName || modelName,
181190
streaming: streaming ?? true
182191
}
183192

0 commit comments

Comments
 (0)