From f475732e6ba1aa5e78d6b352519e86cca5f13a08 Mon Sep 17 00:00:00 2001 From: vinodkiran Date: Fri, 15 Dec 2023 22:20:51 +0530 Subject: [PATCH] Support for Google Gemini Models: Minor fixes --- .../ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts | 6 +++--- .../GoogleGenerativeAIEmbedding.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts index 26913424..95ee0575 100644 --- a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts +++ b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts @@ -18,7 +18,7 @@ class GoogleGenerativeAI_ChatModels implements INode { constructor() { this.label = 'ChatGoogleGenerativeAI' this.name = 'chatGoogleGenerativeAI' - this.version = 2.0 + this.version = 1.0 this.type = 'ChatGoogleGenerativeAI' this.icon = 'gemini.png' this.category = 'Chat Models' @@ -29,7 +29,7 @@ class GoogleGenerativeAI_ChatModels implements INode { name: 'credential', type: 'credential', credentialNames: ['googleGenerativeAI'], - optional: true, + optional: false, description: 'Google Generative AI credential.' } this.inputs = [ @@ -100,7 +100,7 @@ class GoogleGenerativeAI_ChatModels implements INode { const model = new ChatGoogleGenerativeAI(obj) if (topP) model.topP = parseFloat(topP) if (cache) model.cache = cache - if (temperature) model.temperature = parseInt(temperature) + if (temperature) model.temperature = parseFloat(temperature) return model } } diff --git a/packages/components/nodes/embeddings/GoogleGenerativeAIEmbedding/GoogleGenerativeAIEmbedding.ts b/packages/components/nodes/embeddings/GoogleGenerativeAIEmbedding/GoogleGenerativeAIEmbedding.ts index 7682b280..86921b42 100644 --- a/packages/components/nodes/embeddings/GoogleGenerativeAIEmbedding/GoogleGenerativeAIEmbedding.ts +++ b/packages/components/nodes/embeddings/GoogleGenerativeAIEmbedding/GoogleGenerativeAIEmbedding.ts @@ -24,13 +24,13 @@ class GoogleGenerativeAIEmbedding_Embeddings implements INode { this.icon = 'gemini.png' this.category = 'Embeddings' this.description = 'Google Generative API to generate embeddings for a given text' - this.baseClasses = [this.type, ...getBaseClasses(GoogleVertexAIEmbeddings)] + this.baseClasses = [this.type, ...getBaseClasses(GoogleGenerativeAIEmbeddings)] this.credential = { label: 'Connect Credential', name: 'credential', type: 'credential', credentialNames: ['googleGenerativeAI'], - optional: true, + optional: false, description: 'Google Generative AI credential.' } this.inputs = [