Skip to content

Commit

Permalink
Feature/custom model name for gemini (FlowiseAI#3088)
Browse files Browse the repository at this point in the history
custom model name for gemini
  • Loading branch information
HenryHengZJ authored and Alves, Patrick committed Sep 3, 2024
1 parent 0e2e17b commit 09d8868
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class GoogleGenerativeAI_ChatModels implements INode {
constructor() {
this.label = 'ChatGoogleGenerativeAI'
this.name = 'chatGoogleGenerativeAI'
this.version = 2.0
this.version = 2.1
this.type = 'ChatGoogleGenerativeAI'
this.icon = 'GoogleGemini.svg'
this.category = 'Chat Models'
Expand Down Expand Up @@ -49,6 +49,14 @@ class GoogleGenerativeAI_ChatModels implements INode {
loadMethod: 'listModels',
default: 'gemini-pro'
},
{
label: 'Custom Model Name',
name: 'customModelName',
type: 'string',
placeholder: 'gemini-1.5-pro-exp-0801',
description: 'Custom model name to use. If provided, it will override the model selected',
additionalParams: true
},
{
label: 'Temperature',
name: 'temperature',
Expand Down Expand Up @@ -165,6 +173,7 @@ class GoogleGenerativeAI_ChatModels implements INode {

const temperature = nodeData.inputs?.temperature as string
const modelName = nodeData.inputs?.modelName as string
const customModelName = nodeData.inputs?.customModelName as string
const maxOutputTokens = nodeData.inputs?.maxOutputTokens as string
const topP = nodeData.inputs?.topP as string
const topK = nodeData.inputs?.topK as string
Expand All @@ -177,7 +186,7 @@ class GoogleGenerativeAI_ChatModels implements INode {

const obj: Partial<GoogleGenerativeAIChatInput> = {
apiKey: apiKey,
modelName: modelName,
modelName: customModelName || modelName,
streaming: streaming ?? true
}

Expand Down

0 comments on commit 09d8868

Please sign in to comment.