From c15250f28be3995ac3147c1a57e5b2811aae4d2e Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Sat, 13 Jan 2024 16:18:35 +0800 Subject: [PATCH 01/12] add TopK and safetySettings --- .../ChatGoogleGenerativeAI.ts | 87 ++++++++++++++++++- packages/components/src/utils.ts | 17 ++++ 2 files changed, 103 insertions(+), 1 deletion(-) diff --git a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts index 546fa224c..311b4e8db 100644 --- a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts +++ b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts @@ -1,7 +1,8 @@ import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface' -import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils' +import { convertStringToArrayString, getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils' import { BaseCache } from 'langchain/schema' import { ChatGoogleGenerativeAI } from '@langchain/google-genai' +import { HarmBlockThreshold, HarmCategory } from '@google/generative-ai' class GoogleGenerativeAI_ChatModels implements INode { label: string @@ -74,6 +75,72 @@ class GoogleGenerativeAI_ChatModels implements INode { step: 0.1, optional: true, additionalParams: true + }, + { + label: 'topK', + name: 'topK', + type: 'number', + step: 0.1, + optional: true, + additionalParams: true + }, + { + label: 'Harm Category', + name: 'harmCategory', + type: 'multiOptions', + description: + 'Refer to official guide on how to use Harm Category', + options: [ + { + label: 'Dangerous', + name: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT + }, + { + label: 'Harassment', + name: HarmCategory.HARM_CATEGORY_HARASSMENT + }, + { + label: 'Hate Speech', + name: HarmCategory.HARM_CATEGORY_HATE_SPEECH + }, + { + label: 'Sexually Explicit', + name: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT + } + ], + optional: true, + additionalParams: true + }, + { + label: 'Harm Block Threshold', + name: 'harmBlockThreshold', + type: 'multiOptions', + description: + 'Refer to official guide on how to use Harm Block Threshold', + options: [ + { + label: 'Low and Above', + name: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + }, + { + label: 'Medium and Above', + name: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE + }, + { + label: 'None', + name: HarmBlockThreshold.BLOCK_NONE + }, + { + label: 'Only High', + name: HarmBlockThreshold.BLOCK_ONLY_HIGH + }, + { + label: 'Threshold Unspecified', + name: HarmBlockThreshold.HARM_BLOCK_THRESHOLD_UNSPECIFIED + } + ], + optional: true, + additionalParams: true } ] } @@ -86,6 +153,9 @@ class GoogleGenerativeAI_ChatModels implements INode { const modelName = nodeData.inputs?.modelName as string const maxOutputTokens = nodeData.inputs?.maxOutputTokens as string const topP = nodeData.inputs?.topP as string + const topK = nodeData.inputs?.topK as string + const harmCategory = nodeData.inputs?.harmCategory as string + const harmBlockThreshold = nodeData.inputs?.harmBlockThreshold as string const cache = nodeData.inputs?.cache as BaseCache const obj = { @@ -98,8 +168,23 @@ class GoogleGenerativeAI_ChatModels implements INode { const model = new ChatGoogleGenerativeAI(obj) if (topP) model.topP = parseFloat(topP) + if (topK) model.topP = parseFloat(topK) if (cache) model.cache = cache if (temperature) model.temperature = parseFloat(temperature) + + // safetySettings + let harmCategories: string[] = convertStringToArrayString(harmCategory) + let harmBlockThresholds: string[] = convertStringToArrayString(harmBlockThreshold) + if (harmCategories.length != harmBlockThresholds.length) + throw new Error(`Harm Category & Harm Block Threshold are not the same length`) + const safetySettings = harmCategories.map((value, index) => { + return { + category: value, + threshold: harmBlockThresholds[index] + } + }) + if (safetySettings) model.safetySettings = safetySettings + return model } } diff --git a/packages/components/src/utils.ts b/packages/components/src/utils.ts index 22fa6f4a9..88c553cfc 100644 --- a/packages/components/src/utils.ts +++ b/packages/components/src/utils.ts @@ -673,3 +673,20 @@ export const convertBaseMessagetoIMessage = (messages: BaseMessage[]): IMessage[ } return formatmessages } + +/** + * Convert String to Array String + * @param {string} inputString + * @returns {string[]} + */ +export const convertStringToArrayString = (inputString: string): string[] => { + let ArrayString: string[] = [] + if (inputString) { + try { + ArrayString = JSON.parse(inputString) + } catch (e) { + ArrayString = [] + } + } + return ArrayString +} From bdc892df2b36917df5586742c6eaa2fb1528e9fd Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Sun, 14 Jan 2024 00:51:28 +0800 Subject: [PATCH 02/12] fix error TS2322: Type '{ category: string; threshold: string; }[]' is not assignable to type 'SafetySetting[] --- .../ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts index 311b4e8db..ddae6780b 100644 --- a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts +++ b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts @@ -177,13 +177,13 @@ class GoogleGenerativeAI_ChatModels implements INode { let harmBlockThresholds: string[] = convertStringToArrayString(harmBlockThreshold) if (harmCategories.length != harmBlockThresholds.length) throw new Error(`Harm Category & Harm Block Threshold are not the same length`) - const safetySettings = harmCategories.map((value, index) => { + const safetySettings: typeof model.safetySettings = harmCategories.map((value, index) => { return { category: value, threshold: harmBlockThresholds[index] } }) - if (safetySettings) model.safetySettings = safetySettings + if (safetySettings.length > 0) model.safetySettings = safetySettings return model } From 203b182cd54154d451369edc26291cc1f2f0b1cf Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Sun, 14 Jan 2024 01:35:39 +0800 Subject: [PATCH 03/12] fix error TS2322 part 2 --- .../ChatGoogleGenerativeAI.ts | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts index ddae6780b..737b0bf27 100644 --- a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts +++ b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts @@ -1,7 +1,7 @@ import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface' import { convertStringToArrayString, getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils' import { BaseCache } from 'langchain/schema' -import { ChatGoogleGenerativeAI } from '@langchain/google-genai' +import { ChatGoogleGenerativeAI, GoogleGenerativeAIChatInput } from '@langchain/google-genai' import { HarmBlockThreshold, HarmCategory } from '@google/generative-ai' class GoogleGenerativeAI_ChatModels implements INode { @@ -158,10 +158,23 @@ class GoogleGenerativeAI_ChatModels implements INode { const harmBlockThreshold = nodeData.inputs?.harmBlockThreshold as string const cache = nodeData.inputs?.cache as BaseCache - const obj = { + // safetySettings + let harmCategories: string[] = convertStringToArrayString(harmCategory) + let harmBlockThresholds: string[] = convertStringToArrayString(harmBlockThreshold) + if (harmCategories.length != harmBlockThresholds.length) + throw new Error(`Harm Category & Harm Block Threshold are not the same length`) + const safetySettings = harmCategories.map((value, index) => { + return { + category: value, + threshold: harmBlockThresholds[index] + } + }) + + const obj: Partial = { apiKey: apiKey, modelName: modelName, - maxOutputTokens: 2048 + maxOutputTokens: 2048, + safetySettings: safetySettings.length > 0 ? safetySettings : undefined } if (maxOutputTokens) obj.maxOutputTokens = parseInt(maxOutputTokens, 10) @@ -172,19 +185,6 @@ class GoogleGenerativeAI_ChatModels implements INode { if (cache) model.cache = cache if (temperature) model.temperature = parseFloat(temperature) - // safetySettings - let harmCategories: string[] = convertStringToArrayString(harmCategory) - let harmBlockThresholds: string[] = convertStringToArrayString(harmBlockThreshold) - if (harmCategories.length != harmBlockThresholds.length) - throw new Error(`Harm Category & Harm Block Threshold are not the same length`) - const safetySettings: typeof model.safetySettings = harmCategories.map((value, index) => { - return { - category: value, - threshold: harmBlockThresholds[index] - } - }) - if (safetySettings.length > 0) model.safetySettings = safetySettings - return model } } From 4d15e886fe156e3d89c728f406aee0fb1cd91253 Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Sun, 14 Jan 2024 03:38:14 +0800 Subject: [PATCH 04/12] fix error TS2322 part 3 --- .../ChatGoogleGenerativeAI.ts | 73 +++++++++++++++---- packages/components/package.json | 1 + packages/components/src/utils.ts | 4 +- 3 files changed, 61 insertions(+), 17 deletions(-) diff --git a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts index 737b0bf27..bd660b474 100644 --- a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts +++ b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts @@ -1,8 +1,9 @@ import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface' -import { convertStringToArrayString, getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils' +import { convertMultiOptionsToStringArray, getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils' import { BaseCache } from 'langchain/schema' import { ChatGoogleGenerativeAI, GoogleGenerativeAIChatInput } from '@langchain/google-genai' import { HarmBlockThreshold, HarmCategory } from '@google/generative-ai' +import type { SafetySetting } from '@google/generative-ai' class GoogleGenerativeAI_ChatModels implements INode { label: string @@ -158,23 +159,10 @@ class GoogleGenerativeAI_ChatModels implements INode { const harmBlockThreshold = nodeData.inputs?.harmBlockThreshold as string const cache = nodeData.inputs?.cache as BaseCache - // safetySettings - let harmCategories: string[] = convertStringToArrayString(harmCategory) - let harmBlockThresholds: string[] = convertStringToArrayString(harmBlockThreshold) - if (harmCategories.length != harmBlockThresholds.length) - throw new Error(`Harm Category & Harm Block Threshold are not the same length`) - const safetySettings = harmCategories.map((value, index) => { - return { - category: value, - threshold: harmBlockThresholds[index] - } - }) - const obj: Partial = { apiKey: apiKey, modelName: modelName, - maxOutputTokens: 2048, - safetySettings: safetySettings.length > 0 ? safetySettings : undefined + maxOutputTokens: 2048 } if (maxOutputTokens) obj.maxOutputTokens = parseInt(maxOutputTokens, 10) @@ -185,8 +173,63 @@ class GoogleGenerativeAI_ChatModels implements INode { if (cache) model.cache = cache if (temperature) model.temperature = parseFloat(temperature) + // Safety Settings + let harmCategories: string[] = convertMultiOptionsToStringArray(harmCategory) + let harmBlockThresholds: string[] = convertMultiOptionsToStringArray(harmBlockThreshold) + if (harmCategories.length != harmBlockThresholds.length) + throw new Error(`Harm Category & Harm Block Threshold are not the same length`) + const safetySettings: SafetySetting[] = harmCategories.map((value, index) => { + return { + category: categoryInput(value), + threshold: thresholdInput(harmBlockThresholds[index]) + } + }) + if (safetySettings.length > 0) model.safetySettings = safetySettings + return model } } +const categoryInput = (categoryInput: string): HarmCategory => { + let categoryOutput: HarmCategory + switch (categoryInput) { + case HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: + categoryOutput = HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT + break + case HarmCategory.HARM_CATEGORY_HATE_SPEECH: + categoryOutput = HarmCategory.HARM_CATEGORY_HATE_SPEECH + break + case HarmCategory.HARM_CATEGORY_HARASSMENT: + categoryOutput = HarmCategory.HARM_CATEGORY_HARASSMENT + break + case HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT: + categoryOutput = HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT + break + default: + categoryOutput = HarmCategory.HARM_CATEGORY_UNSPECIFIED + } + return categoryOutput +} + +const thresholdInput = (thresholdInput: string): HarmBlockThreshold => { + let thresholdOutput: HarmBlockThreshold + switch (thresholdInput) { + case HarmBlockThreshold.BLOCK_LOW_AND_ABOVE: + thresholdOutput = HarmBlockThreshold.BLOCK_LOW_AND_ABOVE + break + case HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE: + thresholdOutput = HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE + break + case HarmBlockThreshold.BLOCK_NONE: + thresholdOutput = HarmBlockThreshold.BLOCK_NONE + break + case HarmBlockThreshold.BLOCK_ONLY_HIGH: + thresholdOutput = HarmBlockThreshold.BLOCK_ONLY_HIGH + break + default: + thresholdOutput = HarmBlockThreshold.HARM_BLOCK_THRESHOLD_UNSPECIFIED + } + return thresholdOutput +} + module.exports = { nodeClass: GoogleGenerativeAI_ChatModels } diff --git a/packages/components/package.json b/packages/components/package.json index a2565430b..55e84074d 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -25,6 +25,7 @@ "@gomomento/sdk": "^1.51.1", "@gomomento/sdk-core": "^1.51.1", "@google-ai/generativelanguage": "^0.2.1", + "@google/generative-ai": "^0.1.3", "@huggingface/inference": "^2.6.1", "@langchain/google-genai": "^0.0.6", "@langchain/mistralai": "^0.0.6", diff --git a/packages/components/src/utils.ts b/packages/components/src/utils.ts index 88c553cfc..2d983562e 100644 --- a/packages/components/src/utils.ts +++ b/packages/components/src/utils.ts @@ -675,11 +675,11 @@ export const convertBaseMessagetoIMessage = (messages: BaseMessage[]): IMessage[ } /** - * Convert String to Array String + * Convert MultiOptions String to String Array * @param {string} inputString * @returns {string[]} */ -export const convertStringToArrayString = (inputString: string): string[] => { +export const convertMultiOptionsToStringArray = (inputString: string): string[] => { let ArrayString: string[] = [] if (inputString) { try { From d7a998f26649c9878bfbc5140f1c65323e6f480a Mon Sep 17 00:00:00 2001 From: automaton82 Date: Mon, 15 Jan 2024 23:27:33 -0500 Subject: [PATCH 05/12] Update package.json Updating turbo to the latest compatible version to fix a bug with github actions not able to build arm64 docker images. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5a9bfcbf3..12fbe20f1 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "pretty-quick": "^3.1.3", "rimraf": "^3.0.2", "run-script-os": "^1.1.6", - "turbo": "1.7.4", + "turbo": "^1.7.4", "typescript": "^4.8.4" }, "engines": { From c77e23b0d15989f78f310145ae8614e53049d887 Mon Sep 17 00:00:00 2001 From: YISH Date: Tue, 16 Jan 2024 15:32:51 +0800 Subject: [PATCH 06/12] Fix CustomFunction receiving excaped inputs --- .../nodes/utilities/CustomFunction/CustomFunction.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/components/nodes/utilities/CustomFunction/CustomFunction.ts b/packages/components/nodes/utilities/CustomFunction/CustomFunction.ts index 37511e476..749c3a862 100644 --- a/packages/components/nodes/utilities/CustomFunction/CustomFunction.ts +++ b/packages/components/nodes/utilities/CustomFunction/CustomFunction.ts @@ -73,7 +73,11 @@ class CustomFunction_Utilities implements INode { if (Object.keys(inputVars).length) { for (const item in inputVars) { - sandbox[`$${item}`] = inputVars[item] + let value = inputVars[item] + if (typeof value === 'string') { + value = handleEscapeCharacters(value, true) + } + sandbox[`$${item}`] = value } } From f3a244a93c497ab5c84baa475a673ea48896a0de Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Tue, 16 Jan 2024 16:19:21 +0800 Subject: [PATCH 07/12] modify google gemini based on request changes --- .../ChatGoogleGenerativeAI.ts | 59 +++---------------- packages/components/src/utils.ts | 9 +-- 2 files changed, 11 insertions(+), 57 deletions(-) diff --git a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts index bd660b474..9a4b8891b 100644 --- a/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts +++ b/packages/components/nodes/chatmodels/ChatGoogleGenerativeAI/ChatGoogleGenerativeAI.ts @@ -78,10 +78,11 @@ class GoogleGenerativeAI_ChatModels implements INode { additionalParams: true }, { - label: 'topK', + label: 'Top Next Highest Probability Tokens', name: 'topK', type: 'number', - step: 0.1, + description: `Decode using top-k sampling: consider the set of top_k most probable tokens. Must be positive`, + step: 1, optional: true, additionalParams: true }, @@ -90,7 +91,7 @@ class GoogleGenerativeAI_ChatModels implements INode { name: 'harmCategory', type: 'multiOptions', description: - 'Refer to official guide on how to use Harm Category', + 'Refer to official guide on how to use Harm Category', options: [ { label: 'Dangerous', @@ -117,7 +118,7 @@ class GoogleGenerativeAI_ChatModels implements INode { name: 'harmBlockThreshold', type: 'multiOptions', description: - 'Refer to official guide on how to use Harm Block Threshold', + 'Refer to official guide on how to use Harm Block Threshold', options: [ { label: 'Low and Above', @@ -169,7 +170,7 @@ class GoogleGenerativeAI_ChatModels implements INode { const model = new ChatGoogleGenerativeAI(obj) if (topP) model.topP = parseFloat(topP) - if (topK) model.topP = parseFloat(topK) + if (topK) model.topK = parseFloat(topK) if (cache) model.cache = cache if (temperature) model.temperature = parseFloat(temperature) @@ -178,10 +179,10 @@ class GoogleGenerativeAI_ChatModels implements INode { let harmBlockThresholds: string[] = convertMultiOptionsToStringArray(harmBlockThreshold) if (harmCategories.length != harmBlockThresholds.length) throw new Error(`Harm Category & Harm Block Threshold are not the same length`) - const safetySettings: SafetySetting[] = harmCategories.map((value, index) => { + const safetySettings: SafetySetting[] = harmCategories.map((harmCategory, index) => { return { - category: categoryInput(value), - threshold: thresholdInput(harmBlockThresholds[index]) + category: harmCategory as HarmCategory, + threshold: harmBlockThresholds[index] as HarmBlockThreshold } }) if (safetySettings.length > 0) model.safetySettings = safetySettings @@ -190,46 +191,4 @@ class GoogleGenerativeAI_ChatModels implements INode { } } -const categoryInput = (categoryInput: string): HarmCategory => { - let categoryOutput: HarmCategory - switch (categoryInput) { - case HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: - categoryOutput = HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT - break - case HarmCategory.HARM_CATEGORY_HATE_SPEECH: - categoryOutput = HarmCategory.HARM_CATEGORY_HATE_SPEECH - break - case HarmCategory.HARM_CATEGORY_HARASSMENT: - categoryOutput = HarmCategory.HARM_CATEGORY_HARASSMENT - break - case HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT: - categoryOutput = HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT - break - default: - categoryOutput = HarmCategory.HARM_CATEGORY_UNSPECIFIED - } - return categoryOutput -} - -const thresholdInput = (thresholdInput: string): HarmBlockThreshold => { - let thresholdOutput: HarmBlockThreshold - switch (thresholdInput) { - case HarmBlockThreshold.BLOCK_LOW_AND_ABOVE: - thresholdOutput = HarmBlockThreshold.BLOCK_LOW_AND_ABOVE - break - case HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE: - thresholdOutput = HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE - break - case HarmBlockThreshold.BLOCK_NONE: - thresholdOutput = HarmBlockThreshold.BLOCK_NONE - break - case HarmBlockThreshold.BLOCK_ONLY_HIGH: - thresholdOutput = HarmBlockThreshold.BLOCK_ONLY_HIGH - break - default: - thresholdOutput = HarmBlockThreshold.HARM_BLOCK_THRESHOLD_UNSPECIFIED - } - return thresholdOutput -} - module.exports = { nodeClass: GoogleGenerativeAI_ChatModels } diff --git a/packages/components/src/utils.ts b/packages/components/src/utils.ts index 2d983562e..eacfa4a0b 100644 --- a/packages/components/src/utils.ts +++ b/packages/components/src/utils.ts @@ -681,12 +681,7 @@ export const convertBaseMessagetoIMessage = (messages: BaseMessage[]): IMessage[ */ export const convertMultiOptionsToStringArray = (inputString: string): string[] => { let ArrayString: string[] = [] - if (inputString) { - try { - ArrayString = JSON.parse(inputString) - } catch (e) { - ArrayString = [] - } - } + if (inputString) ArrayString = JSON.parse(inputString) + return ArrayString } From 2661a42a136b5b546e26f39c53e6a381a5c1bf85 Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Tue, 16 Jan 2024 22:13:43 +0800 Subject: [PATCH 08/12] modify google gemini based on requested changes --- packages/components/src/utils.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/components/src/utils.ts b/packages/components/src/utils.ts index eacfa4a0b..2215eb418 100644 --- a/packages/components/src/utils.ts +++ b/packages/components/src/utils.ts @@ -681,7 +681,10 @@ export const convertBaseMessagetoIMessage = (messages: BaseMessage[]): IMessage[ */ export const convertMultiOptionsToStringArray = (inputString: string): string[] => { let ArrayString: string[] = [] - if (inputString) ArrayString = JSON.parse(inputString) - + try { + ArrayString = JSON.parse(inputString) + } catch (e) { + ArrayString = [] + } return ArrayString } From 0e7df3a5b51d2cc6f30c3faadcb0b711ee863f62 Mon Sep 17 00:00:00 2001 From: Ilango Date: Tue, 16 Jan 2024 20:52:25 +0530 Subject: [PATCH 09/12] Lock upstash redis version which will fix the credentials and deployment issues --- packages/components/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/package.json b/packages/components/package.json index c90ea5ccd..c35419bc1 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -37,7 +37,7 @@ "@supabase/supabase-js": "^2.29.0", "@types/js-yaml": "^4.0.5", "@types/jsdom": "^21.1.1", - "@upstash/redis": "^1.22.1", + "@upstash/redis": "1.22.1", "@zilliz/milvus2-sdk-node": "^2.2.24", "apify-client": "^2.7.1", "axios": "1.6.2", From 019e7caac36dbc85fcdbf17db5b8f5a3664d53bc Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 16 Jan 2024 16:07:28 +0000 Subject: [PATCH 10/12] =?UTF-8?q?=F0=9F=A5=B3=20flowise-components@1.5.1?= =?UTF-8?q?=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/components/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/package.json b/packages/components/package.json index c35419bc1..ddf093998 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "flowise-components", - "version": "1.5.0", + "version": "1.5.1", "description": "Flowiseai Components", "main": "dist/src/index", "types": "dist/src/index.d.ts", From f16b29503d58568f00301abdecdf8d046f70f4f7 Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 16 Jan 2024 16:08:25 +0000 Subject: [PATCH 11/12] =?UTF-8?q?=F0=9F=A5=B3=20flowise-ui@1.4.7=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/package.json b/packages/ui/package.json index c5549b23c..fef08851c 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "flowise-ui", - "version": "1.4.6", + "version": "1.4.7", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://flowiseai.com", "author": { From 8c1e62be425810b0d7cc7725e707a8415a670a4d Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 16 Jan 2024 16:09:13 +0000 Subject: [PATCH 12/12] =?UTF-8?q?=F0=9F=A5=B3=20flowise@1.4.10=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- packages/server/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 12fbe20f1..561694d0e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flowise", - "version": "1.4.9", + "version": "1.4.10", "private": true, "homepage": "https://flowiseai.com", "workspaces": [ diff --git a/packages/server/package.json b/packages/server/package.json index f1c0b7f79..79ff49616 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "flowise", - "version": "1.4.9", + "version": "1.4.10", "description": "Flowiseai Server", "main": "dist/index", "types": "dist/index.d.ts",