From 288e451161fa206265d5830cb583f0b18f13307c Mon Sep 17 00:00:00 2001 From: Kenny Vaneetvelde Date: Sat, 3 Feb 2024 19:43:44 +0100 Subject: [PATCH 01/39] Improve flexibility of the structured output parser by allowing the user to input an example JSON and automatically converting it to a zod scheme --- .../StructuredOutputParser.ts | 48 +++----- packages/components/package.json | 1 + .../chatflows/Structured Output Parser.json | 114 +++++++----------- 3 files changed, 64 insertions(+), 99 deletions(-) diff --git a/packages/components/nodes/outputparsers/StructuredOutputParser/StructuredOutputParser.ts b/packages/components/nodes/outputparsers/StructuredOutputParser/StructuredOutputParser.ts index fc28fd1c..849d825d 100644 --- a/packages/components/nodes/outputparsers/StructuredOutputParser/StructuredOutputParser.ts +++ b/packages/components/nodes/outputparsers/StructuredOutputParser/StructuredOutputParser.ts @@ -1,8 +1,9 @@ -import { convertSchemaToZod, getBaseClasses, INode, INodeData, INodeParams } from '../../../src' +import { getBaseClasses, INode, INodeData, INodeParams } from '../../../src' import { BaseOutputParser } from 'langchain/schema/output_parser' import { StructuredOutputParser as LangchainStructuredOutputParser } from 'langchain/output_parsers' import { CATEGORY } from '../OutputParserHelpers' import { z } from 'zod' +import { jsonToZod } from 'json-to-zod' class StructuredOutputParser implements INode { label: string @@ -34,44 +35,31 @@ class StructuredOutputParser implements INode { description: 'In the event that the first call fails, will make another call to the model to fix any errors.' }, { - label: 'JSON Structure', - name: 'jsonStructure', - type: 'datagrid', - description: 'JSON structure for LLM to return', - datagrid: [ - { field: 'property', headerName: 'Property', editable: true }, - { - field: 'type', - headerName: 'Type', - type: 'singleSelect', - valueOptions: ['string', 'number', 'boolean'], - editable: true - }, - { field: 'description', headerName: 'Description', editable: true, flex: 1 } - ], - default: [ - { - property: 'answer', - type: 'string', - description: `answer to the user's question` - }, - { - property: 'source', - type: 'string', - description: `sources used to answer the question, should be websites` - } - ], + label: 'Example JSON', + name: 'exampleJson', + type: 'string', + description: 'Example JSON structure for LLM to return', + rows: 10, + default: '{"answer": "the answer", "followupQuestions": ["question1", "question2"]}', additionalParams: true } ] } async init(nodeData: INodeData): Promise { - const jsonStructure = nodeData.inputs?.jsonStructure as string + const exampleJson = nodeData.inputs?.exampleJson as string const autoFix = nodeData.inputs?.autofixParser as boolean + const jsonToZodString = jsonToZod(JSON.parse(exampleJson)) + const splitString = jsonToZodString.split('const schema = ') + const schemaString = splitString[1].trim() + + const fnString = `function proxyFn(z){ return ${schemaString} }` + const zodSchemaFunction = new Function('z', `return ${schemaString}`) + const zodSchema = zodSchemaFunction(z) + try { - const structuredOutputParser = LangchainStructuredOutputParser.fromZodSchema(z.object(convertSchemaToZod(jsonStructure))) + const structuredOutputParser = LangchainStructuredOutputParser.fromZodSchema(zodSchema) // NOTE: When we change Flowise to return a json response, the following has to be changed to: JsonStructuredOutputParser Object.defineProperty(structuredOutputParser, 'autoFix', { diff --git a/packages/components/package.json b/packages/components/package.json index bcb746b0..2efb2143 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -56,6 +56,7 @@ "html-to-text": "^9.0.5", "husky": "^8.0.3", "ioredis": "^5.3.2", + "json-to-zod": "1.1.2", "langchain": "^0.0.214", "langfuse": "2.0.2", "langfuse-langchain": "2.3.3", diff --git a/packages/server/marketplaces/chatflows/Structured Output Parser.json b/packages/server/marketplaces/chatflows/Structured Output Parser.json index 92336443..93bb96bb 100644 --- a/packages/server/marketplaces/chatflows/Structured Output Parser.json +++ b/packages/server/marketplaces/chatflows/Structured Output Parser.json @@ -4,7 +4,7 @@ "nodes": [ { "width": 300, - "height": 574, + "height": 576, "id": "chatOpenAI_0", "position": { "x": 845.3961479115309, @@ -17,7 +17,12 @@ "version": 3, "name": "chatOpenAI", "type": "ChatOpenAI", - "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"], + "baseClasses": [ + "ChatOpenAI", + "BaseChatModel", + "BaseLanguageModel", + "Runnable" + ], "category": "Chat Models", "description": "Wrapper around OpenAI large language models that use the Chat endpoint", "inputParams": [ @@ -25,7 +30,9 @@ "label": "Connect Credential", "name": "credential", "type": "credential", - "credentialNames": ["openAIApi"], + "credentialNames": [ + "openAIApi" + ], "id": "chatOpenAI_0-input-credential-credential" }, { @@ -202,7 +209,7 @@ }, { "width": 300, - "height": 456, + "height": 508, "id": "llmChain_0", "position": { "x": 1229.1699649849293, @@ -215,7 +222,11 @@ "version": 3, "name": "llmChain", "type": "LLMChain", - "baseClasses": ["LLMChain", "BaseChain", "Runnable"], + "baseClasses": [ + "LLMChain", + "BaseChain", + "Runnable" + ], "category": "Chains", "description": "Chain to run queries against LLMs", "inputParams": [ @@ -300,7 +311,7 @@ }, { "width": 300, - "height": 652, + "height": 690, "id": "chatPromptTemplate_0", "position": { "x": 501.1597501123828, @@ -313,7 +324,12 @@ "version": 1, "name": "chatPromptTemplate", "type": "ChatPromptTemplate", - "baseClasses": ["ChatPromptTemplate", "BaseChatPromptTemplate", "BasePromptTemplate", "Runnable"], + "baseClasses": [ + "ChatPromptTemplate", + "BaseChatPromptTemplate", + "BasePromptTemplate", + "Runnable" + ], "category": "Prompts", "description": "Schema to represent a chat prompt", "inputParams": [ @@ -369,11 +385,11 @@ }, { "width": 300, - "height": 328, + "height": 329, "id": "structuredOutputParser_0", "position": { - "x": 170.3869571939727, - "y": 343.9298288967859 + "x": 498.2326128526694, + "y": 566.5473204649535 }, "type": "customNode", "data": { @@ -382,7 +398,11 @@ "version": 1, "name": "structuredOutputParser", "type": "StructuredOutputParser", - "baseClasses": ["StructuredOutputParser", "BaseLLMOutputParser", "Runnable"], + "baseClasses": [ + "StructuredOutputParser", + "BaseLLMOutputParser", + "Runnable" + ], "category": "Output Parsers", "description": "Parse the output of an LLM call into a given (JSON) structure.", "inputParams": [ @@ -395,61 +415,20 @@ "id": "structuredOutputParser_0-input-autofixParser-boolean" }, { - "label": "JSON Structure", - "name": "jsonStructure", - "type": "datagrid", - "description": "JSON structure for LLM to return", - "datagrid": [ - { - "field": "property", - "headerName": "Property", - "editable": true - }, - { - "field": "type", - "headerName": "Type", - "type": "singleSelect", - "valueOptions": ["string", "number", "boolean"], - "editable": true - }, - { - "field": "description", - "headerName": "Description", - "editable": true, - "flex": 1 - } - ], - "default": [ - { - "property": "answer", - "type": "string", - "description": "answer to the user's question" - }, - { - "property": "source", - "type": "string", - "description": "sources used to answer the question, should be websites" - } - ], + "label": "Example JSON", + "name": "exampleJson", + "type": "string", + "description": "Example JSON structure for LLM to return", + "rows": 10, + "default": "{\"answer\": \"the answer\", \"followupQuestions\": [\"question1\", \"question2\"]}", "additionalParams": true, - "id": "structuredOutputParser_0-input-jsonStructure-datagrid" + "id": "structuredOutputParser_0-input-exampleJson-string" } ], "inputAnchors": [], "inputs": { "autofixParser": true, - "jsonStructure": [ - { - "property": "answer", - "type": "string", - "description": "answer to the user's question" - }, - { - "property": "source", - "type": "string", - "description": "sources used to answer the question, should be websites" - } - ] + "exampleJson": "{\"answer\": \"the answer\", \"followupQuestions\": [\"question1\", \"question2\"]}" }, "outputAnchors": [ { @@ -463,11 +442,11 @@ "selected": false }, "selected": false, + "dragging": false, "positionAbsolute": { - "x": 170.3869571939727, - "y": 343.9298288967859 - }, - "dragging": false + "x": 498.2326128526694, + "y": 566.5473204649535 + } } ], "edges": [ @@ -499,10 +478,7 @@ "target": "llmChain_0", "targetHandle": "llmChain_0-input-outputParser-BaseLLMOutputParser", "type": "buttonedge", - "id": "structuredOutputParser_0-structuredOutputParser_0-output-structuredOutputParser-StructuredOutputParser|BaseLLMOutputParser|Runnable-llmChain_0-llmChain_0-input-outputParser-BaseLLMOutputParser", - "data": { - "label": "" - } + "id": "structuredOutputParser_0-structuredOutputParser_0-output-structuredOutputParser-StructuredOutputParser|BaseLLMOutputParser|Runnable-llmChain_0-llmChain_0-input-outputParser-BaseLLMOutputParser" } ] -} +} \ No newline at end of file From 95b251f02acfdb6e55f2d9f511732b262e0c0370 Mon Sep 17 00:00:00 2001 From: Kenny Vaneetvelde Date: Sat, 3 Feb 2024 21:22:49 +0100 Subject: [PATCH 02/39] Make it a separate node instead --- .../StructuredOutputParserAdvanced.ts | 80 +++ .../structure.svg | 8 + packages/components/package.json | 1 - .../Advanced Structured Output Parser.json | 463 ++++++++++++++++++ 4 files changed, 551 insertions(+), 1 deletion(-) create mode 100644 packages/components/nodes/outputparsers/StructuredOutputParserAdvanced/StructuredOutputParserAdvanced.ts create mode 100644 packages/components/nodes/outputparsers/StructuredOutputParserAdvanced/structure.svg create mode 100644 packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json diff --git a/packages/components/nodes/outputparsers/StructuredOutputParserAdvanced/StructuredOutputParserAdvanced.ts b/packages/components/nodes/outputparsers/StructuredOutputParserAdvanced/StructuredOutputParserAdvanced.ts new file mode 100644 index 00000000..b0fad136 --- /dev/null +++ b/packages/components/nodes/outputparsers/StructuredOutputParserAdvanced/StructuredOutputParserAdvanced.ts @@ -0,0 +1,80 @@ +import { getBaseClasses, INode, INodeData, INodeParams } from '../../../src' +import { BaseOutputParser } from 'langchain/schema/output_parser' +import { StructuredOutputParser as LangchainStructuredOutputParser } from 'langchain/output_parsers' +import { CATEGORY } from '../OutputParserHelpers' +import { z } from 'zod' + +class AdvancedStructuredOutputParser implements INode { + label: string + name: string + version: number + description: string + type: string + icon: string + category: string + baseClasses: string[] + inputs: INodeParams[] + credential: INodeParams + + constructor() { + this.label = 'Advanced Structured Output Parser' + this.name = 'advancedStructuredOutputParser' + this.version = 1.0 + this.type = 'AdvancedStructuredOutputParser' + this.description = 'Parse the output of an LLM call into a given structure by providing a Zod schema.' + this.icon = 'structure.svg' + this.category = CATEGORY + this.baseClasses = [this.type, ...getBaseClasses(BaseOutputParser)] + this.inputs = [ + { + label: 'Autofix', + name: 'autofixParser', + type: 'boolean', + optional: true, + description: 'In the event that the first call fails, will make another call to the model to fix any errors.' + }, + { + label: 'Example JSON', + name: 'exampleJson', + type: 'string', + description: 'Zod schema for the output of the model', + rows: 10, + default: `z.object({ + title: z.string(), // Title of the movie as a string + yearOfRelease: z.number().int(), // Release year as an integer number, + genres: z.enum([ + "Action", "Comedy", "Drama", "Fantasy", "Horror", + "Mystery", "Romance", "Science Fiction", "Thriller", "Documentary" + ]).array().max(2), // Array of genres, max of 2 from the defined enum + shortDescription: z.string().max(500) // Short description, max 150 characters +})`, + additionalParams: true + } + ] + } + + async init(nodeData: INodeData): Promise { + const schemaString = nodeData.inputs?.exampleJson as string + const autoFix = nodeData.inputs?.autofixParser as boolean + + const zodSchemaFunction = new Function('z', `return ${schemaString}`) + const zodSchema = zodSchemaFunction(z) + + try { + const structuredOutputParser = LangchainStructuredOutputParser.fromZodSchema(zodSchema) + + // NOTE: When we change Flowise to return a json response, the following has to be changed to: JsonStructuredOutputParser + Object.defineProperty(structuredOutputParser, 'autoFix', { + enumerable: true, + configurable: true, + writable: true, + value: autoFix + }) + return structuredOutputParser + } catch (exception) { + throw new Error('Error parsing Zod Schema: ' + exception) + } + } +} + +module.exports = { nodeClass: AdvancedStructuredOutputParser } diff --git a/packages/components/nodes/outputparsers/StructuredOutputParserAdvanced/structure.svg b/packages/components/nodes/outputparsers/StructuredOutputParserAdvanced/structure.svg new file mode 100644 index 00000000..3875982d --- /dev/null +++ b/packages/components/nodes/outputparsers/StructuredOutputParserAdvanced/structure.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/components/package.json b/packages/components/package.json index 2efb2143..bcb746b0 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -56,7 +56,6 @@ "html-to-text": "^9.0.5", "husky": "^8.0.3", "ioredis": "^5.3.2", - "json-to-zod": "1.1.2", "langchain": "^0.0.214", "langfuse": "2.0.2", "langfuse-langchain": "2.3.3", diff --git a/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json b/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json new file mode 100644 index 00000000..41cbb08f --- /dev/null +++ b/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json @@ -0,0 +1,463 @@ +{ + "nodes": [ + { + "width": 300, + "height": 508, + "id": "llmChain_0", + "position": { + "x": 1229.1699649849293, + "y": 245.55173505632646 + }, + "type": "customNode", + "data": { + "id": "llmChain_0", + "label": "LLM Chain", + "version": 3, + "name": "llmChain", + "type": "LLMChain", + "baseClasses": ["LLMChain", "BaseChain", "Runnable"], + "category": "Chains", + "description": "Chain to run queries against LLMs", + "inputParams": [ + { + "label": "Chain Name", + "name": "chainName", + "type": "string", + "placeholder": "Name Your Chain", + "optional": true, + "id": "llmChain_0-input-chainName-string" + } + ], + "inputAnchors": [ + { + "label": "Language Model", + "name": "model", + "type": "BaseLanguageModel", + "id": "llmChain_0-input-model-BaseLanguageModel" + }, + { + "label": "Prompt", + "name": "prompt", + "type": "BasePromptTemplate", + "id": "llmChain_0-input-prompt-BasePromptTemplate" + }, + { + "label": "Output Parser", + "name": "outputParser", + "type": "BaseLLMOutputParser", + "optional": true, + "id": "llmChain_0-input-outputParser-BaseLLMOutputParser" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "llmChain_0-input-inputModeration-Moderation" + } + ], + "inputs": { + "model": "{{chatOpenAI_0.data.instance}}", + "prompt": "{{chatPromptTemplate_0.data.instance}}", + "outputParser": "{{advancedStructuredOutputParser_0.data.instance}}", + "chainName": "", + "inputModeration": "" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "options": [ + { + "id": "llmChain_0-output-llmChain-LLMChain|BaseChain|Runnable", + "name": "llmChain", + "label": "LLM Chain", + "type": "LLMChain | BaseChain | Runnable" + }, + { + "id": "llmChain_0-output-outputPrediction-string|json", + "name": "outputPrediction", + "label": "Output Prediction", + "type": "string | json" + } + ], + "default": "llmChain" + } + ], + "outputs": { + "output": "llmChain" + }, + "selected": false + }, + "positionAbsolute": { + "x": 1229.1699649849293, + "y": 245.55173505632646 + }, + "selected": false + }, + { + "width": 300, + "height": 690, + "id": "chatPromptTemplate_0", + "position": { + "x": 493.26582927222483, + "y": -156.20470841335592 + }, + "type": "customNode", + "data": { + "id": "chatPromptTemplate_0", + "label": "Chat Prompt Template", + "version": 1, + "name": "chatPromptTemplate", + "type": "ChatPromptTemplate", + "baseClasses": ["ChatPromptTemplate", "BaseChatPromptTemplate", "BasePromptTemplate", "Runnable"], + "category": "Prompts", + "description": "Schema to represent a chat prompt", + "inputParams": [ + { + "label": "System Message", + "name": "systemMessagePrompt", + "type": "string", + "rows": 4, + "placeholder": "You are a helpful assistant that translates {input_language} to {output_language}.", + "id": "chatPromptTemplate_0-input-systemMessagePrompt-string" + }, + { + "label": "Human Message", + "name": "humanMessagePrompt", + "type": "string", + "rows": 4, + "placeholder": "{text}", + "id": "chatPromptTemplate_0-input-humanMessagePrompt-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "chatPromptTemplate_0-input-promptValues-json" + } + ], + "inputAnchors": [], + "inputs": { + "systemMessagePrompt": "This AI is designed to only output information in JSON format without exception. This AI can only output JSON and will never output any other text.\n\nWhen asked to correct itself, this AI will only output the corrected JSON and never any other text.", + "humanMessagePrompt": "{text}", + "promptValues": "" + }, + "outputAnchors": [ + { + "id": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable", + "name": "chatPromptTemplate", + "label": "ChatPromptTemplate", + "type": "ChatPromptTemplate | BaseChatPromptTemplate | BasePromptTemplate | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 493.26582927222483, + "y": -156.20470841335592 + }, + "dragging": false + }, + { + "width": 300, + "height": 329, + "id": "advancedStructuredOutputParser_0", + "position": { + "x": 494.20163170226266, + "y": 568.3420937517054 + }, + "type": "customNode", + "data": { + "id": "advancedStructuredOutputParser_0", + "label": "Advanced Structured Output Parser", + "version": 1, + "name": "advancedStructuredOutputParser", + "type": "AdvancedStructuredOutputParser", + "baseClasses": ["AdvancedStructuredOutputParser", "BaseLLMOutputParser", "Runnable"], + "category": "Output Parsers", + "description": "Parse the output of an LLM call into a given structure by providing a Zod schema.", + "inputParams": [ + { + "label": "Autofix", + "name": "autofixParser", + "type": "boolean", + "optional": true, + "description": "In the event that the first call fails, will make another call to the model to fix any errors.", + "id": "advancedStructuredOutputParser_0-input-autofixParser-boolean" + }, + { + "label": "Example JSON", + "name": "exampleJson", + "type": "string", + "description": "Zod schema for the output of the model", + "rows": 10, + "default": "z.object({\n title: z.string(), // Title of the movie as a string\n yearOfRelease: z.number().int(), // Release year as an integer number,\n genres: z.enum([\n \"Action\", \"Comedy\", \"Drama\", \"Fantasy\", \"Horror\",\n \"Mystery\", \"Romance\", \"Science Fiction\", \"Thriller\", \"Documentary\"\n ]).array().max(2), // Array of genres, max of 2 from the defined enum\n shortDescription: z.string().max(500) // Short description, max 150 characters\n})", + "additionalParams": true, + "id": "advancedStructuredOutputParser_0-input-exampleJson-string" + } + ], + "inputAnchors": [], + "inputs": { + "autofixParser": true, + "exampleJson": "z.object({\n title: z.string(), // Title of the movie as a string\n yearOfRelease: z.number().int(), // Release year as an integer number,\n genres: z.enum([\n \"Action\", \"Comedy\", \"Drama\", \"Fantasy\", \"Horror\",\n \"Mystery\", \"Romance\", \"Science Fiction\", \"Thriller\", \"Documentary\"\n ]).array().max(2), // Array of genres, max of 2 from the defined enum\n shortDescription: z.string().max(500) // Short description, max 150 characters\n})" + }, + "outputAnchors": [ + { + "id": "advancedStructuredOutputParser_0-output-advancedStructuredOutputParser-AdvancedStructuredOutputParser|BaseLLMOutputParser|Runnable", + "name": "advancedStructuredOutputParser", + "label": "AdvancedStructuredOutputParser", + "type": "AdvancedStructuredOutputParser | BaseLLMOutputParser | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 494.20163170226266, + "y": 568.3420937517054 + }, + "dragging": false + }, + { + "width": 300, + "height": 576, + "id": "chatOpenAI_0", + "position": { + "x": 860.555928011636, + "y": -355.71028569475095 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_0", + "label": "ChatOpenAI", + "version": 3, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": ["openAIApi"], + "id": "chatOpenAI_0-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "options", + "options": [ + { + "label": "gpt-4", + "name": "gpt-4" + }, + { + "label": "gpt-4-turbo-preview", + "name": "gpt-4-turbo-preview" + }, + { + "label": "gpt-4-0125-preview", + "name": "gpt-4-0125-preview" + }, + { + "label": "gpt-4-1106-preview", + "name": "gpt-4-1106-preview" + }, + { + "label": "gpt-4-vision-preview", + "name": "gpt-4-vision-preview" + }, + { + "label": "gpt-4-0613", + "name": "gpt-4-0613" + }, + { + "label": "gpt-4-32k", + "name": "gpt-4-32k" + }, + { + "label": "gpt-4-32k-0613", + "name": "gpt-4-32k-0613" + }, + { + "label": "gpt-3.5-turbo", + "name": "gpt-3.5-turbo" + }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, + { + "label": "gpt-3.5-turbo-1106", + "name": "gpt-3.5-turbo-1106" + }, + { + "label": "gpt-3.5-turbo-0613", + "name": "gpt-3.5-turbo-0613" + }, + { + "label": "gpt-3.5-turbo-16k", + "name": "gpt-3.5-turbo-16k" + }, + { + "label": "gpt-3.5-turbo-16k-0613", + "name": "gpt-3.5-turbo-16k-0613" + } + ], + "default": "gpt-3.5-turbo", + "optional": true, + "id": "chatOpenAI_0-input-modelName-options" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_0-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-basepath-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-baseOptions-json" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_0-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "", + "temperature": "0", + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "http://localhost:8901/v1", + "baseOptions": "" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 860.555928011636, + "y": -355.71028569475095 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "chatPromptTemplate_0", + "sourceHandle": "chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable", + "target": "llmChain_0", + "targetHandle": "llmChain_0-input-prompt-BasePromptTemplate", + "type": "buttonedge", + "id": "chatPromptTemplate_0-chatPromptTemplate_0-output-chatPromptTemplate-ChatPromptTemplate|BaseChatPromptTemplate|BasePromptTemplate|Runnable-llmChain_0-llmChain_0-input-prompt-BasePromptTemplate", + "data": { + "label": "" + } + }, + { + "source": "advancedStructuredOutputParser_0", + "sourceHandle": "advancedStructuredOutputParser_0-output-advancedStructuredOutputParser-AdvancedStructuredOutputParser|BaseLLMOutputParser|Runnable", + "target": "llmChain_0", + "targetHandle": "llmChain_0-input-outputParser-BaseLLMOutputParser", + "type": "buttonedge", + "id": "advancedStructuredOutputParser_0-advancedStructuredOutputParser_0-output-advancedStructuredOutputParser-AdvancedStructuredOutputParser|BaseLLMOutputParser|Runnable-llmChain_0-llmChain_0-input-outputParser-BaseLLMOutputParser" + }, + { + "source": "chatOpenAI_0", + "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "llmChain_0", + "targetHandle": "llmChain_0-input-model-BaseLanguageModel", + "type": "buttonedge", + "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_0-llmChain_0-input-model-BaseLanguageModel" + } + ] +} From 62f70ab6efe46f6be2d2cddefc2cc12d8d008672 Mon Sep 17 00:00:00 2001 From: Kenny Vaneetvelde Date: Sat, 3 Feb 2024 21:25:26 +0100 Subject: [PATCH 03/39] Revert the changes to the original parser & template --- .../StructuredOutputParser.ts | 48 +++++--- .../chatflows/Structured Output Parser.json | 114 +++++++++++------- 2 files changed, 99 insertions(+), 63 deletions(-) diff --git a/packages/components/nodes/outputparsers/StructuredOutputParser/StructuredOutputParser.ts b/packages/components/nodes/outputparsers/StructuredOutputParser/StructuredOutputParser.ts index 849d825d..fc28fd1c 100644 --- a/packages/components/nodes/outputparsers/StructuredOutputParser/StructuredOutputParser.ts +++ b/packages/components/nodes/outputparsers/StructuredOutputParser/StructuredOutputParser.ts @@ -1,9 +1,8 @@ -import { getBaseClasses, INode, INodeData, INodeParams } from '../../../src' +import { convertSchemaToZod, getBaseClasses, INode, INodeData, INodeParams } from '../../../src' import { BaseOutputParser } from 'langchain/schema/output_parser' import { StructuredOutputParser as LangchainStructuredOutputParser } from 'langchain/output_parsers' import { CATEGORY } from '../OutputParserHelpers' import { z } from 'zod' -import { jsonToZod } from 'json-to-zod' class StructuredOutputParser implements INode { label: string @@ -35,31 +34,44 @@ class StructuredOutputParser implements INode { description: 'In the event that the first call fails, will make another call to the model to fix any errors.' }, { - label: 'Example JSON', - name: 'exampleJson', - type: 'string', - description: 'Example JSON structure for LLM to return', - rows: 10, - default: '{"answer": "the answer", "followupQuestions": ["question1", "question2"]}', + label: 'JSON Structure', + name: 'jsonStructure', + type: 'datagrid', + description: 'JSON structure for LLM to return', + datagrid: [ + { field: 'property', headerName: 'Property', editable: true }, + { + field: 'type', + headerName: 'Type', + type: 'singleSelect', + valueOptions: ['string', 'number', 'boolean'], + editable: true + }, + { field: 'description', headerName: 'Description', editable: true, flex: 1 } + ], + default: [ + { + property: 'answer', + type: 'string', + description: `answer to the user's question` + }, + { + property: 'source', + type: 'string', + description: `sources used to answer the question, should be websites` + } + ], additionalParams: true } ] } async init(nodeData: INodeData): Promise { - const exampleJson = nodeData.inputs?.exampleJson as string + const jsonStructure = nodeData.inputs?.jsonStructure as string const autoFix = nodeData.inputs?.autofixParser as boolean - const jsonToZodString = jsonToZod(JSON.parse(exampleJson)) - const splitString = jsonToZodString.split('const schema = ') - const schemaString = splitString[1].trim() - - const fnString = `function proxyFn(z){ return ${schemaString} }` - const zodSchemaFunction = new Function('z', `return ${schemaString}`) - const zodSchema = zodSchemaFunction(z) - try { - const structuredOutputParser = LangchainStructuredOutputParser.fromZodSchema(zodSchema) + const structuredOutputParser = LangchainStructuredOutputParser.fromZodSchema(z.object(convertSchemaToZod(jsonStructure))) // NOTE: When we change Flowise to return a json response, the following has to be changed to: JsonStructuredOutputParser Object.defineProperty(structuredOutputParser, 'autoFix', { diff --git a/packages/server/marketplaces/chatflows/Structured Output Parser.json b/packages/server/marketplaces/chatflows/Structured Output Parser.json index 93bb96bb..92336443 100644 --- a/packages/server/marketplaces/chatflows/Structured Output Parser.json +++ b/packages/server/marketplaces/chatflows/Structured Output Parser.json @@ -4,7 +4,7 @@ "nodes": [ { "width": 300, - "height": 576, + "height": 574, "id": "chatOpenAI_0", "position": { "x": 845.3961479115309, @@ -17,12 +17,7 @@ "version": 3, "name": "chatOpenAI", "type": "ChatOpenAI", - "baseClasses": [ - "ChatOpenAI", - "BaseChatModel", - "BaseLanguageModel", - "Runnable" - ], + "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel", "Runnable"], "category": "Chat Models", "description": "Wrapper around OpenAI large language models that use the Chat endpoint", "inputParams": [ @@ -30,9 +25,7 @@ "label": "Connect Credential", "name": "credential", "type": "credential", - "credentialNames": [ - "openAIApi" - ], + "credentialNames": ["openAIApi"], "id": "chatOpenAI_0-input-credential-credential" }, { @@ -209,7 +202,7 @@ }, { "width": 300, - "height": 508, + "height": 456, "id": "llmChain_0", "position": { "x": 1229.1699649849293, @@ -222,11 +215,7 @@ "version": 3, "name": "llmChain", "type": "LLMChain", - "baseClasses": [ - "LLMChain", - "BaseChain", - "Runnable" - ], + "baseClasses": ["LLMChain", "BaseChain", "Runnable"], "category": "Chains", "description": "Chain to run queries against LLMs", "inputParams": [ @@ -311,7 +300,7 @@ }, { "width": 300, - "height": 690, + "height": 652, "id": "chatPromptTemplate_0", "position": { "x": 501.1597501123828, @@ -324,12 +313,7 @@ "version": 1, "name": "chatPromptTemplate", "type": "ChatPromptTemplate", - "baseClasses": [ - "ChatPromptTemplate", - "BaseChatPromptTemplate", - "BasePromptTemplate", - "Runnable" - ], + "baseClasses": ["ChatPromptTemplate", "BaseChatPromptTemplate", "BasePromptTemplate", "Runnable"], "category": "Prompts", "description": "Schema to represent a chat prompt", "inputParams": [ @@ -385,11 +369,11 @@ }, { "width": 300, - "height": 329, + "height": 328, "id": "structuredOutputParser_0", "position": { - "x": 498.2326128526694, - "y": 566.5473204649535 + "x": 170.3869571939727, + "y": 343.9298288967859 }, "type": "customNode", "data": { @@ -398,11 +382,7 @@ "version": 1, "name": "structuredOutputParser", "type": "StructuredOutputParser", - "baseClasses": [ - "StructuredOutputParser", - "BaseLLMOutputParser", - "Runnable" - ], + "baseClasses": ["StructuredOutputParser", "BaseLLMOutputParser", "Runnable"], "category": "Output Parsers", "description": "Parse the output of an LLM call into a given (JSON) structure.", "inputParams": [ @@ -415,20 +395,61 @@ "id": "structuredOutputParser_0-input-autofixParser-boolean" }, { - "label": "Example JSON", - "name": "exampleJson", - "type": "string", - "description": "Example JSON structure for LLM to return", - "rows": 10, - "default": "{\"answer\": \"the answer\", \"followupQuestions\": [\"question1\", \"question2\"]}", + "label": "JSON Structure", + "name": "jsonStructure", + "type": "datagrid", + "description": "JSON structure for LLM to return", + "datagrid": [ + { + "field": "property", + "headerName": "Property", + "editable": true + }, + { + "field": "type", + "headerName": "Type", + "type": "singleSelect", + "valueOptions": ["string", "number", "boolean"], + "editable": true + }, + { + "field": "description", + "headerName": "Description", + "editable": true, + "flex": 1 + } + ], + "default": [ + { + "property": "answer", + "type": "string", + "description": "answer to the user's question" + }, + { + "property": "source", + "type": "string", + "description": "sources used to answer the question, should be websites" + } + ], "additionalParams": true, - "id": "structuredOutputParser_0-input-exampleJson-string" + "id": "structuredOutputParser_0-input-jsonStructure-datagrid" } ], "inputAnchors": [], "inputs": { "autofixParser": true, - "exampleJson": "{\"answer\": \"the answer\", \"followupQuestions\": [\"question1\", \"question2\"]}" + "jsonStructure": [ + { + "property": "answer", + "type": "string", + "description": "answer to the user's question" + }, + { + "property": "source", + "type": "string", + "description": "sources used to answer the question, should be websites" + } + ] }, "outputAnchors": [ { @@ -442,11 +463,11 @@ "selected": false }, "selected": false, - "dragging": false, "positionAbsolute": { - "x": 498.2326128526694, - "y": 566.5473204649535 - } + "x": 170.3869571939727, + "y": 343.9298288967859 + }, + "dragging": false } ], "edges": [ @@ -478,7 +499,10 @@ "target": "llmChain_0", "targetHandle": "llmChain_0-input-outputParser-BaseLLMOutputParser", "type": "buttonedge", - "id": "structuredOutputParser_0-structuredOutputParser_0-output-structuredOutputParser-StructuredOutputParser|BaseLLMOutputParser|Runnable-llmChain_0-llmChain_0-input-outputParser-BaseLLMOutputParser" + "id": "structuredOutputParser_0-structuredOutputParser_0-output-structuredOutputParser-StructuredOutputParser|BaseLLMOutputParser|Runnable-llmChain_0-llmChain_0-input-outputParser-BaseLLMOutputParser", + "data": { + "label": "" + } } ] -} \ No newline at end of file +} From 113415e2c91a24b9d8a46d66f4106430c8fc8338 Mon Sep 17 00:00:00 2001 From: Kenny Vaneetvelde Date: Sat, 3 Feb 2024 21:32:00 +0100 Subject: [PATCH 04/39] remove basepath value from template --- .../chatflows/Advanced Structured Output Parser.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json b/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json index 41cbb08f..a48f5b2a 100644 --- a/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json +++ b/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json @@ -1,4 +1,6 @@ { + "description": "Return response as a JSON structure as specified by a Zod schema", + "badge": "NEW", "nodes": [ { "width": 300, @@ -409,7 +411,7 @@ "frequencyPenalty": "", "presencePenalty": "", "timeout": "", - "basepath": "http://localhost:8901/v1", + "basepath": "", "baseOptions": "" }, "outputAnchors": [ From 5da3e3cc3e62efbf9894f4eb46a6e3958d15ab35 Mon Sep 17 00:00:00 2001 From: Darien Kindlund Date: Sun, 4 Feb 2024 12:27:18 -0500 Subject: [PATCH 05/39] Adding proper TLS/SSL support to poolOptions so that the similaritySearchVectorWithScore function actually connects to Postgres via TLS/SSL when specified in the additionalConfig. --- packages/components/nodes/vectorstores/Postgres/Postgres.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/components/nodes/vectorstores/Postgres/Postgres.ts b/packages/components/nodes/vectorstores/Postgres/Postgres.ts index 4e8bae32..375728e8 100644 --- a/packages/components/nodes/vectorstores/Postgres/Postgres.ts +++ b/packages/components/nodes/vectorstores/Postgres/Postgres.ts @@ -253,7 +253,8 @@ const similaritySearchVectorWithScore = async ( port: postgresConnectionOptions.port, user: postgresConnectionOptions.username, password: postgresConnectionOptions.password, - database: postgresConnectionOptions.database + database: postgresConnectionOptions.database, + ssl: postgresConnectionOptions.extra?.ssl } const pool = new Pool(poolOptions) const conn = await pool.connect() From 5543ef3de457c72170e66203db8a09d99a3022e4 Mon Sep 17 00:00:00 2001 From: vinodkiran Date: Sun, 4 Feb 2024 14:29:43 -0500 Subject: [PATCH 06/39] Marketplace: Revamped UI --- packages/server/src/index.ts | 44 ++- packages/ui/craco.config.js | 3 +- packages/ui/src/api/marketplaces.js | 4 +- .../ui-component/table/MarketplaceTable.js | 177 +++++++++ packages/ui/src/views/marketplaces/index.js | 351 +++++++++++++----- 5 files changed, 477 insertions(+), 102 deletions(-) create mode 100644 packages/ui/src/ui-component/table/MarketplaceTable.js diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index dbb5717d..8878da94 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -1223,7 +1223,6 @@ export class App { // Marketplaces // ---------------------------------------- - // Get all chatflows for marketplaces this.app.get('/api/v1/marketplaces/chatflows', async (req: Request, res: Response) => { const marketplaceDir = path.join(__dirname, '..', 'marketplaces', 'chatflows') const jsonsInDir = fs.readdirSync(marketplaceDir).filter((file) => path.extname(file) === '.json') @@ -1250,6 +1249,49 @@ export class App { return res.json(templates) }) + // Get all chatflows for marketplaces + this.app.get('/api/v1/marketplaces/templates', async (req: Request, res: Response) => { + let marketplaceDir = path.join(__dirname, '..', 'marketplaces', 'chatflows') + let jsonsInDir = fs.readdirSync(marketplaceDir).filter((file) => path.extname(file) === '.json') + let templates: any[] = [] + jsonsInDir.forEach((file, index) => { + const filePath = path.join(__dirname, '..', 'marketplaces', 'chatflows', file) + const fileData = fs.readFileSync(filePath) + const fileDataObj = JSON.parse(fileData.toString()) + const template = { + id: index, + templateName: file.split('.json')[0], + flowData: fileData.toString(), + badge: fileDataObj?.badge, + type: 'Chatflow', + description: fileDataObj?.description || '' + } + templates.push(template) + }) + + marketplaceDir = path.join(__dirname, '..', 'marketplaces', 'tools') + jsonsInDir = fs.readdirSync(marketplaceDir).filter((file) => path.extname(file) === '.json') + jsonsInDir.forEach((file, index) => { + const filePath = path.join(__dirname, '..', 'marketplaces', 'tools', file) + const fileData = fs.readFileSync(filePath) + const fileDataObj = JSON.parse(fileData.toString()) + const template = { + ...fileDataObj, + id: index, + type: 'Tool', + templateName: file.split('.json')[0] + } + templates.push(template) + }) + const FlowiseDocsQnA = templates.find((tmp) => tmp.name === 'Flowise Docs QnA') + const FlowiseDocsQnAIndex = templates.findIndex((tmp) => tmp.name === 'Flowise Docs QnA') + if (FlowiseDocsQnA && FlowiseDocsQnAIndex > 0) { + templates.splice(FlowiseDocsQnAIndex, 1) + templates.unshift(FlowiseDocsQnA) + } + return res.json(templates.sort((a, b) => a.templateName.localeCompare(b.templateName))) + }) + // Get all tools for marketplaces this.app.get('/api/v1/marketplaces/tools', async (req: Request, res: Response) => { const marketplaceDir = path.join(__dirname, '..', 'marketplaces', 'tools') diff --git a/packages/ui/craco.config.js b/packages/ui/craco.config.js index 142305e0..093e5ece 100644 --- a/packages/ui/craco.config.js +++ b/packages/ui/craco.config.js @@ -10,7 +10,8 @@ module.exports = { } } ] - } + }, + ignoreWarnings: [/Failed to parse source map/] // Ignore warnings about source maps } } } diff --git a/packages/ui/src/api/marketplaces.js b/packages/ui/src/api/marketplaces.js index 3fd4ae87..bba914a7 100644 --- a/packages/ui/src/api/marketplaces.js +++ b/packages/ui/src/api/marketplaces.js @@ -2,8 +2,10 @@ import client from './client' const getAllChatflowsMarketplaces = () => client.get('/marketplaces/chatflows') const getAllToolsMarketplaces = () => client.get('/marketplaces/tools') +const getAllTemplatesFromMarketplaces = () => client.get('/marketplaces/templates') export default { getAllChatflowsMarketplaces, - getAllToolsMarketplaces + getAllToolsMarketplaces, + getAllTemplatesFromMarketplaces } diff --git a/packages/ui/src/ui-component/table/MarketplaceTable.js b/packages/ui/src/ui-component/table/MarketplaceTable.js new file mode 100644 index 00000000..135d19e9 --- /dev/null +++ b/packages/ui/src/ui-component/table/MarketplaceTable.js @@ -0,0 +1,177 @@ +import PropTypes from 'prop-types' +import { useNavigate } from 'react-router-dom' +import { styled } from '@mui/material/styles' +import Table from '@mui/material/Table' +import TableBody from '@mui/material/TableBody' +import TableCell, { tableCellClasses } from '@mui/material/TableCell' +import TableContainer from '@mui/material/TableContainer' +import TableHead from '@mui/material/TableHead' +import TableRow from '@mui/material/TableRow' +import Paper from '@mui/material/Paper' +import Chip from '@mui/material/Chip' +import { Button, Typography } from '@mui/material' + +const StyledTableCell = styled(TableCell)(({ theme }) => ({ + [`&.${tableCellClasses.head}`]: { + backgroundColor: theme.palette.common.black, + color: theme.palette.common.white + }, + [`&.${tableCellClasses.body}`]: { + fontSize: 14 + } +})) + +const StyledTableRow = styled(TableRow)(({ theme }) => ({ + '&:nth-of-type(odd)': { + backgroundColor: theme.palette.action.hover + }, + // hide last border + '&:last-child td, &:last-child th': { + border: 0 + } +})) + +export const MarketplaceTable = ({ data, images, filterFunction, filterByBadge, filterByType }) => { + const navigate = useNavigate() + const openTemplate = (selectedTemplate) => { + if (selectedTemplate.flowData) { + goToCanvas(selectedTemplate) + } else { + goToTool(selectedTemplate) + } + } + + const goToTool = (selectedTool) => { + const dialogProp = { + title: selectedTool.templateName, + type: 'TEMPLATE', + data: selectedTool + } + setToolDialogProps(dialogProp) + setShowToolDialog(true) + } + + const goToCanvas = (selectedChatflow) => { + navigate(`/marketplace/${selectedChatflow.id}`, { state: selectedChatflow }) + } + + return ( + <> + + + + + + Name + + + Type + + + Description + + + Nodes + + +   + + + + + {data + .filter(filterByBadge) + .filter(filterByType) + .filter(filterFunction) + .map((row, index) => ( + + + + + + + + {row.type} + + + + {row.description || ''} + + + + {row.type === 'Chatflow' && images[row.id] && ( +
+ {images[row.id] + .slice(0, images[row.id].length > 5 ? 5 : images[row.id].length) + .map((img) => ( +
+ +
+ ))} + {images[row.id].length > 5 && ( + + + {images[row.id].length - 5} More + + )} +
+ )} +
+ + + {row.badge && + row.badge + .split(';') + .map((tag, index) => ( + + ))} + + +
+ ))} +
+
+
+ + ) +} + +MarketplaceTable.propTypes = { + data: PropTypes.array, + images: PropTypes.object, + filterFunction: PropTypes.func, + filterByBadge: PropTypes.func, + filterByType: PropTypes.func +} diff --git a/packages/ui/src/views/marketplaces/index.js b/packages/ui/src/views/marketplaces/index.js index 665341c4..ac018663 100644 --- a/packages/ui/src/views/marketplaces/index.js +++ b/packages/ui/src/views/marketplaces/index.js @@ -4,9 +4,25 @@ import { useSelector } from 'react-redux' import PropTypes from 'prop-types' // material-ui -import { Grid, Box, Stack, Tabs, Tab, Badge } from '@mui/material' +import { + Grid, + Box, + Stack, + Badge, + Toolbar, + TextField, + InputAdornment, + ButtonGroup, + ToggleButton, + InputLabel, + FormControl, + Select, + OutlinedInput, + Checkbox, + ListItemText +} from '@mui/material' import { useTheme } from '@mui/material/styles' -import { IconHierarchy, IconTool } from '@tabler/icons' +import { IconLayoutGrid, IconList, IconSearch } from '@tabler/icons' // project imports import MainCard from 'ui-component/cards/MainCard' @@ -23,6 +39,10 @@ import useApi from 'hooks/useApi' // const import { baseURL } from 'store/constant' +import * as React from 'react' +import ToggleButtonGroup from '@mui/material/ToggleButtonGroup' +import { MarketplaceTable } from '../../ui-component/table/MarketplaceTable' +import MenuItem from '@mui/material/MenuItem' function TabPanel(props) { const { children, value, index, ...other } = props @@ -45,6 +65,18 @@ TabPanel.propTypes = { value: PropTypes.number.isRequired } +const ITEM_HEIGHT = 48 +const ITEM_PADDING_TOP = 8 +const badges = ['POPULAR', 'NEW'] +const types = ['Chatflow', 'Tool'] +const MenuProps = { + PaperProps: { + style: { + maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP, + width: 250 + } + } +} // ==============================|| Marketplace ||============================== // const Marketplace = () => { @@ -53,16 +85,62 @@ const Marketplace = () => { const theme = useTheme() const customization = useSelector((state) => state.customization) - const [isChatflowsLoading, setChatflowsLoading] = useState(true) - const [isToolsLoading, setToolsLoading] = useState(true) + const [isLoading, setLoading] = useState(true) const [images, setImages] = useState({}) - const tabItems = ['Chatflows', 'Tools'] - const [value, setValue] = useState(0) + const [showToolDialog, setShowToolDialog] = useState(false) const [toolDialogProps, setToolDialogProps] = useState({}) - const getAllChatflowsMarketplacesApi = useApi(marketplacesApi.getAllChatflowsMarketplaces) - const getAllToolsMarketplacesApi = useApi(marketplacesApi.getAllToolsMarketplaces) + const getAllTemplatesMarketplacesApi = useApi(marketplacesApi.getAllTemplatesFromMarketplaces) + + const [view, setView] = React.useState(localStorage.getItem('mpDisplayStyle') || 'card') + const [search, setSearch] = useState('') + + const [badgeFilter, setBadgeFilter] = useState([]) + const [typeFilter, setTypeFilter] = useState([]) + + const handleBadgeFilterChange = (event) => { + const { + target: { value } + } = event + setBadgeFilter( + // On autofill we get a stringified value. + typeof value === 'string' ? value.split(',') : value + ) + } + const handleTypeFilterChange = (event) => { + const { + target: { value } + } = event + setTypeFilter( + // On autofill we get a stringified value. + typeof value === 'string' ? value.split(',') : value + ) + } + + const handleViewChange = (event, nextView) => { + localStorage.setItem('mpDisplayStyle', nextView) + setView(nextView) + } + + const onSearchChange = (event) => { + setSearch(event.target.value) + } + + function filterFlows(data) { + return ( + data.templateName.toLowerCase().indexOf(search.toLowerCase()) > -1 || + (data.description && data.description.toLowerCase().indexOf(search.toLowerCase()) > -1) + ) + } + + function filterByBadge(data) { + return badgeFilter.length > 0 ? badgeFilter.includes(data.badge) : true + } + + function filterByType(data) { + return typeFilter.length > 0 ? typeFilter.includes(data.type) : true + } const onUseTemplate = (selectedTool) => { const dialogProp = { @@ -90,39 +168,33 @@ const Marketplace = () => { navigate(`/marketplace/${selectedChatflow.id}`, { state: selectedChatflow }) } - const handleChange = (event, newValue) => { - setValue(newValue) - } - useEffect(() => { - getAllChatflowsMarketplacesApi.request() - getAllToolsMarketplacesApi.request() + getAllTemplatesMarketplacesApi.request() // eslint-disable-next-line react-hooks/exhaustive-deps }, []) useEffect(() => { - setChatflowsLoading(getAllChatflowsMarketplacesApi.loading) - }, [getAllChatflowsMarketplacesApi.loading]) + setLoading(getAllTemplatesMarketplacesApi.loading) + }, [getAllTemplatesMarketplacesApi.loading]) useEffect(() => { - setToolsLoading(getAllToolsMarketplacesApi.loading) - }, [getAllToolsMarketplacesApi.loading]) - - useEffect(() => { - if (getAllChatflowsMarketplacesApi.data) { + if (getAllTemplatesMarketplacesApi.data) { try { - const chatflows = getAllChatflowsMarketplacesApi.data + const flows = getAllTemplatesMarketplacesApi.data + const images = {} - for (let i = 0; i < chatflows.length; i += 1) { - const flowDataStr = chatflows[i].flowData - const flowData = JSON.parse(flowDataStr) - const nodes = flowData.nodes || [] - images[chatflows[i].id] = [] - for (let j = 0; j < nodes.length; j += 1) { - const imageSrc = `${baseURL}/api/v1/node-icon/${nodes[j].data.name}` - if (!images[chatflows[i].id].includes(imageSrc)) { - images[chatflows[i].id].push(imageSrc) + for (let i = 0; i < flows.length; i += 1) { + if (flows[i].flowData) { + const flowDataStr = flows[i].flowData + const flowData = JSON.parse(flowDataStr) + const nodes = flowData.nodes || [] + images[flows[i].id] = [] + for (let j = 0; j < nodes.length; j += 1) { + const imageSrc = `${baseURL}/api/v1/node-icon/${nodes[j].data.name}` + if (!images[flows[i].id].includes(imageSrc)) { + images[flows[i].id].push(imageSrc) + } } } } @@ -131,80 +203,161 @@ const Marketplace = () => { console.error(e) } } - }, [getAllChatflowsMarketplacesApi.data]) + }, [getAllTemplatesMarketplacesApi.data]) return ( <> - -

Marketplace

-
- - {tabItems.map((item, index) => ( - : } - iconPosition='start' - label={{item}} + + +

Marketplace

+ + + + ) + }} /> - ))} -
- {tabItems.map((item, index) => ( - - {item === 'Chatflows' && ( - - {!isChatflowsLoading && - getAllChatflowsMarketplacesApi.data && - getAllChatflowsMarketplacesApi.data.map((data, index) => ( - - {data.badge && ( - + + + Type + + + + + + Tag + + + + + + + + + + + + + + + + + + + {!isLoading && (!view || view === 'card') && getAllTemplatesMarketplacesApi.data && ( + <> + + {getAllTemplatesMarketplacesApi.data + .filter(filterByBadge) + .filter(filterByType) + .filter(filterFlows) + .map((data, index) => ( + + {data.badge && ( + + {data.type === 'Chatflow' && ( goToCanvas(data)} data={data} images={images[data.id]} /> - - )} - {!data.badge && ( - goToCanvas(data)} data={data} images={images[data.id]} /> - )} - - ))} - - )} - {item === 'Tools' && ( - - {!isToolsLoading && - getAllToolsMarketplacesApi.data && - getAllToolsMarketplacesApi.data.map((data, index) => ( - - {data.badge && ( - - goToTool(data)} /> - - )} - {!data.badge && goToTool(data)} />} - - ))} - - )} - - ))} - {((!isChatflowsLoading && (!getAllChatflowsMarketplacesApi.data || getAllChatflowsMarketplacesApi.data.length === 0)) || - (!isToolsLoading && (!getAllToolsMarketplacesApi.data || getAllToolsMarketplacesApi.data.length === 0))) && ( + )} + {data.type === 'Tool' && goToTool(data)} />} + + )} + {!data.badge && data.type === 'Chatflow' && ( + goToCanvas(data)} data={data} images={images[data.id]} /> + )} + {!data.badge && data.type === 'Tool' && goToTool(data)} />} + + ))} + + + )} + {!isLoading && view === 'list' && getAllTemplatesMarketplacesApi.data && ( + + )} + + {!isLoading && (!getAllTemplatesMarketplacesApi.data || getAllTemplatesMarketplacesApi.data.length === 0) && ( Date: Sun, 4 Feb 2024 15:49:34 -0500 Subject: [PATCH 07/39] Marketplace: removing unused server API --- packages/server/src/index.ts | 47 +----------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index 8878da94..e69e15ba 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -1223,33 +1223,7 @@ export class App { // Marketplaces // ---------------------------------------- - this.app.get('/api/v1/marketplaces/chatflows', async (req: Request, res: Response) => { - const marketplaceDir = path.join(__dirname, '..', 'marketplaces', 'chatflows') - const jsonsInDir = fs.readdirSync(marketplaceDir).filter((file) => path.extname(file) === '.json') - const templates: any[] = [] - jsonsInDir.forEach((file, index) => { - const filePath = path.join(__dirname, '..', 'marketplaces', 'chatflows', file) - const fileData = fs.readFileSync(filePath) - const fileDataObj = JSON.parse(fileData.toString()) - const template = { - id: index, - name: file.split('.json')[0], - flowData: fileData.toString(), - badge: fileDataObj?.badge, - description: fileDataObj?.description || '' - } - templates.push(template) - }) - const FlowiseDocsQnA = templates.find((tmp) => tmp.name === 'Flowise Docs QnA') - const FlowiseDocsQnAIndex = templates.findIndex((tmp) => tmp.name === 'Flowise Docs QnA') - if (FlowiseDocsQnA && FlowiseDocsQnAIndex > 0) { - templates.splice(FlowiseDocsQnAIndex, 1) - templates.unshift(FlowiseDocsQnA) - } - return res.json(templates) - }) - - // Get all chatflows for marketplaces + // Get all templates for marketplaces this.app.get('/api/v1/marketplaces/templates', async (req: Request, res: Response) => { let marketplaceDir = path.join(__dirname, '..', 'marketplaces', 'chatflows') let jsonsInDir = fs.readdirSync(marketplaceDir).filter((file) => path.extname(file) === '.json') @@ -1292,25 +1266,6 @@ export class App { return res.json(templates.sort((a, b) => a.templateName.localeCompare(b.templateName))) }) - // Get all tools for marketplaces - this.app.get('/api/v1/marketplaces/tools', async (req: Request, res: Response) => { - const marketplaceDir = path.join(__dirname, '..', 'marketplaces', 'tools') - const jsonsInDir = fs.readdirSync(marketplaceDir).filter((file) => path.extname(file) === '.json') - const templates: any[] = [] - jsonsInDir.forEach((file, index) => { - const filePath = path.join(__dirname, '..', 'marketplaces', 'tools', file) - const fileData = fs.readFileSync(filePath) - const fileDataObj = JSON.parse(fileData.toString()) - const template = { - ...fileDataObj, - id: index, - templateName: file.split('.json')[0] - } - templates.push(template) - }) - return res.json(templates) - }) - // ---------------------------------------- // Variables // ---------------------------------------- From 8990b78e104d20d511335844046b9fc81e7d8c94 Mon Sep 17 00:00:00 2001 From: vinodkiran Date: Mon, 5 Feb 2024 15:09:44 -0500 Subject: [PATCH 08/39] Marketplace : Added categories to chatflows --- .../chatflows/API Agent OpenAI.json | 1 + .../marketplaces/chatflows/API Agent.json | 1 + .../marketplaces/chatflows/Antonym.json | 1 + .../marketplaces/chatflows/AutoGPT.json | 1 + .../marketplaces/chatflows/BabyAGI.json | 1 + .../marketplaces/chatflows/CSV Agent.json | 1 + .../chatflows/Chat with a Podcast.json | 1 + .../marketplaces/chatflows/ChatGPTPlugin.json | 1 + .../marketplaces/chatflows/Claude LLM.json | 1 + .../chatflows/Context Chat Engine.json | 1 + .../chatflows/Conversational Agent.json | 1 + .../Conversational Retrieval Agent.json | 1 + .../Conversational Retrieval QA Chain.json | 1 + .../chatflows/Flowise Docs QnA.json | 1 + .../chatflows/HuggingFace LLM Chain.json | 1 + .../server/marketplaces/chatflows/IfElse.json | 1 + .../chatflows/Image Generation.json | 1 + .../chatflows/Input Moderation.json | 1 + .../chatflows/List Output Parser.json | 1 + .../marketplaces/chatflows/Local QnA.json | 1 + .../chatflows/Long Term Memory.json | 1 + .../chatflows/Metadata Filter.json | 1 + .../chatflows/Multi Prompt Chain.json | 1 + .../chatflows/Multi Retrieval QA Chain.json | 1 + .../chatflows/Multiple VectorDB.json | 1 + .../marketplaces/chatflows/OpenAI Agent.json | 1 + .../chatflows/OpenAI Assistant.json | 1 + .../Prompt Chaining with VectorStore.json | 1 + .../chatflows/Prompt Chaining.json | 1 + .../marketplaces/chatflows/Query Engine.json | 1 + .../marketplaces/chatflows/ReAct Agent.json | 1 + .../marketplaces/chatflows/Replicate LLM.json | 1 + .../marketplaces/chatflows/SQL DB Chain.json | 1 + .../marketplaces/chatflows/SQL Prompt.json | 1 + .../chatflows/Simple Chat Engine.json | 1 + .../chatflows/Simple Conversation Chain.json | 1 + .../chatflows/Simple LLM Chain.json | 1 + .../chatflows/Structured Output Parser.json | 1 + .../chatflows/SubQuestion Query Engine.json | 1 + .../marketplaces/chatflows/Translator.json | 1 + .../chatflows/Vectara RAG Chain.json | 2 + .../marketplaces/chatflows/WebBrowser.json | 1 + .../marketplaces/chatflows/WebPage QnA.json | 1 + packages/server/src/index.ts | 2 + .../ui-component/table/MarketplaceTable.js | 58 +++++++------------ packages/ui/src/views/marketplaces/index.js | 1 + 46 files changed, 67 insertions(+), 38 deletions(-) diff --git a/packages/server/marketplaces/chatflows/API Agent OpenAI.json b/packages/server/marketplaces/chatflows/API Agent OpenAI.json index 87f6d6d2..c0497a29 100644 --- a/packages/server/marketplaces/chatflows/API Agent OpenAI.json +++ b/packages/server/marketplaces/chatflows/API Agent OpenAI.json @@ -1,5 +1,6 @@ { "description": "Use OpenAI Function Agent and Chain to automatically decide which API to call, generating url and body request from conversation", + "categories": "Buffer Memory,ChainTool,API Chain,ChatOpenAI,OpenAI Function Agent,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/API Agent.json b/packages/server/marketplaces/chatflows/API Agent.json index af99be9d..32469df9 100644 --- a/packages/server/marketplaces/chatflows/API Agent.json +++ b/packages/server/marketplaces/chatflows/API Agent.json @@ -1,5 +1,6 @@ { "description": "Given API docs, agent automatically decide which API to call, generating url and body request from conversation", + "categories": "Buffer Memory,ChainTool,API Chain,ChatOpenAI,Conversational Agent,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Antonym.json b/packages/server/marketplaces/chatflows/Antonym.json index ef997feb..1240bf30 100644 --- a/packages/server/marketplaces/chatflows/Antonym.json +++ b/packages/server/marketplaces/chatflows/Antonym.json @@ -1,5 +1,6 @@ { "description": "Output antonym of given user input using few-shot prompt template built with examples", + "categories": "Few Shot Prompt,ChatOpenAI,LLM Chain,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/AutoGPT.json b/packages/server/marketplaces/chatflows/AutoGPT.json index 4edbf823..e03a7408 100644 --- a/packages/server/marketplaces/chatflows/AutoGPT.json +++ b/packages/server/marketplaces/chatflows/AutoGPT.json @@ -1,5 +1,6 @@ { "description": "Use AutoGPT - Autonomous agent with chain of thoughts for self-guided task completion", + "categories": "AutoGPT,SERP Tool,File Read/Write,ChatOpenAI,Pinecone,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/BabyAGI.json b/packages/server/marketplaces/chatflows/BabyAGI.json index 3137d511..52198b90 100644 --- a/packages/server/marketplaces/chatflows/BabyAGI.json +++ b/packages/server/marketplaces/chatflows/BabyAGI.json @@ -1,5 +1,6 @@ { "description": "Use BabyAGI to create tasks and reprioritize for a given objective", + "categories": "BabyAGI,ChatOpenAI,Pinecone,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/CSV Agent.json b/packages/server/marketplaces/chatflows/CSV Agent.json index e16377d2..d23e93ad 100644 --- a/packages/server/marketplaces/chatflows/CSV Agent.json +++ b/packages/server/marketplaces/chatflows/CSV Agent.json @@ -1,5 +1,6 @@ { "description": "Analyse and summarize CSV data", + "categories": "CSV Agent,ChatOpenAI,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Chat with a Podcast.json b/packages/server/marketplaces/chatflows/Chat with a Podcast.json index f8d8d26c..c1f216e6 100644 --- a/packages/server/marketplaces/chatflows/Chat with a Podcast.json +++ b/packages/server/marketplaces/chatflows/Chat with a Podcast.json @@ -1,5 +1,6 @@ { "description": "Engage with data sources such as YouTube Transcripts, Google, and more through intelligent Q&A interactions", + "categories": "Memory Vector Store,SearchAPI,ChatOpenAI,Conversational Retrieval QA Chain,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/ChatGPTPlugin.json b/packages/server/marketplaces/chatflows/ChatGPTPlugin.json index 12bea993..d9390f57 100644 --- a/packages/server/marketplaces/chatflows/ChatGPTPlugin.json +++ b/packages/server/marketplaces/chatflows/ChatGPTPlugin.json @@ -1,5 +1,6 @@ { "description": "Use ChatGPT Plugins within LangChain abstractions with GET and POST Tools", + "categories": "ChatGPT Plugin,HTTP GET/POST,ChatOpenAI,MRKL Agent,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Claude LLM.json b/packages/server/marketplaces/chatflows/Claude LLM.json index 7b32de48..39d1e6c6 100644 --- a/packages/server/marketplaces/chatflows/Claude LLM.json +++ b/packages/server/marketplaces/chatflows/Claude LLM.json @@ -1,5 +1,6 @@ { "description": "Use Anthropic Claude with 200k context window to ingest whole document for QnA", + "categories": "Buffer Memory,Prompt Template,Conversation Chain,ChatAnthropic,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Context Chat Engine.json b/packages/server/marketplaces/chatflows/Context Chat Engine.json index 475c6b3a..26efcb1c 100644 --- a/packages/server/marketplaces/chatflows/Context Chat Engine.json +++ b/packages/server/marketplaces/chatflows/Context Chat Engine.json @@ -1,5 +1,6 @@ { "description": "Answer question based on retrieved documents (context) with built-in memory to remember conversation using LlamaIndex", + "categories": "Text File,Prompt Template,ChatOpenAI,Conversation Chain,Pinecone,LlamaIndex,Redis", "badge": "NEW", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Conversational Agent.json b/packages/server/marketplaces/chatflows/Conversational Agent.json index 031a29c0..419e9a79 100644 --- a/packages/server/marketplaces/chatflows/Conversational Agent.json +++ b/packages/server/marketplaces/chatflows/Conversational Agent.json @@ -1,5 +1,6 @@ { "description": "A conversational agent for a chat model which utilize chat specific prompts", + "categories": "Calculator Tool,Buffer Memory,SerpAPI,ChatOpenAI,Conversational Agent,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json b/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json index 40c689f5..37dd3759 100644 --- a/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json +++ b/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json @@ -1,5 +1,6 @@ { "description": "Agent optimized for vector retrieval during conversation and answering questions based on previous dialogue.", + "categories": "Retriever Tool,Buffer Memory,ChatOpenAI,Conversational Retrieval Agent, Pinecone,Langchain", "badge": "POPULAR", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json b/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json index e73a9d28..61bc6e39 100644 --- a/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json +++ b/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json @@ -1,5 +1,6 @@ { "description": "Text file QnA using conversational retrieval QA chain", + "categories": "TextFile,ChatOpenAI,Conversational Retrieval QA Chain,Pinecone,Langchain", "badge": "POPULAR", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Flowise Docs QnA.json b/packages/server/marketplaces/chatflows/Flowise Docs QnA.json index 6975fc68..6eca2944 100644 --- a/packages/server/marketplaces/chatflows/Flowise Docs QnA.json +++ b/packages/server/marketplaces/chatflows/Flowise Docs QnA.json @@ -1,5 +1,6 @@ { "description": "Flowise Docs Github QnA using conversational retrieval QA chain", + "categories": "Memory Vector Store,Github Loader,ChatOpenAI,Conversational Retrieval QA Chain,Langchain", "badge": "POPULAR", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/HuggingFace LLM Chain.json b/packages/server/marketplaces/chatflows/HuggingFace LLM Chain.json index 93009574..f87bf65a 100644 --- a/packages/server/marketplaces/chatflows/HuggingFace LLM Chain.json +++ b/packages/server/marketplaces/chatflows/HuggingFace LLM Chain.json @@ -1,5 +1,6 @@ { "description": "Simple LLM Chain using HuggingFace Inference API on falcon-7b-instruct model", + "categories": "HuggingFace,LLM Chain,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/IfElse.json b/packages/server/marketplaces/chatflows/IfElse.json index f3fddebf..c856eac0 100644 --- a/packages/server/marketplaces/chatflows/IfElse.json +++ b/packages/server/marketplaces/chatflows/IfElse.json @@ -1,5 +1,6 @@ { "description": "Split flows based on if else condition", + "categories": "IfElse Function,ChatOpenAI,OpenAI,LLM Chain,Langchain", "badge": "new", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Image Generation.json b/packages/server/marketplaces/chatflows/Image Generation.json index 7dafcedf..8b07ae86 100644 --- a/packages/server/marketplaces/chatflows/Image Generation.json +++ b/packages/server/marketplaces/chatflows/Image Generation.json @@ -1,6 +1,7 @@ { "description": "Generate image using Replicate Stability text-to-image generative AI model", "badge": "NEW", + "categories": "Replicate,ChatOpenAI,LLM Chain,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Input Moderation.json b/packages/server/marketplaces/chatflows/Input Moderation.json index ed823a21..cd7f2cb5 100644 --- a/packages/server/marketplaces/chatflows/Input Moderation.json +++ b/packages/server/marketplaces/chatflows/Input Moderation.json @@ -1,6 +1,7 @@ { "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", "badge": "NEW", + "categories": "Moderation,ChatOpenAI,LLM Chain,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/List Output Parser.json b/packages/server/marketplaces/chatflows/List Output Parser.json index eaf56dff..a67fb72b 100644 --- a/packages/server/marketplaces/chatflows/List Output Parser.json +++ b/packages/server/marketplaces/chatflows/List Output Parser.json @@ -1,6 +1,7 @@ { "description": "Return response as a list (array) instead of a string/text", "badge": "NEW", + "categories": "CSV Output Parser,ChatOpenAI,LLM Chain,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Local QnA.json b/packages/server/marketplaces/chatflows/Local QnA.json index 6f78cb05..11deae15 100644 --- a/packages/server/marketplaces/chatflows/Local QnA.json +++ b/packages/server/marketplaces/chatflows/Local QnA.json @@ -1,6 +1,7 @@ { "description": "QnA chain using Ollama local LLM, LocalAI embedding model, and Faiss local vector store", "badge": "POPULAR", + "categories": "Text File,ChatOllama,Conversational Retrieval QA Chain,Faiss,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Long Term Memory.json b/packages/server/marketplaces/chatflows/Long Term Memory.json index 1b3e48e1..ba2d2330 100644 --- a/packages/server/marketplaces/chatflows/Long Term Memory.json +++ b/packages/server/marketplaces/chatflows/Long Term Memory.json @@ -1,5 +1,6 @@ { "description": "Use long term memory like Zep to differentiate conversations between users with sessionId", + "categories": "ChatOpenAI,Conversational Retrieval QA Chain,Zep Memory,Qdrant,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Metadata Filter.json b/packages/server/marketplaces/chatflows/Metadata Filter.json index ef928854..13ca8745 100644 --- a/packages/server/marketplaces/chatflows/Metadata Filter.json +++ b/packages/server/marketplaces/chatflows/Metadata Filter.json @@ -1,5 +1,6 @@ { "description": "Upsert multiple files with metadata and filter by it using conversational retrieval QA chain", + "categories": "Text File,PDF File,ChatOpenAI,Conversational Retrieval QA Chain,Pinecone,Langchain", "badge": "POPULAR", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Multi Prompt Chain.json b/packages/server/marketplaces/chatflows/Multi Prompt Chain.json index 314e24a6..89935fcd 100644 --- a/packages/server/marketplaces/chatflows/Multi Prompt Chain.json +++ b/packages/server/marketplaces/chatflows/Multi Prompt Chain.json @@ -1,5 +1,6 @@ { "description": "A chain that automatically picks an appropriate prompt from multiple prompts", + "categories": "ChatOpenAI,Multi Prompt Chain,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json b/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json index 8c9e8537..63a02edb 100644 --- a/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json +++ b/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json @@ -1,5 +1,6 @@ { "description": "A chain that automatically picks an appropriate retriever from multiple different vector databases", + "categories": "ChatOpenAI,Multi Retrieval QA Chain,Pinecone,Chroma,Supabase,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Multiple VectorDB.json b/packages/server/marketplaces/chatflows/Multiple VectorDB.json index e5a16caa..7ffc040a 100644 --- a/packages/server/marketplaces/chatflows/Multiple VectorDB.json +++ b/packages/server/marketplaces/chatflows/Multiple VectorDB.json @@ -1,5 +1,6 @@ { "description": "Use the agent to choose between multiple different vector databases, with the ability to use other tools", + "categories": "Buffer Memory,ChatOpenAI,Chain Tool,Retrieval QA Chain,Redis,Faiss,Conversational Agent,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/OpenAI Agent.json b/packages/server/marketplaces/chatflows/OpenAI Agent.json index e3e80dcc..c4cf11f2 100644 --- a/packages/server/marketplaces/chatflows/OpenAI Agent.json +++ b/packages/server/marketplaces/chatflows/OpenAI Agent.json @@ -1,5 +1,6 @@ { "description": "An agent that uses OpenAI's Function Calling functionality to pick the tool and args to call", + "categories": "Buffer Memory,Custom Tool, SerpAPI,OpenAI Function,Calculator Tool,ChatOpenAI,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/OpenAI Assistant.json b/packages/server/marketplaces/chatflows/OpenAI Assistant.json index e9311c97..f1595fd6 100644 --- a/packages/server/marketplaces/chatflows/OpenAI Assistant.json +++ b/packages/server/marketplaces/chatflows/OpenAI Assistant.json @@ -1,5 +1,6 @@ { "description": "OpenAI Assistant that has instructions and can leverage models, tools, and knowledge to respond to user queries", + "categories": "Custom Tool, SerpAPI,OpenAI Assistant,Calculator Tool,Langchain", "badge": "NEW", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json b/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json index c2060e79..3b8507b9 100644 --- a/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json +++ b/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json @@ -1,5 +1,6 @@ { "description": "Use chat history to rephrase user question, and answer the rephrased question using retrieved docs from vector store", + "categories": "ChatOpenAI,LLM Chain,SingleStore,Langchain", "badge": "POPULAR", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Prompt Chaining.json b/packages/server/marketplaces/chatflows/Prompt Chaining.json index 267d8222..3ed5f95c 100644 --- a/packages/server/marketplaces/chatflows/Prompt Chaining.json +++ b/packages/server/marketplaces/chatflows/Prompt Chaining.json @@ -1,5 +1,6 @@ { "description": "Use output from a chain as prompt for another chain", + "categories": "Custom Tool,OpenAI,LLM Chain,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Query Engine.json b/packages/server/marketplaces/chatflows/Query Engine.json index 82553333..5697735b 100644 --- a/packages/server/marketplaces/chatflows/Query Engine.json +++ b/packages/server/marketplaces/chatflows/Query Engine.json @@ -1,5 +1,6 @@ { "description": "Stateless query engine designed to answer question over your data using LlamaIndex", + "categories": "ChatAnthropic,Compact and Refine,Pinecone,LlamaIndex", "badge": "NEW", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/ReAct Agent.json b/packages/server/marketplaces/chatflows/ReAct Agent.json index e4a7fab8..9831bcf6 100644 --- a/packages/server/marketplaces/chatflows/ReAct Agent.json +++ b/packages/server/marketplaces/chatflows/ReAct Agent.json @@ -1,5 +1,6 @@ { "description": "An agent that uses ReAct logic to decide what action to take", + "categories": "Calculator Tool,SerpAPI,ChatOpenAI,MRKL Agent,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Replicate LLM.json b/packages/server/marketplaces/chatflows/Replicate LLM.json index 832e85c7..ef8ab7f2 100644 --- a/packages/server/marketplaces/chatflows/Replicate LLM.json +++ b/packages/server/marketplaces/chatflows/Replicate LLM.json @@ -1,5 +1,6 @@ { "description": "Use Replicate API that runs Llama 13b v2 model with LLMChain", + "categories": "Replicate,LLM Chain,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/SQL DB Chain.json b/packages/server/marketplaces/chatflows/SQL DB Chain.json index 92e42178..3c143a33 100644 --- a/packages/server/marketplaces/chatflows/SQL DB Chain.json +++ b/packages/server/marketplaces/chatflows/SQL DB Chain.json @@ -1,5 +1,6 @@ { "description": "Answer questions over a SQL database", + "categories": "ChatOpenAI,Sql Database Chain,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/SQL Prompt.json b/packages/server/marketplaces/chatflows/SQL Prompt.json index 406c2e52..e79a95d0 100644 --- a/packages/server/marketplaces/chatflows/SQL Prompt.json +++ b/packages/server/marketplaces/chatflows/SQL Prompt.json @@ -1,5 +1,6 @@ { "description": "Manually construct prompts to query a SQL database", + "categories": "IfElse Function,Variable Set/Get,Custom JS Function,ChatOpenAI,LLM Chain,Langchain", "badge": "new", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Simple Chat Engine.json b/packages/server/marketplaces/chatflows/Simple Chat Engine.json index 630b6833..5510873d 100644 --- a/packages/server/marketplaces/chatflows/Simple Chat Engine.json +++ b/packages/server/marketplaces/chatflows/Simple Chat Engine.json @@ -1,5 +1,6 @@ { "description": "Simple chat engine to handle back and forth conversations using LlamaIndex", + "categories": "BufferMemory,AzureChatOpenAI,LlamaIndex", "badge": "NEW", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Simple Conversation Chain.json b/packages/server/marketplaces/chatflows/Simple Conversation Chain.json index 1ffbee44..e6c934ac 100644 --- a/packages/server/marketplaces/chatflows/Simple Conversation Chain.json +++ b/packages/server/marketplaces/chatflows/Simple Conversation Chain.json @@ -1,5 +1,6 @@ { "description": "Basic example of Conversation Chain with built-in memory - works exactly like ChatGPT", + "categories": "Buffer Memory,ChatOpenAI,Conversation Chain,Langchain", "badge": "POPULAR", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Simple LLM Chain.json b/packages/server/marketplaces/chatflows/Simple LLM Chain.json index f2e3a4a2..12298441 100644 --- a/packages/server/marketplaces/chatflows/Simple LLM Chain.json +++ b/packages/server/marketplaces/chatflows/Simple LLM Chain.json @@ -1,5 +1,6 @@ { "description": "Basic example of stateless (no memory) LLM Chain with a Prompt Template and LLM Model", + "categories": "OpenAI,LLM Chain,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Structured Output Parser.json b/packages/server/marketplaces/chatflows/Structured Output Parser.json index 92336443..20385a4b 100644 --- a/packages/server/marketplaces/chatflows/Structured Output Parser.json +++ b/packages/server/marketplaces/chatflows/Structured Output Parser.json @@ -1,5 +1,6 @@ { "description": "Return response as a specified JSON structure instead of a string/text", + "categories": "Structured Output Parser,ChatOpenAI,LLM Chain,Langchain", "badge": "NEW", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/SubQuestion Query Engine.json b/packages/server/marketplaces/chatflows/SubQuestion Query Engine.json index f14607da..2042625b 100644 --- a/packages/server/marketplaces/chatflows/SubQuestion Query Engine.json +++ b/packages/server/marketplaces/chatflows/SubQuestion Query Engine.json @@ -1,5 +1,6 @@ { "description": "Breaks down query into sub questions for each relevant data source, then combine into final response", + "categories": "Sub Question Query Engine,Sticky Note,QueryEngine Tool,Compact and Refine,ChatOpenAI,Pinecone,LlamaIndex", "badge": "NEW", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Translator.json b/packages/server/marketplaces/chatflows/Translator.json index 0bf49252..118457ef 100644 --- a/packages/server/marketplaces/chatflows/Translator.json +++ b/packages/server/marketplaces/chatflows/Translator.json @@ -1,5 +1,6 @@ { "description": "Language translation using LLM Chain with a Chat Prompt Template and Chat Model", + "categories": "Chat Prompt Template,ChatOpenAI,LLM Chain,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Vectara RAG Chain.json b/packages/server/marketplaces/chatflows/Vectara RAG Chain.json index d3bb5bf8..82e341c4 100644 --- a/packages/server/marketplaces/chatflows/Vectara RAG Chain.json +++ b/packages/server/marketplaces/chatflows/Vectara RAG Chain.json @@ -1,4 +1,6 @@ { + "description": "QA chain for Vectara", + "categories": "Vectara QA Chain,Vectara,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/WebBrowser.json b/packages/server/marketplaces/chatflows/WebBrowser.json index 2376e29e..75e3cf0a 100644 --- a/packages/server/marketplaces/chatflows/WebBrowser.json +++ b/packages/server/marketplaces/chatflows/WebBrowser.json @@ -1,5 +1,6 @@ { "description": "Conversational Agent with ability to visit a website and extract information", + "categories": "Buffer Memory,Web Browser,ChatOpenAI,Conversational Agent,Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/WebPage QnA.json b/packages/server/marketplaces/chatflows/WebPage QnA.json index a5a53233..089d195d 100644 --- a/packages/server/marketplaces/chatflows/WebPage QnA.json +++ b/packages/server/marketplaces/chatflows/WebPage QnA.json @@ -1,5 +1,6 @@ { "description": "Scrape web pages for QnA with long term memory Motorhead and return source documents", + "categories": "HtmlToMarkdown,Cheerio Web Scraper,ChatOpenAI,Redis,Pinecone,Langchain", "badge": "POPULAR", "nodes": [ { diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index e69e15ba..a65fabf3 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -1237,6 +1237,7 @@ export class App { templateName: file.split('.json')[0], flowData: fileData.toString(), badge: fileDataObj?.badge, + categories: fileDataObj?.categories, type: 'Chatflow', description: fileDataObj?.description || '' } @@ -1253,6 +1254,7 @@ export class App { ...fileDataObj, id: index, type: 'Tool', + categories: '', templateName: file.split('.json')[0] } templates.push(template) diff --git a/packages/ui/src/ui-component/table/MarketplaceTable.js b/packages/ui/src/ui-component/table/MarketplaceTable.js index 135d19e9..714f10b0 100644 --- a/packages/ui/src/ui-component/table/MarketplaceTable.js +++ b/packages/ui/src/ui-component/table/MarketplaceTable.js @@ -103,45 +103,27 @@ export const MarketplaceTable = ({ data, images, filterFunction, filterByBadge, - {row.type === 'Chatflow' && images[row.id] && ( -
- {images[row.id] - .slice(0, images[row.id].length > 5 ? 5 : images[row.id].length) - .map((img) => ( -
- -
+
+ {row.categories && + row.categories + .split(',') + .map((tag, index) => ( + ))} - {images[row.id].length > 5 && ( - - + {images[row.id].length - 5} More - - )} -
- )} +
diff --git a/packages/ui/src/views/marketplaces/index.js b/packages/ui/src/views/marketplaces/index.js index ac018663..f2055da6 100644 --- a/packages/ui/src/views/marketplaces/index.js +++ b/packages/ui/src/views/marketplaces/index.js @@ -129,6 +129,7 @@ const Marketplace = () => { function filterFlows(data) { return ( + data.categories?.toLowerCase().indexOf(search.toLowerCase()) > -1 || data.templateName.toLowerCase().indexOf(search.toLowerCase()) > -1 || (data.description && data.description.toLowerCase().indexOf(search.toLowerCase()) > -1) ) From 842d70bf0de1e8fb974bca2fa09aabd37adcfc23 Mon Sep 17 00:00:00 2001 From: vinodkiran Date: Mon, 5 Feb 2024 18:09:46 -0500 Subject: [PATCH 09/39] Marketplace: Adding filters and a collapsible panel show/hide --- .../chatflows/API Agent OpenAI.json | 1 + .../marketplaces/chatflows/API Agent.json | 1 + .../marketplaces/chatflows/Antonym.json | 1 + .../marketplaces/chatflows/AutoGPT.json | 1 + .../marketplaces/chatflows/BabyAGI.json | 1 + .../marketplaces/chatflows/CSV Agent.json | 1 + .../chatflows/Chat with a Podcast.json | 1 + .../marketplaces/chatflows/ChatGPTPlugin.json | 1 + .../marketplaces/chatflows/Claude LLM.json | 1 + .../chatflows/Context Chat Engine.json | 1 + .../chatflows/Conversational Agent.json | 1 + .../Conversational Retrieval Agent.json | 1 + .../Conversational Retrieval QA Chain.json | 1 + .../chatflows/Flowise Docs QnA.json | 1 + .../chatflows/HuggingFace LLM Chain.json | 1 + .../server/marketplaces/chatflows/IfElse.json | 1 + .../chatflows/Image Generation.json | 1 + .../chatflows/Input Moderation.json | 1 + .../chatflows/List Output Parser.json | 1 + .../marketplaces/chatflows/Local QnA.json | 1 + .../chatflows/Long Term Memory.json | 1 + .../chatflows/Metadata Filter.json | 1 + .../chatflows/Multi Prompt Chain.json | 1 + .../chatflows/Multi Retrieval QA Chain.json | 1 + .../chatflows/Multiple VectorDB.json | 1 + .../marketplaces/chatflows/OpenAI Agent.json | 1 + .../chatflows/OpenAI Assistant.json | 1 + .../Prompt Chaining with VectorStore.json | 1 + .../chatflows/Prompt Chaining.json | 1 + .../marketplaces/chatflows/Query Engine.json | 1 + .../marketplaces/chatflows/ReAct Agent.json | 1 + .../marketplaces/chatflows/Replicate LLM.json | 1 + .../marketplaces/chatflows/SQL DB Chain.json | 1 + .../marketplaces/chatflows/SQL Prompt.json | 1 + .../chatflows/Simple Chat Engine.json | 1 + .../chatflows/Simple Conversation Chain.json | 1 + .../chatflows/Simple LLM Chain.json | 1 + .../chatflows/Structured Output Parser.json | 1 + .../chatflows/SubQuestion Query Engine.json | 1 + .../marketplaces/chatflows/Translator.json | 1 + .../chatflows/Vectara RAG Chain.json | 1 + .../marketplaces/chatflows/WebBrowser.json | 3 +- .../marketplaces/chatflows/WebPage QnA.json | 1 + .../tools/Add Hubspot Contact.json | 1 + .../tools/Create Airtable Record.json | 1 + .../tools/Get Current DateTime.json | 1 + .../marketplaces/tools/Get Stock Mover.json | 1 + .../marketplaces/tools/Make Webhook.json | 1 + .../tools/Send Discord Message.json | 1 + .../tools/Send Slack Message.json | 1 + .../tools/Send Teams Message.json | 1 + .../marketplaces/tools/SendGrid Email.json | 1 + packages/server/src/index.ts | 3 + .../ui-component/table/MarketplaceTable.js | 32 +++- packages/ui/src/views/marketplaces/index.js | 170 ++++++++++++------ 55 files changed, 199 insertions(+), 60 deletions(-) diff --git a/packages/server/marketplaces/chatflows/API Agent OpenAI.json b/packages/server/marketplaces/chatflows/API Agent OpenAI.json index c0497a29..621529fc 100644 --- a/packages/server/marketplaces/chatflows/API Agent OpenAI.json +++ b/packages/server/marketplaces/chatflows/API Agent OpenAI.json @@ -1,6 +1,7 @@ { "description": "Use OpenAI Function Agent and Chain to automatically decide which API to call, generating url and body request from conversation", "categories": "Buffer Memory,ChainTool,API Chain,ChatOpenAI,OpenAI Function Agent,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/API Agent.json b/packages/server/marketplaces/chatflows/API Agent.json index 32469df9..9d5a6c54 100644 --- a/packages/server/marketplaces/chatflows/API Agent.json +++ b/packages/server/marketplaces/chatflows/API Agent.json @@ -1,6 +1,7 @@ { "description": "Given API docs, agent automatically decide which API to call, generating url and body request from conversation", "categories": "Buffer Memory,ChainTool,API Chain,ChatOpenAI,Conversational Agent,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Antonym.json b/packages/server/marketplaces/chatflows/Antonym.json index 1240bf30..97c5af71 100644 --- a/packages/server/marketplaces/chatflows/Antonym.json +++ b/packages/server/marketplaces/chatflows/Antonym.json @@ -1,6 +1,7 @@ { "description": "Output antonym of given user input using few-shot prompt template built with examples", "categories": "Few Shot Prompt,ChatOpenAI,LLM Chain,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/AutoGPT.json b/packages/server/marketplaces/chatflows/AutoGPT.json index e03a7408..c0ed0807 100644 --- a/packages/server/marketplaces/chatflows/AutoGPT.json +++ b/packages/server/marketplaces/chatflows/AutoGPT.json @@ -1,6 +1,7 @@ { "description": "Use AutoGPT - Autonomous agent with chain of thoughts for self-guided task completion", "categories": "AutoGPT,SERP Tool,File Read/Write,ChatOpenAI,Pinecone,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/BabyAGI.json b/packages/server/marketplaces/chatflows/BabyAGI.json index 52198b90..14976ad3 100644 --- a/packages/server/marketplaces/chatflows/BabyAGI.json +++ b/packages/server/marketplaces/chatflows/BabyAGI.json @@ -1,6 +1,7 @@ { "description": "Use BabyAGI to create tasks and reprioritize for a given objective", "categories": "BabyAGI,ChatOpenAI,Pinecone,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/CSV Agent.json b/packages/server/marketplaces/chatflows/CSV Agent.json index d23e93ad..3439625b 100644 --- a/packages/server/marketplaces/chatflows/CSV Agent.json +++ b/packages/server/marketplaces/chatflows/CSV Agent.json @@ -1,6 +1,7 @@ { "description": "Analyse and summarize CSV data", "categories": "CSV Agent,ChatOpenAI,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Chat with a Podcast.json b/packages/server/marketplaces/chatflows/Chat with a Podcast.json index c1f216e6..c87b3f2c 100644 --- a/packages/server/marketplaces/chatflows/Chat with a Podcast.json +++ b/packages/server/marketplaces/chatflows/Chat with a Podcast.json @@ -1,6 +1,7 @@ { "description": "Engage with data sources such as YouTube Transcripts, Google, and more through intelligent Q&A interactions", "categories": "Memory Vector Store,SearchAPI,ChatOpenAI,Conversational Retrieval QA Chain,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/ChatGPTPlugin.json b/packages/server/marketplaces/chatflows/ChatGPTPlugin.json index d9390f57..3777b637 100644 --- a/packages/server/marketplaces/chatflows/ChatGPTPlugin.json +++ b/packages/server/marketplaces/chatflows/ChatGPTPlugin.json @@ -1,6 +1,7 @@ { "description": "Use ChatGPT Plugins within LangChain abstractions with GET and POST Tools", "categories": "ChatGPT Plugin,HTTP GET/POST,ChatOpenAI,MRKL Agent,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Claude LLM.json b/packages/server/marketplaces/chatflows/Claude LLM.json index 39d1e6c6..a0fd4e1a 100644 --- a/packages/server/marketplaces/chatflows/Claude LLM.json +++ b/packages/server/marketplaces/chatflows/Claude LLM.json @@ -1,6 +1,7 @@ { "description": "Use Anthropic Claude with 200k context window to ingest whole document for QnA", "categories": "Buffer Memory,Prompt Template,Conversation Chain,ChatAnthropic,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Context Chat Engine.json b/packages/server/marketplaces/chatflows/Context Chat Engine.json index 26efcb1c..15d3dade 100644 --- a/packages/server/marketplaces/chatflows/Context Chat Engine.json +++ b/packages/server/marketplaces/chatflows/Context Chat Engine.json @@ -1,6 +1,7 @@ { "description": "Answer question based on retrieved documents (context) with built-in memory to remember conversation using LlamaIndex", "categories": "Text File,Prompt Template,ChatOpenAI,Conversation Chain,Pinecone,LlamaIndex,Redis", + "framework": "LlamaIndex", "badge": "NEW", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Conversational Agent.json b/packages/server/marketplaces/chatflows/Conversational Agent.json index 419e9a79..4cb736a0 100644 --- a/packages/server/marketplaces/chatflows/Conversational Agent.json +++ b/packages/server/marketplaces/chatflows/Conversational Agent.json @@ -1,6 +1,7 @@ { "description": "A conversational agent for a chat model which utilize chat specific prompts", "categories": "Calculator Tool,Buffer Memory,SerpAPI,ChatOpenAI,Conversational Agent,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json b/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json index 37dd3759..a4ec6b5b 100644 --- a/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json +++ b/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json @@ -2,6 +2,7 @@ "description": "Agent optimized for vector retrieval during conversation and answering questions based on previous dialogue.", "categories": "Retriever Tool,Buffer Memory,ChatOpenAI,Conversational Retrieval Agent, Pinecone,Langchain", "badge": "POPULAR", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json b/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json index 61bc6e39..e360141d 100644 --- a/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json +++ b/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json @@ -2,6 +2,7 @@ "description": "Text file QnA using conversational retrieval QA chain", "categories": "TextFile,ChatOpenAI,Conversational Retrieval QA Chain,Pinecone,Langchain", "badge": "POPULAR", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Flowise Docs QnA.json b/packages/server/marketplaces/chatflows/Flowise Docs QnA.json index 6eca2944..31d65c48 100644 --- a/packages/server/marketplaces/chatflows/Flowise Docs QnA.json +++ b/packages/server/marketplaces/chatflows/Flowise Docs QnA.json @@ -2,6 +2,7 @@ "description": "Flowise Docs Github QnA using conversational retrieval QA chain", "categories": "Memory Vector Store,Github Loader,ChatOpenAI,Conversational Retrieval QA Chain,Langchain", "badge": "POPULAR", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/HuggingFace LLM Chain.json b/packages/server/marketplaces/chatflows/HuggingFace LLM Chain.json index f87bf65a..6e7154b7 100644 --- a/packages/server/marketplaces/chatflows/HuggingFace LLM Chain.json +++ b/packages/server/marketplaces/chatflows/HuggingFace LLM Chain.json @@ -1,6 +1,7 @@ { "description": "Simple LLM Chain using HuggingFace Inference API on falcon-7b-instruct model", "categories": "HuggingFace,LLM Chain,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/IfElse.json b/packages/server/marketplaces/chatflows/IfElse.json index c856eac0..e3b66f44 100644 --- a/packages/server/marketplaces/chatflows/IfElse.json +++ b/packages/server/marketplaces/chatflows/IfElse.json @@ -1,6 +1,7 @@ { "description": "Split flows based on if else condition", "categories": "IfElse Function,ChatOpenAI,OpenAI,LLM Chain,Langchain", + "framework": "Langchain", "badge": "new", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Image Generation.json b/packages/server/marketplaces/chatflows/Image Generation.json index 8b07ae86..46cb79ec 100644 --- a/packages/server/marketplaces/chatflows/Image Generation.json +++ b/packages/server/marketplaces/chatflows/Image Generation.json @@ -2,6 +2,7 @@ "description": "Generate image using Replicate Stability text-to-image generative AI model", "badge": "NEW", "categories": "Replicate,ChatOpenAI,LLM Chain,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Input Moderation.json b/packages/server/marketplaces/chatflows/Input Moderation.json index cd7f2cb5..bd449777 100644 --- a/packages/server/marketplaces/chatflows/Input Moderation.json +++ b/packages/server/marketplaces/chatflows/Input Moderation.json @@ -2,6 +2,7 @@ "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", "badge": "NEW", "categories": "Moderation,ChatOpenAI,LLM Chain,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/List Output Parser.json b/packages/server/marketplaces/chatflows/List Output Parser.json index a67fb72b..0eb269b4 100644 --- a/packages/server/marketplaces/chatflows/List Output Parser.json +++ b/packages/server/marketplaces/chatflows/List Output Parser.json @@ -2,6 +2,7 @@ "description": "Return response as a list (array) instead of a string/text", "badge": "NEW", "categories": "CSV Output Parser,ChatOpenAI,LLM Chain,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Local QnA.json b/packages/server/marketplaces/chatflows/Local QnA.json index 11deae15..2637f259 100644 --- a/packages/server/marketplaces/chatflows/Local QnA.json +++ b/packages/server/marketplaces/chatflows/Local QnA.json @@ -2,6 +2,7 @@ "description": "QnA chain using Ollama local LLM, LocalAI embedding model, and Faiss local vector store", "badge": "POPULAR", "categories": "Text File,ChatOllama,Conversational Retrieval QA Chain,Faiss,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Long Term Memory.json b/packages/server/marketplaces/chatflows/Long Term Memory.json index ba2d2330..c5681d3d 100644 --- a/packages/server/marketplaces/chatflows/Long Term Memory.json +++ b/packages/server/marketplaces/chatflows/Long Term Memory.json @@ -1,6 +1,7 @@ { "description": "Use long term memory like Zep to differentiate conversations between users with sessionId", "categories": "ChatOpenAI,Conversational Retrieval QA Chain,Zep Memory,Qdrant,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Metadata Filter.json b/packages/server/marketplaces/chatflows/Metadata Filter.json index 13ca8745..38ad9211 100644 --- a/packages/server/marketplaces/chatflows/Metadata Filter.json +++ b/packages/server/marketplaces/chatflows/Metadata Filter.json @@ -2,6 +2,7 @@ "description": "Upsert multiple files with metadata and filter by it using conversational retrieval QA chain", "categories": "Text File,PDF File,ChatOpenAI,Conversational Retrieval QA Chain,Pinecone,Langchain", "badge": "POPULAR", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Multi Prompt Chain.json b/packages/server/marketplaces/chatflows/Multi Prompt Chain.json index 89935fcd..97cca308 100644 --- a/packages/server/marketplaces/chatflows/Multi Prompt Chain.json +++ b/packages/server/marketplaces/chatflows/Multi Prompt Chain.json @@ -1,6 +1,7 @@ { "description": "A chain that automatically picks an appropriate prompt from multiple prompts", "categories": "ChatOpenAI,Multi Prompt Chain,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json b/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json index 63a02edb..6b8f2c33 100644 --- a/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json +++ b/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json @@ -1,6 +1,7 @@ { "description": "A chain that automatically picks an appropriate retriever from multiple different vector databases", "categories": "ChatOpenAI,Multi Retrieval QA Chain,Pinecone,Chroma,Supabase,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Multiple VectorDB.json b/packages/server/marketplaces/chatflows/Multiple VectorDB.json index 7ffc040a..e8141ad7 100644 --- a/packages/server/marketplaces/chatflows/Multiple VectorDB.json +++ b/packages/server/marketplaces/chatflows/Multiple VectorDB.json @@ -1,6 +1,7 @@ { "description": "Use the agent to choose between multiple different vector databases, with the ability to use other tools", "categories": "Buffer Memory,ChatOpenAI,Chain Tool,Retrieval QA Chain,Redis,Faiss,Conversational Agent,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/OpenAI Agent.json b/packages/server/marketplaces/chatflows/OpenAI Agent.json index c4cf11f2..6f35e595 100644 --- a/packages/server/marketplaces/chatflows/OpenAI Agent.json +++ b/packages/server/marketplaces/chatflows/OpenAI Agent.json @@ -1,6 +1,7 @@ { "description": "An agent that uses OpenAI's Function Calling functionality to pick the tool and args to call", "categories": "Buffer Memory,Custom Tool, SerpAPI,OpenAI Function,Calculator Tool,ChatOpenAI,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/OpenAI Assistant.json b/packages/server/marketplaces/chatflows/OpenAI Assistant.json index f1595fd6..73c01413 100644 --- a/packages/server/marketplaces/chatflows/OpenAI Assistant.json +++ b/packages/server/marketplaces/chatflows/OpenAI Assistant.json @@ -1,6 +1,7 @@ { "description": "OpenAI Assistant that has instructions and can leverage models, tools, and knowledge to respond to user queries", "categories": "Custom Tool, SerpAPI,OpenAI Assistant,Calculator Tool,Langchain", + "framework": "Langchain", "badge": "NEW", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json b/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json index 3b8507b9..d225e41a 100644 --- a/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json +++ b/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json @@ -2,6 +2,7 @@ "description": "Use chat history to rephrase user question, and answer the rephrased question using retrieved docs from vector store", "categories": "ChatOpenAI,LLM Chain,SingleStore,Langchain", "badge": "POPULAR", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Prompt Chaining.json b/packages/server/marketplaces/chatflows/Prompt Chaining.json index 3ed5f95c..42debac8 100644 --- a/packages/server/marketplaces/chatflows/Prompt Chaining.json +++ b/packages/server/marketplaces/chatflows/Prompt Chaining.json @@ -1,6 +1,7 @@ { "description": "Use output from a chain as prompt for another chain", "categories": "Custom Tool,OpenAI,LLM Chain,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Query Engine.json b/packages/server/marketplaces/chatflows/Query Engine.json index 5697735b..b3a3c292 100644 --- a/packages/server/marketplaces/chatflows/Query Engine.json +++ b/packages/server/marketplaces/chatflows/Query Engine.json @@ -2,6 +2,7 @@ "description": "Stateless query engine designed to answer question over your data using LlamaIndex", "categories": "ChatAnthropic,Compact and Refine,Pinecone,LlamaIndex", "badge": "NEW", + "framework": "LlamaIndex", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/ReAct Agent.json b/packages/server/marketplaces/chatflows/ReAct Agent.json index 9831bcf6..5fd191fe 100644 --- a/packages/server/marketplaces/chatflows/ReAct Agent.json +++ b/packages/server/marketplaces/chatflows/ReAct Agent.json @@ -1,6 +1,7 @@ { "description": "An agent that uses ReAct logic to decide what action to take", "categories": "Calculator Tool,SerpAPI,ChatOpenAI,MRKL Agent,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Replicate LLM.json b/packages/server/marketplaces/chatflows/Replicate LLM.json index ef8ab7f2..578983cf 100644 --- a/packages/server/marketplaces/chatflows/Replicate LLM.json +++ b/packages/server/marketplaces/chatflows/Replicate LLM.json @@ -1,6 +1,7 @@ { "description": "Use Replicate API that runs Llama 13b v2 model with LLMChain", "categories": "Replicate,LLM Chain,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/SQL DB Chain.json b/packages/server/marketplaces/chatflows/SQL DB Chain.json index 3c143a33..ec9d465d 100644 --- a/packages/server/marketplaces/chatflows/SQL DB Chain.json +++ b/packages/server/marketplaces/chatflows/SQL DB Chain.json @@ -1,6 +1,7 @@ { "description": "Answer questions over a SQL database", "categories": "ChatOpenAI,Sql Database Chain,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/SQL Prompt.json b/packages/server/marketplaces/chatflows/SQL Prompt.json index e79a95d0..8d2691c6 100644 --- a/packages/server/marketplaces/chatflows/SQL Prompt.json +++ b/packages/server/marketplaces/chatflows/SQL Prompt.json @@ -1,6 +1,7 @@ { "description": "Manually construct prompts to query a SQL database", "categories": "IfElse Function,Variable Set/Get,Custom JS Function,ChatOpenAI,LLM Chain,Langchain", + "framework": "Langchain", "badge": "new", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Simple Chat Engine.json b/packages/server/marketplaces/chatflows/Simple Chat Engine.json index 5510873d..fd17ded1 100644 --- a/packages/server/marketplaces/chatflows/Simple Chat Engine.json +++ b/packages/server/marketplaces/chatflows/Simple Chat Engine.json @@ -1,6 +1,7 @@ { "description": "Simple chat engine to handle back and forth conversations using LlamaIndex", "categories": "BufferMemory,AzureChatOpenAI,LlamaIndex", + "framework": "LlamaIndex", "badge": "NEW", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Simple Conversation Chain.json b/packages/server/marketplaces/chatflows/Simple Conversation Chain.json index e6c934ac..53cfeace 100644 --- a/packages/server/marketplaces/chatflows/Simple Conversation Chain.json +++ b/packages/server/marketplaces/chatflows/Simple Conversation Chain.json @@ -1,6 +1,7 @@ { "description": "Basic example of Conversation Chain with built-in memory - works exactly like ChatGPT", "categories": "Buffer Memory,ChatOpenAI,Conversation Chain,Langchain", + "framework": "Langchain", "badge": "POPULAR", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Simple LLM Chain.json b/packages/server/marketplaces/chatflows/Simple LLM Chain.json index 12298441..36a5a8d8 100644 --- a/packages/server/marketplaces/chatflows/Simple LLM Chain.json +++ b/packages/server/marketplaces/chatflows/Simple LLM Chain.json @@ -1,6 +1,7 @@ { "description": "Basic example of stateless (no memory) LLM Chain with a Prompt Template and LLM Model", "categories": "OpenAI,LLM Chain,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Structured Output Parser.json b/packages/server/marketplaces/chatflows/Structured Output Parser.json index 20385a4b..9801a90f 100644 --- a/packages/server/marketplaces/chatflows/Structured Output Parser.json +++ b/packages/server/marketplaces/chatflows/Structured Output Parser.json @@ -1,6 +1,7 @@ { "description": "Return response as a specified JSON structure instead of a string/text", "categories": "Structured Output Parser,ChatOpenAI,LLM Chain,Langchain", + "framework": "Langchain", "badge": "NEW", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/SubQuestion Query Engine.json b/packages/server/marketplaces/chatflows/SubQuestion Query Engine.json index 2042625b..620712c4 100644 --- a/packages/server/marketplaces/chatflows/SubQuestion Query Engine.json +++ b/packages/server/marketplaces/chatflows/SubQuestion Query Engine.json @@ -1,6 +1,7 @@ { "description": "Breaks down query into sub questions for each relevant data source, then combine into final response", "categories": "Sub Question Query Engine,Sticky Note,QueryEngine Tool,Compact and Refine,ChatOpenAI,Pinecone,LlamaIndex", + "framework": "LlamaIndex", "badge": "NEW", "nodes": [ { diff --git a/packages/server/marketplaces/chatflows/Translator.json b/packages/server/marketplaces/chatflows/Translator.json index 118457ef..5c8a3cc5 100644 --- a/packages/server/marketplaces/chatflows/Translator.json +++ b/packages/server/marketplaces/chatflows/Translator.json @@ -1,6 +1,7 @@ { "description": "Language translation using LLM Chain with a Chat Prompt Template and Chat Model", "categories": "Chat Prompt Template,ChatOpenAI,LLM Chain,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/Vectara RAG Chain.json b/packages/server/marketplaces/chatflows/Vectara RAG Chain.json index 82e341c4..2ef1474a 100644 --- a/packages/server/marketplaces/chatflows/Vectara RAG Chain.json +++ b/packages/server/marketplaces/chatflows/Vectara RAG Chain.json @@ -1,6 +1,7 @@ { "description": "QA chain for Vectara", "categories": "Vectara QA Chain,Vectara,Langchain", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/WebBrowser.json b/packages/server/marketplaces/chatflows/WebBrowser.json index 75e3cf0a..232bd83e 100644 --- a/packages/server/marketplaces/chatflows/WebBrowser.json +++ b/packages/server/marketplaces/chatflows/WebBrowser.json @@ -1,6 +1,7 @@ { "description": "Conversational Agent with ability to visit a website and extract information", - "categories": "Buffer Memory,Web Browser,ChatOpenAI,Conversational Agent,Langchain", + "categories": "Buffer Memory,Web Browser,ChatOpenAI,Conversational Agent", + "framework": "Langchain", "nodes": [ { "width": 300, diff --git a/packages/server/marketplaces/chatflows/WebPage QnA.json b/packages/server/marketplaces/chatflows/WebPage QnA.json index 089d195d..50806161 100644 --- a/packages/server/marketplaces/chatflows/WebPage QnA.json +++ b/packages/server/marketplaces/chatflows/WebPage QnA.json @@ -1,6 +1,7 @@ { "description": "Scrape web pages for QnA with long term memory Motorhead and return source documents", "categories": "HtmlToMarkdown,Cheerio Web Scraper,ChatOpenAI,Redis,Pinecone,Langchain", + "framework": "Langchain", "badge": "POPULAR", "nodes": [ { diff --git a/packages/server/marketplaces/tools/Add Hubspot Contact.json b/packages/server/marketplaces/tools/Add Hubspot Contact.json index 584df4c3..f8715dcd 100644 --- a/packages/server/marketplaces/tools/Add Hubspot Contact.json +++ b/packages/server/marketplaces/tools/Add Hubspot Contact.json @@ -1,5 +1,6 @@ { "name": "add_contact_hubspot", + "framework": "Langchain", "description": "Add new contact to Hubspot", "color": "linear-gradient(rgb(85,198,123), rgb(0,230,99))", "iconSrc": "https://cdn.worldvectorlogo.com/logos/hubspot-1.svg", diff --git a/packages/server/marketplaces/tools/Create Airtable Record.json b/packages/server/marketplaces/tools/Create Airtable Record.json index c52c9199..5471b650 100644 --- a/packages/server/marketplaces/tools/Create Airtable Record.json +++ b/packages/server/marketplaces/tools/Create Airtable Record.json @@ -1,5 +1,6 @@ { "name": "add_airtable", + "framework": "Langchain", "description": "Add column1, column2 to Airtable", "color": "linear-gradient(rgb(125,71,222), rgb(128,102,23))", "iconSrc": "https://raw.githubusercontent.com/gilbarbara/logos/main/logos/airtable.svg", diff --git a/packages/server/marketplaces/tools/Get Current DateTime.json b/packages/server/marketplaces/tools/Get Current DateTime.json index b6860b30..b8279e33 100644 --- a/packages/server/marketplaces/tools/Get Current DateTime.json +++ b/packages/server/marketplaces/tools/Get Current DateTime.json @@ -1,5 +1,6 @@ { "name": "todays_date_time", + "framework": "Langchain", "description": "Useful to get todays day, date and time.", "color": "linear-gradient(rgb(117,118,129), rgb(230,10,250))", "iconSrc": "https://raw.githubusercontent.com/gilbarbara/logos/main/logos/javascript.svg", diff --git a/packages/server/marketplaces/tools/Get Stock Mover.json b/packages/server/marketplaces/tools/Get Stock Mover.json index 9108cc50..27d444b2 100644 --- a/packages/server/marketplaces/tools/Get Stock Mover.json +++ b/packages/server/marketplaces/tools/Get Stock Mover.json @@ -1,5 +1,6 @@ { "name": "get_stock_movers", + "framework": "Langchain", "description": "Get the stocks that has biggest price/volume moves, e.g. actives, gainers, losers, etc.", "iconSrc": "https://rapidapi.com/cdn/images?url=https://rapidapi-prod-apis.s3.amazonaws.com/9c/e743343bdd41edad39a3fdffd5b974/016c33699f51603ae6fe4420c439124b.png", "color": "linear-gradient(rgb(191,202,167), rgb(143,202,246))", diff --git a/packages/server/marketplaces/tools/Make Webhook.json b/packages/server/marketplaces/tools/Make Webhook.json index 24d00900..93e67a3f 100644 --- a/packages/server/marketplaces/tools/Make Webhook.json +++ b/packages/server/marketplaces/tools/Make Webhook.json @@ -1,5 +1,6 @@ { "name": "make_webhook", + "framework": "Langchain", "description": "Useful when you need to send message to Discord", "color": "linear-gradient(rgb(19,94,2), rgb(19,124,59))", "iconSrc": "https://github.com/FlowiseAI/Flowise/assets/26460777/517fdab2-8a6e-4781-b3c8-fb92cc78aa0b", diff --git a/packages/server/marketplaces/tools/Send Discord Message.json b/packages/server/marketplaces/tools/Send Discord Message.json index bbfaaa90..2d7adcac 100644 --- a/packages/server/marketplaces/tools/Send Discord Message.json +++ b/packages/server/marketplaces/tools/Send Discord Message.json @@ -1,5 +1,6 @@ { "name": "send_message_to_discord_channel", + "framework": "Langchain", "description": "Send message to Discord channel", "color": "linear-gradient(rgb(155,190,84), rgb(176,69,245))", "iconSrc": "https://raw.githubusercontent.com/gilbarbara/logos/main/logos/discord-icon.svg", diff --git a/packages/server/marketplaces/tools/Send Slack Message.json b/packages/server/marketplaces/tools/Send Slack Message.json index f15d4050..5516b69a 100644 --- a/packages/server/marketplaces/tools/Send Slack Message.json +++ b/packages/server/marketplaces/tools/Send Slack Message.json @@ -1,5 +1,6 @@ { "name": "send_message_to_slack_channel", + "framework": "Langchain", "description": "Send message to Slack channel", "color": "linear-gradient(rgb(155,190,84), rgb(176,69,245))", "iconSrc": "https://raw.githubusercontent.com/gilbarbara/logos/main/logos/slack-icon.svg", diff --git a/packages/server/marketplaces/tools/Send Teams Message.json b/packages/server/marketplaces/tools/Send Teams Message.json index 1af8111b..8ec32abd 100644 --- a/packages/server/marketplaces/tools/Send Teams Message.json +++ b/packages/server/marketplaces/tools/Send Teams Message.json @@ -1,5 +1,6 @@ { "name": "send_message_to_teams_channel", + "framework": "Langchain", "description": "Send message to Teams channel", "color": "linear-gradient(rgb(155,190,84), rgb(176,69,245))", "iconSrc": "https://raw.githubusercontent.com/gilbarbara/logos/main/logos/microsoft-teams.svg", diff --git a/packages/server/marketplaces/tools/SendGrid Email.json b/packages/server/marketplaces/tools/SendGrid Email.json index 8a6bf993..b454f2c5 100644 --- a/packages/server/marketplaces/tools/SendGrid Email.json +++ b/packages/server/marketplaces/tools/SendGrid Email.json @@ -1,5 +1,6 @@ { "name": "sendgrid_email", + "framework": "Langchain", "description": "Send email using SendGrid", "color": "linear-gradient(rgb(230,108,70), rgb(222,4,98))", "iconSrc": "https://raw.githubusercontent.com/gilbarbara/logos/main/logos/sendgrid-icon.svg", diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index a65fabf3..86595dc1 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -1237,6 +1237,7 @@ export class App { templateName: file.split('.json')[0], flowData: fileData.toString(), badge: fileDataObj?.badge, + framework: fileDataObj?.framework, categories: fileDataObj?.categories, type: 'Chatflow', description: fileDataObj?.description || '' @@ -1254,6 +1255,8 @@ export class App { ...fileDataObj, id: index, type: 'Tool', + framework: fileDataObj?.framework, + badge: fileDataObj?.badge, categories: '', templateName: file.split('.json')[0] } diff --git a/packages/ui/src/ui-component/table/MarketplaceTable.js b/packages/ui/src/ui-component/table/MarketplaceTable.js index 714f10b0..4fe4aee6 100644 --- a/packages/ui/src/ui-component/table/MarketplaceTable.js +++ b/packages/ui/src/ui-component/table/MarketplaceTable.js @@ -10,6 +10,8 @@ import TableRow from '@mui/material/TableRow' import Paper from '@mui/material/Paper' import Chip from '@mui/material/Chip' import { Button, Typography } from '@mui/material' +import langchainPNG from 'assets/images/langchain.png' +import llamaIndexPNG from 'assets/images/llamaindex.png' const StyledTableCell = styled(TableCell)(({ theme }) => ({ [`&.${tableCellClasses.head}`]: { @@ -31,7 +33,7 @@ const StyledTableRow = styled(TableRow)(({ theme }) => ({ } })) -export const MarketplaceTable = ({ data, images, filterFunction, filterByBadge, filterByType }) => { +export const MarketplaceTable = ({ data, filterFunction, filterByBadge, filterByType, filterByFramework }) => { const navigate = useNavigate() const openTemplate = (selectedTemplate) => { if (selectedTemplate.flowData) { @@ -61,10 +63,13 @@ export const MarketplaceTable = ({ data, images, filterFunction, filterByBadge, + + {''} + Name - + Type @@ -83,9 +88,20 @@ export const MarketplaceTable = ({ data, images, filterFunction, filterByBadge, .filter(filterByBadge) .filter(filterByType) .filter(filterFunction) + .filter(filterByFramework) .map((row, index) => ( + + {row.framework === 'Langchain' && ( + langchain + )} + {row.framework === 'LlamaIndex' && ( + llamaIndex + )} + + + @@ -94,15 +110,15 @@ export const MarketplaceTable = ({ data, images, filterFunction, filterByBadge, - + {row.type} - + {row.description || ''} - +
- + {row.badge && row.badge @@ -152,8 +168,8 @@ export const MarketplaceTable = ({ data, images, filterFunction, filterByBadge, MarketplaceTable.propTypes = { data: PropTypes.array, - images: PropTypes.object, filterFunction: PropTypes.func, filterByBadge: PropTypes.func, - filterByType: PropTypes.func + filterByType: PropTypes.func, + filterByFramework: PropTypes.func } diff --git a/packages/ui/src/views/marketplaces/index.js b/packages/ui/src/views/marketplaces/index.js index f2055da6..68258a47 100644 --- a/packages/ui/src/views/marketplaces/index.js +++ b/packages/ui/src/views/marketplaces/index.js @@ -19,10 +19,11 @@ import { Select, OutlinedInput, Checkbox, - ListItemText + ListItemText, + Button } from '@mui/material' import { useTheme } from '@mui/material/styles' -import { IconLayoutGrid, IconList, IconSearch } from '@tabler/icons' +import { IconChevronsDown, IconChevronsUp, IconLayoutGrid, IconList, IconSearch } from '@tabler/icons' // project imports import MainCard from 'ui-component/cards/MainCard' @@ -69,6 +70,7 @@ const ITEM_HEIGHT = 48 const ITEM_PADDING_TOP = 8 const badges = ['POPULAR', 'NEW'] const types = ['Chatflow', 'Tool'] +const framework = ['Langchain', 'LlamaIndex'] const MenuProps = { PaperProps: { style: { @@ -98,7 +100,8 @@ const Marketplace = () => { const [badgeFilter, setBadgeFilter] = useState([]) const [typeFilter, setTypeFilter] = useState([]) - + const [frameworkFilter, setFrameworkFilter] = useState([]) + const [open, setOpen] = useState(false) const handleBadgeFilterChange = (event) => { const { target: { value } @@ -117,6 +120,15 @@ const Marketplace = () => { typeof value === 'string' ? value.split(',') : value ) } + const handleFrameworkFilterChange = (event) => { + const { + target: { value } + } = event + setFrameworkFilter( + // On autofill we get a stringified value. + typeof value === 'string' ? value.split(',') : value + ) + } const handleViewChange = (event, nextView) => { localStorage.setItem('mpDisplayStyle', nextView) @@ -143,6 +155,10 @@ const Marketplace = () => { return typeFilter.length > 0 ? typeFilter.includes(data.type) : true } + function filterByFramework(data) { + return frameworkFilter.length > 0 ? frameworkFilter.includes(data.framework) : true + } + const onUseTemplate = (selectedTool) => { const dialogProp = { title: 'Add New Tool', @@ -224,9 +240,11 @@ const Marketplace = () => {

Marketplace

{ ) }} /> - - - Type - - - - - - Tag - - - + @@ -313,6 +293,93 @@ const Marketplace = () => { + {open && ( + + + + + Tag + + + + + + Type + + + + + + Framework + + + + + + )} + {!isLoading && (!view || view === 'card') && getAllTemplatesMarketplacesApi.data && ( <> @@ -320,6 +387,7 @@ const Marketplace = () => { .filter(filterByBadge) .filter(filterByType) .filter(filterFlows) + .filter(filterByFramework) .map((data, index) => ( {data.badge && ( @@ -351,10 +419,10 @@ const Marketplace = () => { )} From 8e80b582bbb5a91f7c6383af23ee4343b56d5a9e Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Tue, 6 Feb 2024 12:02:35 +0800 Subject: [PATCH 10/39] update return msg to correct url --- packages/server/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index dbb5717d..4d06f297 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -184,7 +184,7 @@ export class App { this.app.get('/api/v1/ip', (request, response) => { response.send({ ip: request.ip, - msg: 'See the returned IP address in the response. If it matches your current IP address ( which you can get by going to http://ip.nfriedly.com/ or https://api.ipify.org/ ), then the number of proxies is correct and the rate limiter should now work correctly. If not, increase the number of proxies by 1 until the IP address matches your own. Visit https://docs.flowiseai.com/deployment#rate-limit-setup-guide for more information.' + msg: 'Check the returned IP address in the response. If it matches your current IP address ( which you can get by going to http://ip.nfriedly.com/ or https://api.ipify.org/ ), then the number of proxies is correct and the rate limiter should now work correctly. If not, increase the number of proxies by 1 until the IP address matches your own. Visit https://docs.flowiseai.com/configuration/rate-limit#rate-limit-setup-guide for more information.' }) }) From 7486d33237c46bc0112fb7b3fb3e48f6cd1c89bf Mon Sep 17 00:00:00 2001 From: Ilango Date: Tue, 6 Feb 2024 10:36:27 +0530 Subject: [PATCH 11/39] Fix issue with relativeLinksMethod and limit not applying to manage links --- packages/server/src/index.ts | 3 ++- packages/ui/src/api/scraper.js | 6 +++--- .../src/ui-component/dialog/ManageScrapedLinksDialog.js | 2 +- packages/ui/src/views/canvas/NodeInputHandler.js | 8 ++++++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index dbb5717d..7ceba556 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -1148,8 +1148,9 @@ export class App { this.app.get('/api/v1/fetch-links', async (req: Request, res: Response) => { const url = decodeURIComponent(req.query.url as string) const relativeLinksMethod = req.query.relativeLinksMethod as string + const limit = parseInt(req.query.limit as string) if (process.env.DEBUG === 'true') console.info(`Start ${relativeLinksMethod}`) - const links: string[] = relativeLinksMethod === 'webCrawl' ? await webCrawl(url, 0) : await xmlScrape(url, 0) + const links: string[] = relativeLinksMethod === 'webCrawl' ? await webCrawl(url, limit) : await xmlScrape(url, limit) res.json({ status: 'OK', links }) }) diff --git a/packages/ui/src/api/scraper.js b/packages/ui/src/api/scraper.js index 382a9263..89333156 100644 --- a/packages/ui/src/api/scraper.js +++ b/packages/ui/src/api/scraper.js @@ -1,8 +1,8 @@ import client from './client' -const fetchAllLinks = (url, relativeLinksMethod) => - client.get(`/fetch-links?url=${encodeURIComponent(url)}&relativeLinksMethod=${relativeLinksMethod}`) +const fetchLinks = (url, relativeLinksMethod, relativeLinksLimit) => + client.get(`/fetch-links?url=${encodeURIComponent(url)}&relativeLinksMethod=${relativeLinksMethod}&limit=${relativeLinksLimit}`) export default { - fetchAllLinks + fetchLinks } diff --git a/packages/ui/src/ui-component/dialog/ManageScrapedLinksDialog.js b/packages/ui/src/ui-component/dialog/ManageScrapedLinksDialog.js index a707d82e..9a846ce9 100644 --- a/packages/ui/src/ui-component/dialog/ManageScrapedLinksDialog.js +++ b/packages/ui/src/ui-component/dialog/ManageScrapedLinksDialog.js @@ -53,7 +53,7 @@ const ManageScrapedLinksDialog = ({ show, dialogProps, onCancel, onSave }) => { const handleFetchLinks = async () => { setLoading(true) - const fetchLinksResp = await scraperApi.fetchAllLinks(url, 'webCrawl') + const fetchLinksResp = await scraperApi.fetchLinks(url, dialogProps.relativeLinksMethod, dialogProps.limit) if (fetchLinksResp.data) { setSelectedLinks(fetchLinksResp.data.links) } diff --git a/packages/ui/src/views/canvas/NodeInputHandler.js b/packages/ui/src/views/canvas/NodeInputHandler.js index bc877c9f..560fb34e 100644 --- a/packages/ui/src/views/canvas/NodeInputHandler.js +++ b/packages/ui/src/views/canvas/NodeInputHandler.js @@ -91,9 +91,11 @@ const NodeInputHandler = ({ inputAnchor, inputParam, data, disabled = false, isA } } - const onManageLinksDialogClicked = (url, selectedLinks) => { + const onManageLinksDialogClicked = (url, selectedLinks, relativeLinksMethod, limit) => { const dialogProps = { url, + relativeLinksMethod, + limit, selectedLinks, confirmButtonName: 'Save', cancelButtonName: 'Cancel' @@ -475,7 +477,9 @@ const NodeInputHandler = ({ inputAnchor, inputParam, data, disabled = false, isA onClick={() => onManageLinksDialogClicked( data.inputs[inputParam.name] ?? inputParam.default ?? '', - data.inputs.selectedLinks + data.inputs.selectedLinks, + data.inputs['relativeLinksMethod'] ?? 'webCrawl', + parseInt(data.inputs['limit']) ?? 0 ) } > From c2ae7e138cbf8a4355cafc109df5b7b5a0eb0a21 Mon Sep 17 00:00:00 2001 From: Ilango Date: Tue, 6 Feb 2024 14:40:19 +0530 Subject: [PATCH 12/39] Apply limit to selectedLinks even when relative links method is not specified --- packages/components/nodes/documentloaders/Cheerio/Cheerio.ts | 2 +- .../components/nodes/documentloaders/Playwright/Playwright.ts | 2 +- .../components/nodes/documentloaders/Puppeteer/Puppeteer.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/nodes/documentloaders/Cheerio/Cheerio.ts b/packages/components/nodes/documentloaders/Cheerio/Cheerio.ts index 3eba0ece..6af1f9a9 100644 --- a/packages/components/nodes/documentloaders/Cheerio/Cheerio.ts +++ b/packages/components/nodes/documentloaders/Cheerio/Cheerio.ts @@ -143,7 +143,7 @@ class Cheerio_DocumentLoaders implements INode { } else if (selectedLinks && selectedLinks.length > 0) { if (process.env.DEBUG === 'true') options.logger.info(`pages: ${JSON.stringify(selectedLinks)}, length: ${selectedLinks.length}`) - for (const page of selectedLinks) { + for (const page of selectedLinks.slice(0, limit)) { docs.push(...(await cheerioLoader(page))) } } else { diff --git a/packages/components/nodes/documentloaders/Playwright/Playwright.ts b/packages/components/nodes/documentloaders/Playwright/Playwright.ts index 2de166ce..2ba60d0f 100644 --- a/packages/components/nodes/documentloaders/Playwright/Playwright.ts +++ b/packages/components/nodes/documentloaders/Playwright/Playwright.ts @@ -184,7 +184,7 @@ class Playwright_DocumentLoaders implements INode { } else if (selectedLinks && selectedLinks.length > 0) { if (process.env.DEBUG === 'true') options.logger.info(`pages: ${JSON.stringify(selectedLinks)}, length: ${selectedLinks.length}`) - for (const page of selectedLinks) { + for (const page of selectedLinks.slice(0, limit)) { docs.push(...(await playwrightLoader(page))) } } else { diff --git a/packages/components/nodes/documentloaders/Puppeteer/Puppeteer.ts b/packages/components/nodes/documentloaders/Puppeteer/Puppeteer.ts index 3d28f310..1f8c8f3f 100644 --- a/packages/components/nodes/documentloaders/Puppeteer/Puppeteer.ts +++ b/packages/components/nodes/documentloaders/Puppeteer/Puppeteer.ts @@ -185,7 +185,7 @@ class Puppeteer_DocumentLoaders implements INode { } else if (selectedLinks && selectedLinks.length > 0) { if (process.env.DEBUG === 'true') options.logger.info(`pages: ${JSON.stringify(selectedLinks)}, length: ${selectedLinks.length}`) - for (const page of selectedLinks) { + for (const page of selectedLinks.slice(0, limit)) { docs.push(...(await puppeteerLoader(page))) } } else { From 90e6a804e462dc9ea1db6fd598840830b142364b Mon Sep 17 00:00:00 2001 From: Kenny Vaneetvelde Date: Tue, 6 Feb 2024 13:02:30 +0100 Subject: [PATCH 13/39] Make the zod schema a main parameter instead of an additional param --- .../StructuredOutputParserAdvanced.ts | 5 +- .../Advanced Structured Output Parser.json | 137 +++++++++--------- 2 files changed, 70 insertions(+), 72 deletions(-) diff --git a/packages/components/nodes/outputparsers/StructuredOutputParserAdvanced/StructuredOutputParserAdvanced.ts b/packages/components/nodes/outputparsers/StructuredOutputParserAdvanced/StructuredOutputParserAdvanced.ts index b0fad136..e7fe8ea7 100644 --- a/packages/components/nodes/outputparsers/StructuredOutputParserAdvanced/StructuredOutputParserAdvanced.ts +++ b/packages/components/nodes/outputparsers/StructuredOutputParserAdvanced/StructuredOutputParserAdvanced.ts @@ -46,9 +46,8 @@ class AdvancedStructuredOutputParser implements INode { "Action", "Comedy", "Drama", "Fantasy", "Horror", "Mystery", "Romance", "Science Fiction", "Thriller", "Documentary" ]).array().max(2), // Array of genres, max of 2 from the defined enum - shortDescription: z.string().max(500) // Short description, max 150 characters -})`, - additionalParams: true + shortDescription: z.string().max(500) // Short description, max 500 characters +})` } ] } diff --git a/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json b/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json index a48f5b2a..3fd71988 100644 --- a/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json +++ b/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json @@ -169,67 +169,6 @@ }, "dragging": false }, - { - "width": 300, - "height": 329, - "id": "advancedStructuredOutputParser_0", - "position": { - "x": 494.20163170226266, - "y": 568.3420937517054 - }, - "type": "customNode", - "data": { - "id": "advancedStructuredOutputParser_0", - "label": "Advanced Structured Output Parser", - "version": 1, - "name": "advancedStructuredOutputParser", - "type": "AdvancedStructuredOutputParser", - "baseClasses": ["AdvancedStructuredOutputParser", "BaseLLMOutputParser", "Runnable"], - "category": "Output Parsers", - "description": "Parse the output of an LLM call into a given structure by providing a Zod schema.", - "inputParams": [ - { - "label": "Autofix", - "name": "autofixParser", - "type": "boolean", - "optional": true, - "description": "In the event that the first call fails, will make another call to the model to fix any errors.", - "id": "advancedStructuredOutputParser_0-input-autofixParser-boolean" - }, - { - "label": "Example JSON", - "name": "exampleJson", - "type": "string", - "description": "Zod schema for the output of the model", - "rows": 10, - "default": "z.object({\n title: z.string(), // Title of the movie as a string\n yearOfRelease: z.number().int(), // Release year as an integer number,\n genres: z.enum([\n \"Action\", \"Comedy\", \"Drama\", \"Fantasy\", \"Horror\",\n \"Mystery\", \"Romance\", \"Science Fiction\", \"Thriller\", \"Documentary\"\n ]).array().max(2), // Array of genres, max of 2 from the defined enum\n shortDescription: z.string().max(500) // Short description, max 150 characters\n})", - "additionalParams": true, - "id": "advancedStructuredOutputParser_0-input-exampleJson-string" - } - ], - "inputAnchors": [], - "inputs": { - "autofixParser": true, - "exampleJson": "z.object({\n title: z.string(), // Title of the movie as a string\n yearOfRelease: z.number().int(), // Release year as an integer number,\n genres: z.enum([\n \"Action\", \"Comedy\", \"Drama\", \"Fantasy\", \"Horror\",\n \"Mystery\", \"Romance\", \"Science Fiction\", \"Thriller\", \"Documentary\"\n ]).array().max(2), // Array of genres, max of 2 from the defined enum\n shortDescription: z.string().max(500) // Short description, max 150 characters\n})" - }, - "outputAnchors": [ - { - "id": "advancedStructuredOutputParser_0-output-advancedStructuredOutputParser-AdvancedStructuredOutputParser|BaseLLMOutputParser|Runnable", - "name": "advancedStructuredOutputParser", - "label": "AdvancedStructuredOutputParser", - "type": "AdvancedStructuredOutputParser | BaseLLMOutputParser | Runnable" - } - ], - "outputs": {}, - "selected": false - }, - "selected": false, - "positionAbsolute": { - "x": 494.20163170226266, - "y": 568.3420937517054 - }, - "dragging": false - }, { "width": 300, "height": 576, @@ -431,6 +370,66 @@ "y": -355.71028569475095 }, "dragging": false + }, + { + "width": 300, + "height": 454, + "id": "advancedStructuredOutputParser_0", + "position": { + "x": 489.3637511211284, + "y": 580.0628053662244 + }, + "type": "customNode", + "data": { + "id": "advancedStructuredOutputParser_0", + "label": "Advanced Structured Output Parser", + "version": 1, + "name": "advancedStructuredOutputParser", + "type": "AdvancedStructuredOutputParser", + "baseClasses": ["AdvancedStructuredOutputParser", "BaseLLMOutputParser", "Runnable"], + "category": "Output Parsers", + "description": "Parse the output of an LLM call into a given structure by providing a Zod schema.", + "inputParams": [ + { + "label": "Autofix", + "name": "autofixParser", + "type": "boolean", + "optional": true, + "description": "In the event that the first call fails, will make another call to the model to fix any errors.", + "id": "advancedStructuredOutputParser_0-input-autofixParser-boolean" + }, + { + "label": "Example JSON", + "name": "exampleJson", + "type": "string", + "description": "Zod schema for the output of the model", + "rows": 10, + "default": "z.object({\n title: z.string(), // Title of the movie as a string\n yearOfRelease: z.number().int(), // Release year as an integer number,\n genres: z.enum([\n \"Action\", \"Comedy\", \"Drama\", \"Fantasy\", \"Horror\",\n \"Mystery\", \"Romance\", \"Science Fiction\", \"Thriller\", \"Documentary\"\n ]).array().max(2), // Array of genres, max of 2 from the defined enum\n shortDescription: z.string().max(500) // Short description, max 500 characters\n})", + "id": "advancedStructuredOutputParser_0-input-exampleJson-string" + } + ], + "inputAnchors": [], + "inputs": { + "autofixParser": "", + "exampleJson": "z.object({\n title: z.string(), // Title of the movie as a string\n yearOfRelease: z.number().int(), // Release year as an integer number,\n genres: z.enum([\n \"Action\", \"Comedy\", \"Drama\", \"Fantasy\", \"Horror\",\n \"Mystery\", \"Romance\", \"Science Fiction\", \"Thriller\", \"Documentary\"\n ]).array().max(2), // Array of genres, max of 2 from the defined enum\n shortDescription: z.string().max(500) // Short description, max 500 characters\n})" + }, + "outputAnchors": [ + { + "id": "advancedStructuredOutputParser_0-output-advancedStructuredOutputParser-AdvancedStructuredOutputParser|BaseLLMOutputParser|Runnable", + "name": "advancedStructuredOutputParser", + "label": "AdvancedStructuredOutputParser", + "type": "AdvancedStructuredOutputParser | BaseLLMOutputParser | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 489.3637511211284, + "y": 580.0628053662244 + } } ], "edges": [ @@ -445,14 +444,6 @@ "label": "" } }, - { - "source": "advancedStructuredOutputParser_0", - "sourceHandle": "advancedStructuredOutputParser_0-output-advancedStructuredOutputParser-AdvancedStructuredOutputParser|BaseLLMOutputParser|Runnable", - "target": "llmChain_0", - "targetHandle": "llmChain_0-input-outputParser-BaseLLMOutputParser", - "type": "buttonedge", - "id": "advancedStructuredOutputParser_0-advancedStructuredOutputParser_0-output-advancedStructuredOutputParser-AdvancedStructuredOutputParser|BaseLLMOutputParser|Runnable-llmChain_0-llmChain_0-input-outputParser-BaseLLMOutputParser" - }, { "source": "chatOpenAI_0", "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", @@ -460,6 +451,14 @@ "targetHandle": "llmChain_0-input-model-BaseLanguageModel", "type": "buttonedge", "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_0-llmChain_0-input-model-BaseLanguageModel" + }, + { + "source": "advancedStructuredOutputParser_0", + "sourceHandle": "advancedStructuredOutputParser_0-output-advancedStructuredOutputParser-AdvancedStructuredOutputParser|BaseLLMOutputParser|Runnable", + "target": "llmChain_0", + "targetHandle": "llmChain_0-input-outputParser-BaseLLMOutputParser", + "type": "buttonedge", + "id": "advancedStructuredOutputParser_0-advancedStructuredOutputParser_0-output-advancedStructuredOutputParser-AdvancedStructuredOutputParser|BaseLLMOutputParser|Runnable-llmChain_0-llmChain_0-input-outputParser-BaseLLMOutputParser" } ] } From f14039736dd5147418e2f28425f3ffc64347daa2 Mon Sep 17 00:00:00 2001 From: vinodkiran Date: Tue, 6 Feb 2024 11:29:50 -0500 Subject: [PATCH 14/39] Marketplace : removing icon column --- .../ui-component/table/MarketplaceTable.js | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/packages/ui/src/ui-component/table/MarketplaceTable.js b/packages/ui/src/ui-component/table/MarketplaceTable.js index 4fe4aee6..ebbc8537 100644 --- a/packages/ui/src/ui-component/table/MarketplaceTable.js +++ b/packages/ui/src/ui-component/table/MarketplaceTable.js @@ -10,8 +10,6 @@ import TableRow from '@mui/material/TableRow' import Paper from '@mui/material/Paper' import Chip from '@mui/material/Chip' import { Button, Typography } from '@mui/material' -import langchainPNG from 'assets/images/langchain.png' -import llamaIndexPNG from 'assets/images/llamaindex.png' const StyledTableCell = styled(TableCell)(({ theme }) => ({ [`&.${tableCellClasses.head}`]: { @@ -63,9 +61,6 @@ export const MarketplaceTable = ({ data, filterFunction, filterByBadge, filterBy
- - {''} - Name @@ -92,16 +87,6 @@ export const MarketplaceTable = ({ data, filterFunction, filterByBadge, filterBy .map((row, index) => ( - - {row.framework === 'Langchain' && ( - langchain - )} - {row.framework === 'LlamaIndex' && ( - llamaIndex - )} - - - @@ -110,15 +95,15 @@ export const MarketplaceTable = ({ data, filterFunction, filterByBadge, filterBy - + {row.type} - + {row.description || ''} - +
- + {row.badge && row.badge From 4be28c4050135b6fc2354e43efccf30d3787acbc Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Wed, 7 Feb 2024 19:32:48 +0800 Subject: [PATCH 15/39] add finish log --- packages/server/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index 7ceba556..bd44b739 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -1151,6 +1151,7 @@ export class App { const limit = parseInt(req.query.limit as string) if (process.env.DEBUG === 'true') console.info(`Start ${relativeLinksMethod}`) const links: string[] = relativeLinksMethod === 'webCrawl' ? await webCrawl(url, limit) : await xmlScrape(url, limit) + if (process.env.DEBUG === 'true') console.info(`Finish ${relativeLinksMethod}`) res.json({ status: 'OK', links }) }) From 08c07802f5680c6de447ee1577dda498ba67699c Mon Sep 17 00:00:00 2001 From: vinodkiran Date: Wed, 7 Feb 2024 07:08:55 -0500 Subject: [PATCH 16/39] Fix for Tool Opening. --- .../ui-component/table/MarketplaceTable.js | 22 ++++--------------- packages/ui/src/views/marketplaces/index.js | 2 ++ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/packages/ui/src/ui-component/table/MarketplaceTable.js b/packages/ui/src/ui-component/table/MarketplaceTable.js index ebbc8537..3b66409b 100644 --- a/packages/ui/src/ui-component/table/MarketplaceTable.js +++ b/packages/ui/src/ui-component/table/MarketplaceTable.js @@ -1,5 +1,4 @@ import PropTypes from 'prop-types' -import { useNavigate } from 'react-router-dom' import { styled } from '@mui/material/styles' import Table from '@mui/material/Table' import TableBody from '@mui/material/TableBody' @@ -31,8 +30,7 @@ const StyledTableRow = styled(TableRow)(({ theme }) => ({ } })) -export const MarketplaceTable = ({ data, filterFunction, filterByBadge, filterByType, filterByFramework }) => { - const navigate = useNavigate() +export const MarketplaceTable = ({ data, filterFunction, filterByBadge, filterByType, filterByFramework, goToCanvas, goToTool }) => { const openTemplate = (selectedTemplate) => { if (selectedTemplate.flowData) { goToCanvas(selectedTemplate) @@ -41,20 +39,6 @@ export const MarketplaceTable = ({ data, filterFunction, filterByBadge, filterBy } } - const goToTool = (selectedTool) => { - const dialogProp = { - title: selectedTool.templateName, - type: 'TEMPLATE', - data: selectedTool - } - setToolDialogProps(dialogProp) - setShowToolDialog(true) - } - - const goToCanvas = (selectedChatflow) => { - navigate(`/marketplace/${selectedChatflow.id}`, { state: selectedChatflow }) - } - return ( <> @@ -156,5 +140,7 @@ MarketplaceTable.propTypes = { filterFunction: PropTypes.func, filterByBadge: PropTypes.func, filterByType: PropTypes.func, - filterByFramework: PropTypes.func + filterByFramework: PropTypes.func, + goToTool: PropTypes.func, + goToCanvas: PropTypes.func } diff --git a/packages/ui/src/views/marketplaces/index.js b/packages/ui/src/views/marketplaces/index.js index 68258a47..e5a65cb9 100644 --- a/packages/ui/src/views/marketplaces/index.js +++ b/packages/ui/src/views/marketplaces/index.js @@ -423,6 +423,8 @@ const Marketplace = () => { filterByType={filterByType} filterByBadge={filterByBadge} filterByFramework={filterByFramework} + goToTool={goToTool} + goToCanvas={goToCanvas} /> )} From 3f0f0e4d28ff0aad1a74720153cf8235b1067161 Mon Sep 17 00:00:00 2001 From: Jared Tracy Date: Wed, 7 Feb 2024 20:18:06 -0600 Subject: [PATCH 17/39] DynamoDB Chat Memory fix Fixes #1624 Please note comment in class BufferMemoryExtended for further discussion, if necessary --- .../components/nodes/memory/DynamoDb/DynamoDb.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/components/nodes/memory/DynamoDb/DynamoDb.ts b/packages/components/nodes/memory/DynamoDb/DynamoDb.ts index 91c1d369..864ff7c8 100644 --- a/packages/components/nodes/memory/DynamoDb/DynamoDb.ts +++ b/packages/components/nodes/memory/DynamoDb/DynamoDb.ts @@ -142,18 +142,26 @@ interface DynamoDBSerializedChatMessage { } class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { + tableName = '' sessionId = '' dynamodbClient: DynamoDBClient + dynamoKey = '' + partitionKey = '' constructor(fields: BufferMemoryInput & BufferMemoryExtendedInput) { super(fields) this.sessionId = fields.sessionId this.dynamodbClient = fields.dynamodbClient + + // These fields are coming in on chatHistory, but should they be on the dynamodbClient instead? + this.partitionKey = (fields?.chatHistory as unknown as { partitionKey: string }).partitionKey + this.dynamoKey = (fields?.chatHistory as unknown as { dynamoKey: string }).dynamoKey + this.tableName = (fields?.chatHistory as unknown as { tableName: string }).tableName } overrideDynamoKey(overrideSessionId = '') { - const existingDynamoKey = (this as any).dynamoKey - const partitionKey = (this as any).partitionKey + const existingDynamoKey = this.dynamoKey + const partitionKey = this.partitionKey let newDynamoKey: Record = {} @@ -210,7 +218,7 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { if (!this.dynamodbClient) return [] const dynamoKey = overrideSessionId ? this.overrideDynamoKey(overrideSessionId) : (this as any).dynamoKey - const tableName = (this as any).tableName + const tableName = this.tableName const messageAttributeName = (this as any).messageAttributeName const params: GetItemCommandInput = { From bc054d2fe1aa06de3fb44cc865fa39336041f103 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 8 Feb 2024 11:55:30 +0800 Subject: [PATCH 18/39] add fix for override session id --- .../components/nodes/memory/MongoDBMemory/MongoDBMemory.ts | 6 +++--- .../nodes/memory/MotorheadMemory/MotorheadMemory.ts | 6 +++--- .../memory/RedisBackedChatMemory/RedisBackedChatMemory.ts | 6 +++--- .../UpstashRedisBackedChatMemory.ts | 6 +++--- packages/components/nodes/memory/ZepMemory/ZepMemory.ts | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/components/nodes/memory/MongoDBMemory/MongoDBMemory.ts b/packages/components/nodes/memory/MongoDBMemory/MongoDBMemory.ts index b7309dcd..e2ee9f44 100644 --- a/packages/components/nodes/memory/MongoDBMemory/MongoDBMemory.ts +++ b/packages/components/nodes/memory/MongoDBMemory/MongoDBMemory.ts @@ -154,7 +154,7 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { async getChatMessages(overrideSessionId = '', returnBaseMessages = false): Promise { if (!this.collection) return [] - const id = overrideSessionId ?? this.sessionId + const id = overrideSessionId ? overrideSessionId : this.sessionId const document = await this.collection.findOne({ sessionId: id }) const messages = document?.messages || [] const baseMessages = messages.map(mapStoredMessageToChatMessage) @@ -164,7 +164,7 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { async addChatMessages(msgArray: { text: string; type: MessageType }[], overrideSessionId = ''): Promise { if (!this.collection) return - const id = overrideSessionId ?? this.sessionId + const id = overrideSessionId ? overrideSessionId : this.sessionId const input = msgArray.find((msg) => msg.type === 'userMessage') const output = msgArray.find((msg) => msg.type === 'apiMessage') @@ -196,7 +196,7 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { async clearChatMessages(overrideSessionId = ''): Promise { if (!this.collection) return - const id = overrideSessionId ?? this.sessionId + const id = overrideSessionId ? overrideSessionId : this.sessionId await this.collection.deleteOne({ sessionId: id }) await this.clear() } diff --git a/packages/components/nodes/memory/MotorheadMemory/MotorheadMemory.ts b/packages/components/nodes/memory/MotorheadMemory/MotorheadMemory.ts index 19506fc1..0b8f3800 100644 --- a/packages/components/nodes/memory/MotorheadMemory/MotorheadMemory.ts +++ b/packages/components/nodes/memory/MotorheadMemory/MotorheadMemory.ts @@ -141,7 +141,7 @@ class MotorheadMemoryExtended extends MotorheadMemory implements MemoryMethods { } async getChatMessages(overrideSessionId = '', returnBaseMessages = false): Promise { - const id = overrideSessionId ?? this.sessionId + const id = overrideSessionId ? overrideSessionId : this.sessionId try { const resp = await this.caller.call(fetch, `${this.url}/sessions/${id}/memory`, { //@ts-ignore @@ -172,7 +172,7 @@ class MotorheadMemoryExtended extends MotorheadMemory implements MemoryMethods { } async addChatMessages(msgArray: { text: string; type: MessageType }[], overrideSessionId = ''): Promise { - const id = overrideSessionId ?? this.sessionId + const id = overrideSessionId ? overrideSessionId : this.sessionId const input = msgArray.find((msg) => msg.type === 'userMessage') const output = msgArray.find((msg) => msg.type === 'apiMessage') const inputValues = { [this.inputKey ?? 'input']: input?.text } @@ -182,7 +182,7 @@ class MotorheadMemoryExtended extends MotorheadMemory implements MemoryMethods { } async clearChatMessages(overrideSessionId = ''): Promise { - const id = overrideSessionId ?? this.sessionId + const id = overrideSessionId ? overrideSessionId : this.sessionId await this.clear(id) } } diff --git a/packages/components/nodes/memory/RedisBackedChatMemory/RedisBackedChatMemory.ts b/packages/components/nodes/memory/RedisBackedChatMemory/RedisBackedChatMemory.ts index c54e07b5..965b6760 100644 --- a/packages/components/nodes/memory/RedisBackedChatMemory/RedisBackedChatMemory.ts +++ b/packages/components/nodes/memory/RedisBackedChatMemory/RedisBackedChatMemory.ts @@ -189,7 +189,7 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { async getChatMessages(overrideSessionId = '', returnBaseMessages = false): Promise { if (!this.redisClient) return [] - const id = overrideSessionId ?? this.sessionId + const id = overrideSessionId ? overrideSessionId : this.sessionId const rawStoredMessages = await this.redisClient.lrange(id, this.windowSize ? this.windowSize * -1 : 0, -1) const orderedMessages = rawStoredMessages.reverse().map((message) => JSON.parse(message)) const baseMessages = orderedMessages.map(mapStoredMessageToChatMessage) @@ -199,7 +199,7 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { async addChatMessages(msgArray: { text: string; type: MessageType }[], overrideSessionId = ''): Promise { if (!this.redisClient) return - const id = overrideSessionId ?? this.sessionId + const id = overrideSessionId ? overrideSessionId : this.sessionId const input = msgArray.find((msg) => msg.type === 'userMessage') const output = msgArray.find((msg) => msg.type === 'apiMessage') @@ -219,7 +219,7 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { async clearChatMessages(overrideSessionId = ''): Promise { if (!this.redisClient) return - const id = overrideSessionId ?? this.sessionId + const id = overrideSessionId ? overrideSessionId : this.sessionId await this.redisClient.del(id) await this.clear() } diff --git a/packages/components/nodes/memory/UpstashRedisBackedChatMemory/UpstashRedisBackedChatMemory.ts b/packages/components/nodes/memory/UpstashRedisBackedChatMemory/UpstashRedisBackedChatMemory.ts index 3d7f6dbf..98a704ab 100644 --- a/packages/components/nodes/memory/UpstashRedisBackedChatMemory/UpstashRedisBackedChatMemory.ts +++ b/packages/components/nodes/memory/UpstashRedisBackedChatMemory/UpstashRedisBackedChatMemory.ts @@ -114,7 +114,7 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { async getChatMessages(overrideSessionId = '', returnBaseMessages = false): Promise { if (!this.redisClient) return [] - const id = overrideSessionId ?? this.sessionId + const id = overrideSessionId ? overrideSessionId : this.sessionId const rawStoredMessages: StoredMessage[] = await this.redisClient.lrange(id, 0, -1) const orderedMessages = rawStoredMessages.reverse() const previousMessages = orderedMessages.filter((x): x is StoredMessage => x.type !== undefined && x.data.content !== undefined) @@ -125,7 +125,7 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { async addChatMessages(msgArray: { text: string; type: MessageType }[], overrideSessionId = ''): Promise { if (!this.redisClient) return - const id = overrideSessionId ?? this.sessionId + const id = overrideSessionId ? overrideSessionId : this.sessionId const input = msgArray.find((msg) => msg.type === 'userMessage') const output = msgArray.find((msg) => msg.type === 'apiMessage') @@ -145,7 +145,7 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { async clearChatMessages(overrideSessionId = ''): Promise { if (!this.redisClient) return - const id = overrideSessionId ?? this.sessionId + const id = overrideSessionId ? overrideSessionId : this.sessionId await this.redisClient.del(id) await this.clear() } diff --git a/packages/components/nodes/memory/ZepMemory/ZepMemory.ts b/packages/components/nodes/memory/ZepMemory/ZepMemory.ts index 597eee8a..360a76d4 100644 --- a/packages/components/nodes/memory/ZepMemory/ZepMemory.ts +++ b/packages/components/nodes/memory/ZepMemory/ZepMemory.ts @@ -163,14 +163,14 @@ class ZepMemoryExtended extends ZepMemory implements MemoryMethods { } async getChatMessages(overrideSessionId = '', returnBaseMessages = false): Promise { - const id = overrideSessionId ?? this.sessionId + const id = overrideSessionId ? overrideSessionId : this.sessionId const memoryVariables = await this.loadMemoryVariables({}, id) const baseMessages = memoryVariables[this.memoryKey] return returnBaseMessages ? baseMessages : convertBaseMessagetoIMessage(baseMessages) } async addChatMessages(msgArray: { text: string; type: MessageType }[], overrideSessionId = ''): Promise { - const id = overrideSessionId ?? this.sessionId + const id = overrideSessionId ? overrideSessionId : this.sessionId const input = msgArray.find((msg) => msg.type === 'userMessage') const output = msgArray.find((msg) => msg.type === 'apiMessage') const inputValues = { [this.inputKey ?? 'input']: input?.text } @@ -180,7 +180,7 @@ class ZepMemoryExtended extends ZepMemory implements MemoryMethods { } async clearChatMessages(overrideSessionId = ''): Promise { - const id = overrideSessionId ?? this.sessionId + const id = overrideSessionId ? overrideSessionId : this.sessionId await this.clear(id) } } From d7f9c0738151368b990ec24044528c51f4c7a036 Mon Sep 17 00:00:00 2001 From: Jared Tracy Date: Wed, 7 Feb 2024 22:07:12 -0600 Subject: [PATCH 19/39] return tableName, partiionKey, dynamoKey from initalizeDynamoDB --- .../nodes/memory/DynamoDb/DynamoDb.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/components/nodes/memory/DynamoDb/DynamoDb.ts b/packages/components/nodes/memory/DynamoDb/DynamoDb.ts index 864ff7c8..c2085b91 100644 --- a/packages/components/nodes/memory/DynamoDb/DynamoDb.ts +++ b/packages/components/nodes/memory/DynamoDb/DynamoDb.ts @@ -117,7 +117,10 @@ const initalizeDynamoDB = async (nodeData: INodeData, options: ICommonObject): P memoryKey: memoryKey ?? 'chat_history', chatHistory: dynamoDb, sessionId, - dynamodbClient: client + dynamodbClient: client, + tableName, + partitionKey, + dynamoKey: { [partitionKey]: { S: sessionId } } }) return memory } @@ -125,6 +128,9 @@ const initalizeDynamoDB = async (nodeData: INodeData, options: ICommonObject): P interface BufferMemoryExtendedInput { dynamodbClient: DynamoDBClient sessionId: string + tableName: string + partitionKey: string + dynamoKey: Record } interface DynamoDBSerializedChatMessage { @@ -143,10 +149,10 @@ interface DynamoDBSerializedChatMessage { class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { tableName = '' + partitionKey = '' + dynamoKey: Record sessionId = '' dynamodbClient: DynamoDBClient - dynamoKey = '' - partitionKey = '' constructor(fields: BufferMemoryInput & BufferMemoryExtendedInput) { super(fields) @@ -154,9 +160,9 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { this.dynamodbClient = fields.dynamodbClient // These fields are coming in on chatHistory, but should they be on the dynamodbClient instead? - this.partitionKey = (fields?.chatHistory as unknown as { partitionKey: string }).partitionKey - this.dynamoKey = (fields?.chatHistory as unknown as { dynamoKey: string }).dynamoKey - this.tableName = (fields?.chatHistory as unknown as { tableName: string }).tableName + this.tableName = fields.tableName + this.partitionKey = fields.partitionKey + this.dynamoKey = fields.dynamoKey } overrideDynamoKey(overrideSessionId = '') { From d0b1980482968b3cc4c165f391a28f81c00cf518 Mon Sep 17 00:00:00 2001 From: Jared Tracy Date: Wed, 7 Feb 2024 22:08:41 -0600 Subject: [PATCH 20/39] Removes prior comment --- packages/components/nodes/memory/DynamoDb/DynamoDb.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/components/nodes/memory/DynamoDb/DynamoDb.ts b/packages/components/nodes/memory/DynamoDb/DynamoDb.ts index c2085b91..02ecc31f 100644 --- a/packages/components/nodes/memory/DynamoDb/DynamoDb.ts +++ b/packages/components/nodes/memory/DynamoDb/DynamoDb.ts @@ -158,8 +158,6 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { super(fields) this.sessionId = fields.sessionId this.dynamodbClient = fields.dynamodbClient - - // These fields are coming in on chatHistory, but should they be on the dynamodbClient instead? this.tableName = fields.tableName this.partitionKey = fields.partitionKey this.dynamoKey = fields.dynamoKey From dd89af8a098e48ef42556593127ad6b4b4e0b560 Mon Sep 17 00:00:00 2001 From: Jared Tracy Date: Thu, 8 Feb 2024 09:04:46 -0600 Subject: [PATCH 21/39] refactor (this as any) usage --- .../nodes/memory/DynamoDb/DynamoDb.ts | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/components/nodes/memory/DynamoDb/DynamoDb.ts b/packages/components/nodes/memory/DynamoDb/DynamoDb.ts index 02ecc31f..22da396e 100644 --- a/packages/components/nodes/memory/DynamoDb/DynamoDb.ts +++ b/packages/components/nodes/memory/DynamoDb/DynamoDb.ts @@ -148,9 +148,10 @@ interface DynamoDBSerializedChatMessage { } class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { - tableName = '' - partitionKey = '' - dynamoKey: Record + private tableName = '' + private partitionKey = '' + private dynamoKey: Record + private messageAttributeName: string sessionId = '' dynamodbClient: DynamoDBClient @@ -221,9 +222,9 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { async getChatMessages(overrideSessionId = '', returnBaseMessages = false): Promise { if (!this.dynamodbClient) return [] - const dynamoKey = overrideSessionId ? this.overrideDynamoKey(overrideSessionId) : (this as any).dynamoKey + const dynamoKey = overrideSessionId ? this.overrideDynamoKey(overrideSessionId) : this.dynamoKey const tableName = this.tableName - const messageAttributeName = (this as any).messageAttributeName + const messageAttributeName = this.messageAttributeName const params: GetItemCommandInput = { TableName: tableName, @@ -248,9 +249,9 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { async addChatMessages(msgArray: { text: string; type: MessageType }[], overrideSessionId = ''): Promise { if (!this.dynamodbClient) return - const dynamoKey = overrideSessionId ? this.overrideDynamoKey(overrideSessionId) : (this as any).dynamoKey - const tableName = (this as any).tableName - const messageAttributeName = (this as any).messageAttributeName + const dynamoKey = overrideSessionId ? this.overrideDynamoKey(overrideSessionId) : this.dynamoKey + const tableName = this.tableName + const messageAttributeName = this.messageAttributeName const input = msgArray.find((msg) => msg.type === 'userMessage') const output = msgArray.find((msg) => msg.type === 'apiMessage') @@ -271,8 +272,8 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods { async clearChatMessages(overrideSessionId = ''): Promise { if (!this.dynamodbClient) return - const dynamoKey = overrideSessionId ? this.overrideDynamoKey(overrideSessionId) : (this as any).dynamoKey - const tableName = (this as any).tableName + const dynamoKey = overrideSessionId ? this.overrideDynamoKey(overrideSessionId) : this.dynamoKey + const tableName = this.tableName const params: DeleteItemCommandInput = { TableName: tableName, From e110a49a32a4423e7d0127bd1f31f6995f84cdf0 Mon Sep 17 00:00:00 2001 From: Darien Kindlund Date: Thu, 8 Feb 2024 10:46:30 -0500 Subject: [PATCH 22/39] Migrating all TLS/SSL settings into additionalConfig so that there is consistency in how every function connects with Postgres in the same manner. --- .../nodes/vectorstores/Postgres/Postgres.ts | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/packages/components/nodes/vectorstores/Postgres/Postgres.ts b/packages/components/nodes/vectorstores/Postgres/Postgres.ts index 375728e8..78e9cd75 100644 --- a/packages/components/nodes/vectorstores/Postgres/Postgres.ts +++ b/packages/components/nodes/vectorstores/Postgres/Postgres.ts @@ -60,13 +60,6 @@ class Postgres_VectorStores implements INode { name: 'database', type: 'string' }, - { - label: 'SSL Connection', - name: 'sslConnection', - type: 'boolean', - default: false, - optional: false - }, { label: 'Port', name: 'port', @@ -124,7 +117,6 @@ class Postgres_VectorStores implements INode { const docs = nodeData.inputs?.document as Document[] const embeddings = nodeData.inputs?.embeddings as Embeddings const additionalConfig = nodeData.inputs?.additionalConfig as string - const sslConnection = nodeData.inputs?.sslConnection as boolean let additionalConfiguration = {} if (additionalConfig) { @@ -143,7 +135,6 @@ class Postgres_VectorStores implements INode { username: user, password: password, database: nodeData.inputs?.database as string, - ssl: sslConnection } const args = { @@ -248,15 +239,7 @@ const similaritySearchVectorWithScore = async ( ORDER BY "_distance" ASC LIMIT $3;` - const poolOptions = { - host: postgresConnectionOptions.host, - port: postgresConnectionOptions.port, - user: postgresConnectionOptions.username, - password: postgresConnectionOptions.password, - database: postgresConnectionOptions.database, - ssl: postgresConnectionOptions.extra?.ssl - } - const pool = new Pool(poolOptions) + const pool = new Pool(postgresConnectionOptions) const conn = await pool.connect() const documents = await conn.query(queryString, [embeddingString, _filter, k]) From 9af4eaaa8c5a23e0421213bb9c82e49ff2bb2ee6 Mon Sep 17 00:00:00 2001 From: Darien Kindlund Date: Thu, 8 Feb 2024 10:53:33 -0500 Subject: [PATCH 23/39] Fixing linting issues. --- packages/components/nodes/vectorstores/Postgres/Postgres.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/nodes/vectorstores/Postgres/Postgres.ts b/packages/components/nodes/vectorstores/Postgres/Postgres.ts index 78e9cd75..5c5ef813 100644 --- a/packages/components/nodes/vectorstores/Postgres/Postgres.ts +++ b/packages/components/nodes/vectorstores/Postgres/Postgres.ts @@ -134,7 +134,7 @@ class Postgres_VectorStores implements INode { port: nodeData.inputs?.port as number, username: user, password: password, - database: nodeData.inputs?.database as string, + database: nodeData.inputs?.database as string } const args = { From 4a75396325d4bcba3aa589a5fc41e3912cbd3ee4 Mon Sep 17 00:00:00 2001 From: Darien Kindlund Date: Thu, 8 Feb 2024 11:26:45 -0500 Subject: [PATCH 24/39] So apparently TypeORMVectorStore requires the field 'username' while Pool expects it to be 'user'. Need to populate both to avoid error messages. --- packages/components/nodes/vectorstores/Postgres/Postgres.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/components/nodes/vectorstores/Postgres/Postgres.ts b/packages/components/nodes/vectorstores/Postgres/Postgres.ts index 5c5ef813..b3cc7918 100644 --- a/packages/components/nodes/vectorstores/Postgres/Postgres.ts +++ b/packages/components/nodes/vectorstores/Postgres/Postgres.ts @@ -189,7 +189,8 @@ class Postgres_VectorStores implements INode { type: 'postgres', host: nodeData.inputs?.host as string, port: nodeData.inputs?.port as number, - username: user, + username: user, // Required by TypeORMVectorStore + user: user, // Required by Pool in similaritySearchVectorWithScore password: password, database: nodeData.inputs?.database as string } From 907d5c7ef7a0124d6d4a3a44d33db521fcd5b49a Mon Sep 17 00:00:00 2001 From: Darien Kindlund Date: Thu, 8 Feb 2024 12:06:50 -0500 Subject: [PATCH 25/39] Bumping version since this will change might break legacy Postgres chatflows that used TLS/SSL. This will help users remind them to upgrade their corresponding nodes. --- packages/components/nodes/vectorstores/Postgres/Postgres.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/nodes/vectorstores/Postgres/Postgres.ts b/packages/components/nodes/vectorstores/Postgres/Postgres.ts index b3cc7918..be7784cc 100644 --- a/packages/components/nodes/vectorstores/Postgres/Postgres.ts +++ b/packages/components/nodes/vectorstores/Postgres/Postgres.ts @@ -24,7 +24,7 @@ class Postgres_VectorStores implements INode { constructor() { this.label = 'Postgres' this.name = 'postgres' - this.version = 2.0 + this.version = 3.0 this.type = 'Postgres' this.icon = 'postgres.svg' this.category = 'Vector Stores' From cf79176ca63fe47b570368a2caaadf8bf9ed4f50 Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Fri, 9 Feb 2024 12:00:55 +0800 Subject: [PATCH 26/39] add missing steps into rate limit msg --- packages/server/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index 99bae048..48f93249 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -184,7 +184,7 @@ export class App { this.app.get('/api/v1/ip', (request, response) => { response.send({ ip: request.ip, - msg: 'Check the returned IP address in the response. If it matches your current IP address ( which you can get by going to http://ip.nfriedly.com/ or https://api.ipify.org/ ), then the number of proxies is correct and the rate limiter should now work correctly. If not, increase the number of proxies by 1 until the IP address matches your own. Visit https://docs.flowiseai.com/configuration/rate-limit#rate-limit-setup-guide for more information.' + msg: 'Check returned IP address in the response. If it matches your current IP address ( which you can get by going to http://ip.nfriedly.com/ or https://api.ipify.org/ ), then the number of proxies is correct and the rate limiter should now work correctly. If not, increase the number of proxies by 1 and restart Cloud-Hosted Flowise until the IP address matches your own. Visit https://docs.flowiseai.com/configuration/rate-limit#cloud-hosted-rate-limit-setup-guide for more information.' }) }) From caf54bf31b2025d02283d357c1750a20c1ab8d49 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 9 Feb 2024 16:07:34 +0800 Subject: [PATCH 27/39] add document json output --- .../nodes/documentloaders/PlainText/PlainText.ts | 4 +++- .../nodes/documentloaders/Text/Text.ts | 4 +++- .../VectorStoreToDocument.ts | 2 ++ .../CohereRerankRetriever.ts | 4 +++- .../EmbeddingsFilterRetriever.ts | 4 +++- .../retrievers/HydeRetriever/HydeRetriever.ts | 4 +++- .../LLMFilterCompressionRetriever.ts | 4 +++- .../retrievers/RRFRetriever/RRFRetriever.ts | 4 +++- .../SimilarityThresholdRetriever.ts | 4 +++- .../marketplaces/chatflows/Claude LLM.json | 4 ++-- .../chatflows/Context Chat Engine.json | 8 ++++---- .../Conversational Retrieval QA Chain.json | 8 ++++---- .../server/marketplaces/chatflows/Local QnA.json | 8 ++++---- .../marketplaces/chatflows/Metadata Filter.json | 8 ++++---- .../chatflows/Multiple VectorDB.json | 16 ++++++++-------- packages/ui/src/utils/genericHelper.js | 3 +++ 16 files changed, 55 insertions(+), 34 deletions(-) diff --git a/packages/components/nodes/documentloaders/PlainText/PlainText.ts b/packages/components/nodes/documentloaders/PlainText/PlainText.ts index c2adceeb..c0c697a3 100644 --- a/packages/components/nodes/documentloaders/PlainText/PlainText.ts +++ b/packages/components/nodes/documentloaders/PlainText/PlainText.ts @@ -51,11 +51,13 @@ class PlainText_DocumentLoaders implements INode { { label: 'Document', name: 'document', - baseClasses: this.baseClasses + description: 'Array of document objects containing metadata and pageContent', + baseClasses: [...this.baseClasses, 'json'] }, { label: 'Text', name: 'text', + description: 'Concatenated string from pageContent of documents', baseClasses: ['string', 'json'] } ] diff --git a/packages/components/nodes/documentloaders/Text/Text.ts b/packages/components/nodes/documentloaders/Text/Text.ts index e41c5a9f..1eea709e 100644 --- a/packages/components/nodes/documentloaders/Text/Text.ts +++ b/packages/components/nodes/documentloaders/Text/Text.ts @@ -51,11 +51,13 @@ class Text_DocumentLoaders implements INode { { label: 'Document', name: 'document', - baseClasses: this.baseClasses + description: 'Array of document objects containing metadata and pageContent', + baseClasses: [...this.baseClasses, 'json'] }, { label: 'Text', name: 'text', + description: 'Concatenated string from pageContent of documents', baseClasses: ['string', 'json'] } ] diff --git a/packages/components/nodes/documentloaders/VectorStoreToDocument/VectorStoreToDocument.ts b/packages/components/nodes/documentloaders/VectorStoreToDocument/VectorStoreToDocument.ts index c087e000..27ef36f5 100644 --- a/packages/components/nodes/documentloaders/VectorStoreToDocument/VectorStoreToDocument.ts +++ b/packages/components/nodes/documentloaders/VectorStoreToDocument/VectorStoreToDocument.ts @@ -51,11 +51,13 @@ class VectorStoreToDocument_DocumentLoaders implements INode { { label: 'Document', name: 'document', + description: 'Array of document objects containing metadata and pageContent', baseClasses: [...this.baseClasses, 'json'] }, { label: 'Text', name: 'text', + description: 'Concatenated string from pageContent of documents', baseClasses: ['string', 'json'] } ] diff --git a/packages/components/nodes/retrievers/CohereRerankRetriever/CohereRerankRetriever.ts b/packages/components/nodes/retrievers/CohereRerankRetriever/CohereRerankRetriever.ts index 442fdc7a..5e92505e 100644 --- a/packages/components/nodes/retrievers/CohereRerankRetriever/CohereRerankRetriever.ts +++ b/packages/components/nodes/retrievers/CohereRerankRetriever/CohereRerankRetriever.ts @@ -94,11 +94,13 @@ class CohereRerankRetriever_Retrievers implements INode { { label: 'Document', name: 'document', - baseClasses: ['Document'] + description: 'Array of document objects containing metadata and pageContent', + baseClasses: ['Document', 'json'] }, { label: 'Text', name: 'text', + description: 'Concatenated string from pageContent of documents', baseClasses: ['string', 'json'] } ] diff --git a/packages/components/nodes/retrievers/EmbeddingsFilterRetriever/EmbeddingsFilterRetriever.ts b/packages/components/nodes/retrievers/EmbeddingsFilterRetriever/EmbeddingsFilterRetriever.ts index d1049fa4..16d40790 100644 --- a/packages/components/nodes/retrievers/EmbeddingsFilterRetriever/EmbeddingsFilterRetriever.ts +++ b/packages/components/nodes/retrievers/EmbeddingsFilterRetriever/EmbeddingsFilterRetriever.ts @@ -78,11 +78,13 @@ class EmbeddingsFilterRetriever_Retrievers implements INode { { label: 'Document', name: 'document', - baseClasses: ['Document'] + description: 'Array of document objects containing metadata and pageContent', + baseClasses: ['Document', 'json'] }, { label: 'Text', name: 'text', + description: 'Concatenated string from pageContent of documents', baseClasses: ['string', 'json'] } ] diff --git a/packages/components/nodes/retrievers/HydeRetriever/HydeRetriever.ts b/packages/components/nodes/retrievers/HydeRetriever/HydeRetriever.ts index 10fff764..a7cd9829 100644 --- a/packages/components/nodes/retrievers/HydeRetriever/HydeRetriever.ts +++ b/packages/components/nodes/retrievers/HydeRetriever/HydeRetriever.ts @@ -140,11 +140,13 @@ Passage:` { label: 'Document', name: 'document', - baseClasses: ['Document'] + description: 'Array of document objects containing metadata and pageContent', + baseClasses: ['Document', 'json'] }, { label: 'Text', name: 'text', + description: 'Concatenated string from pageContent of documents', baseClasses: ['string', 'json'] } ] diff --git a/packages/components/nodes/retrievers/LLMFilterRetriever/LLMFilterCompressionRetriever.ts b/packages/components/nodes/retrievers/LLMFilterRetriever/LLMFilterCompressionRetriever.ts index 6b710cf3..9bace712 100644 --- a/packages/components/nodes/retrievers/LLMFilterRetriever/LLMFilterCompressionRetriever.ts +++ b/packages/components/nodes/retrievers/LLMFilterRetriever/LLMFilterCompressionRetriever.ts @@ -58,11 +58,13 @@ class LLMFilterCompressionRetriever_Retrievers implements INode { { label: 'Document', name: 'document', - baseClasses: ['Document'] + description: 'Array of document objects containing metadata and pageContent', + baseClasses: ['Document', 'json'] }, { label: 'Text', name: 'text', + description: 'Concatenated string from pageContent of documents', baseClasses: ['string', 'json'] } ] diff --git a/packages/components/nodes/retrievers/RRFRetriever/RRFRetriever.ts b/packages/components/nodes/retrievers/RRFRetriever/RRFRetriever.ts index ed15ed24..9788f095 100644 --- a/packages/components/nodes/retrievers/RRFRetriever/RRFRetriever.ts +++ b/packages/components/nodes/retrievers/RRFRetriever/RRFRetriever.ts @@ -89,11 +89,13 @@ class RRFRetriever_Retrievers implements INode { { label: 'Document', name: 'document', - baseClasses: ['Document'] + description: 'Array of document objects containing metadata and pageContent', + baseClasses: ['Document', 'json'] }, { label: 'Text', name: 'text', + description: 'Concatenated string from pageContent of documents', baseClasses: ['string', 'json'] } ] diff --git a/packages/components/nodes/retrievers/SimilarityThresholdRetriever/SimilarityThresholdRetriever.ts b/packages/components/nodes/retrievers/SimilarityThresholdRetriever/SimilarityThresholdRetriever.ts index 5f5a9ed0..6a6976a5 100644 --- a/packages/components/nodes/retrievers/SimilarityThresholdRetriever/SimilarityThresholdRetriever.ts +++ b/packages/components/nodes/retrievers/SimilarityThresholdRetriever/SimilarityThresholdRetriever.ts @@ -74,11 +74,13 @@ class SimilarityThresholdRetriever_Retrievers implements INode { { label: 'Document', name: 'document', - baseClasses: ['Document'] + description: 'Array of document objects containing metadata and pageContent', + baseClasses: ['Document', 'json'] }, { label: 'Text', name: 'text', + description: 'Concatenated string from pageContent of documents', baseClasses: ['string', 'json'] } ] diff --git a/packages/server/marketplaces/chatflows/Claude LLM.json b/packages/server/marketplaces/chatflows/Claude LLM.json index a0fd4e1a..48be286d 100644 --- a/packages/server/marketplaces/chatflows/Claude LLM.json +++ b/packages/server/marketplaces/chatflows/Claude LLM.json @@ -441,10 +441,10 @@ "type": "options", "options": [ { - "id": "plainText_0-output-document-Document", + "id": "plainText_0-output-document-Document|json", "name": "document", "label": "Document", - "type": "Document" + "type": "Document | json" }, { "id": "plainText_0-output-text-string|json", diff --git a/packages/server/marketplaces/chatflows/Context Chat Engine.json b/packages/server/marketplaces/chatflows/Context Chat Engine.json index 15d3dade..3f1152f2 100644 --- a/packages/server/marketplaces/chatflows/Context Chat Engine.json +++ b/packages/server/marketplaces/chatflows/Context Chat Engine.json @@ -59,10 +59,10 @@ "type": "options", "options": [ { - "id": "textFile_0-output-document-Document", + "id": "textFile_0-output-document-Document|json", "name": "document", "label": "Document", - "type": "Document" + "type": "Document | json" }, { "id": "textFile_0-output-text-string|json", @@ -851,11 +851,11 @@ }, { "source": "textFile_0", - "sourceHandle": "textFile_0-output-document-Document", + "sourceHandle": "textFile_0-output-document-Document|json", "target": "pineconeLlamaIndex_0", "targetHandle": "pineconeLlamaIndex_0-input-document-Document", "type": "buttonedge", - "id": "textFile_0-textFile_0-output-document-Document-pineconeLlamaIndex_0-pineconeLlamaIndex_0-input-document-Document", + "id": "textFile_0-textFile_0-output-document-Document|json-pineconeLlamaIndex_0-pineconeLlamaIndex_0-input-document-Document", "data": { "label": "" } diff --git a/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json b/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json index e360141d..f76e89e6 100644 --- a/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json +++ b/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json @@ -235,10 +235,10 @@ "type": "options", "options": [ { - "id": "textFile_0-output-document-Document", + "id": "textFile_0-output-document-Document|json", "name": "document", "label": "Document", - "type": "Document" + "type": "Document | json" }, { "id": "textFile_0-output-text-string|json", @@ -732,11 +732,11 @@ }, { "source": "textFile_0", - "sourceHandle": "textFile_0-output-document-Document", + "sourceHandle": "textFile_0-output-document-Document|json", "target": "pinecone_0", "targetHandle": "pinecone_0-input-document-Document", "type": "buttonedge", - "id": "textFile_0-textFile_0-output-document-Document-pinecone_0-pinecone_0-input-document-Document", + "id": "textFile_0-textFile_0-output-document-Document|json-pinecone_0-pinecone_0-input-document-Document", "data": { "label": "" } diff --git a/packages/server/marketplaces/chatflows/Local QnA.json b/packages/server/marketplaces/chatflows/Local QnA.json index 2637f259..3e8b93f6 100644 --- a/packages/server/marketplaces/chatflows/Local QnA.json +++ b/packages/server/marketplaces/chatflows/Local QnA.json @@ -226,10 +226,10 @@ "type": "options", "options": [ { - "id": "textFile_0-output-document-Document", + "id": "textFile_0-output-document-Document|json", "name": "document", "label": "Document", - "type": "Document" + "type": "Document | json" }, { "id": "textFile_0-output-text-string|json", @@ -651,11 +651,11 @@ }, { "source": "textFile_0", - "sourceHandle": "textFile_0-output-document-Document", + "sourceHandle": "textFile_0-output-document-Document|json", "target": "faiss_0", "targetHandle": "faiss_0-input-document-Document", "type": "buttonedge", - "id": "textFile_0-textFile_0-output-document-Document-faiss_0-faiss_0-input-document-Document", + "id": "textFile_0-textFile_0-output-document-Document|json-faiss_0-faiss_0-input-document-Document", "data": { "label": "" } diff --git a/packages/server/marketplaces/chatflows/Metadata Filter.json b/packages/server/marketplaces/chatflows/Metadata Filter.json index 38ad9211..ed2efb9f 100644 --- a/packages/server/marketplaces/chatflows/Metadata Filter.json +++ b/packages/server/marketplaces/chatflows/Metadata Filter.json @@ -128,10 +128,10 @@ "type": "options", "options": [ { - "id": "textFile_0-output-document-Document", + "id": "textFile_0-output-document-Document|json", "name": "document", "label": "Document", - "type": "Document" + "type": "Document | json" }, { "id": "textFile_0-output-text-string|json", @@ -838,11 +838,11 @@ }, { "source": "textFile_0", - "sourceHandle": "textFile_0-output-document-Document", + "sourceHandle": "textFile_0-output-document-Document|json", "target": "pinecone_0", "targetHandle": "pinecone_0-input-document-Document", "type": "buttonedge", - "id": "textFile_0-textFile_0-output-document-Document-pinecone_0-pinecone_0-input-document-Document", + "id": "textFile_0-textFile_0-output-document-Document|json-pinecone_0-pinecone_0-input-document-Document", "data": { "label": "" } diff --git a/packages/server/marketplaces/chatflows/Multiple VectorDB.json b/packages/server/marketplaces/chatflows/Multiple VectorDB.json index e8141ad7..b76270e7 100644 --- a/packages/server/marketplaces/chatflows/Multiple VectorDB.json +++ b/packages/server/marketplaces/chatflows/Multiple VectorDB.json @@ -966,10 +966,10 @@ "type": "options", "options": [ { - "id": "plainText_0-output-document-Document", + "id": "plainText_0-output-document-Document|json", "name": "document", "label": "Document", - "type": "Document" + "type": "Document | json" }, { "id": "plainText_0-output-text-string|json", @@ -1503,10 +1503,10 @@ "type": "options", "options": [ { - "id": "plainText_1-output-document-Document", + "id": "plainText_1-output-document-Document|json", "name": "document", "label": "Document", - "type": "Document" + "type": "Document | json" }, { "id": "plainText_1-output-text-string|json", @@ -1723,11 +1723,11 @@ }, { "source": "plainText_0", - "sourceHandle": "plainText_0-output-document-Document", + "sourceHandle": "plainText_0-output-document-Document|json", "target": "redis_0", "targetHandle": "redis_0-input-document-Document", "type": "buttonedge", - "id": "plainText_0-plainText_0-output-document-Document-redis_0-redis_0-input-document-Document", + "id": "plainText_0-plainText_0-output-document-Document|json-redis_0-redis_0-input-document-Document", "data": { "label": "" } @@ -1778,11 +1778,11 @@ }, { "source": "plainText_1", - "sourceHandle": "plainText_1-output-document-Document", + "sourceHandle": "plainText_1-output-document-Document|json", "target": "faiss_0", "targetHandle": "faiss_0-input-document-Document", "type": "buttonedge", - "id": "plainText_1-plainText_1-output-document-Document-faiss_0-faiss_0-input-document-Document", + "id": "plainText_1-plainText_1-output-document-Document|json-faiss_0-faiss_0-input-document-Document", "data": { "label": "" } diff --git a/packages/ui/src/utils/genericHelper.js b/packages/ui/src/utils/genericHelper.js index eadbdb88..74dc9578 100644 --- a/packages/ui/src/utils/genericHelper.js +++ b/packages/ui/src/utils/genericHelper.js @@ -99,6 +99,7 @@ export const initNode = (nodeData, newNodeId) => { id: `${newNodeId}-output-${nodeData.outputs[j].name}-${baseClasses}`, name: nodeData.outputs[j].name, label: nodeData.outputs[j].label, + description: nodeData.outputs[j].description ?? '', type } options.push(newOutputOption) @@ -107,6 +108,7 @@ export const initNode = (nodeData, newNodeId) => { name: 'output', label: 'Output', type: 'options', + description: nodeData.outputs[0].description ?? '', options, default: nodeData.outputs[0].name } @@ -116,6 +118,7 @@ export const initNode = (nodeData, newNodeId) => { id: `${newNodeId}-output-${nodeData.name}-${nodeData.baseClasses.join('|')}`, name: nodeData.name, label: nodeData.type, + description: nodeData.description ?? '', type: nodeData.baseClasses.join(' | ') } outputAnchors.push(newOutput) From e3c899230c036bbaa817952c07e8960e8fbdf5e6 Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Sat, 10 Feb 2024 12:02:21 +0800 Subject: [PATCH 28/39] add FLOWISE_FILE_SIZE_LIMIT variable --- packages/server/.env.example | 1 + packages/server/src/index.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/server/.env.example b/packages/server/.env.example index ebc59cf3..a7a93345 100644 --- a/packages/server/.env.example +++ b/packages/server/.env.example @@ -20,6 +20,7 @@ PORT=3000 # FLOWISE_USERNAME=user # FLOWISE_PASSWORD=1234 # FLOWISE_SECRETKEY_OVERWRITE=myencryptionkey +# FLOWISE_FILE_SIZE_LIMIT=50mb # DEBUG=true # LOG_LEVEL=debug (error | warn | info | verbose | debug) # TOOL_FUNCTION_BUILTIN_DEP=crypto,fs diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index 48f93249..973ce1ea 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -120,8 +120,9 @@ export class App { async config(socketIO?: Server) { // Limit is needed to allow sending/receiving base64 encoded string - this.app.use(express.json({ limit: '50mb' })) - this.app.use(express.urlencoded({ limit: '50mb', extended: true })) + const flowise_file_size_limit = process.env.FLOWISE_FILE_SIZE_LIMIT ?? '50mb' + this.app.use(express.json({ limit: flowise_file_size_limit })) + this.app.use(express.urlencoded({ limit: flowise_file_size_limit, extended: true })) if (process.env.NUMBER_OF_PROXIES && parseInt(process.env.NUMBER_OF_PROXIES) > 0) this.app.set('trust proxy', parseInt(process.env.NUMBER_OF_PROXIES)) From 702b8c1aab8474e09373874657efb3c061b71ada Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Sat, 10 Feb 2024 12:12:32 +0800 Subject: [PATCH 29/39] add FLOWISE_FILE_SIZE_LIMIT into docker env --- docker/.env.example | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/.env.example b/docker/.env.example index a4beaf8a..84019299 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -21,6 +21,7 @@ LOG_PATH=/root/.flowise/logs # FLOWISE_USERNAME=user # FLOWISE_PASSWORD=1234 # FLOWISE_SECRETKEY_OVERWRITE=myencryptionkey +# FLOWISE_FILE_SIZE_LIMIT=50mb # DEBUG=true # LOG_LEVEL=debug (error | warn | info | verbose | debug) # TOOL_FUNCTION_BUILTIN_DEP=crypto,fs From a132f51727559c82fa157bcb37047cb727599b92 Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Sun, 11 Feb 2024 17:37:48 +0800 Subject: [PATCH 30/39] add more FLOWISE_FILE_SIZE_LIMIT --- CONTRIBUTING-ZH.md | 1 + CONTRIBUTING.md | 1 + docker/docker-compose.yml | 1 + packages/server/src/commands/start.ts | 4 ++++ 4 files changed, 7 insertions(+) diff --git a/CONTRIBUTING-ZH.md b/CONTRIBUTING-ZH.md index 7e35d194..e000da4f 100644 --- a/CONTRIBUTING-ZH.md +++ b/CONTRIBUTING-ZH.md @@ -123,6 +123,7 @@ Flowise 支持不同的环境变量来配置您的实例。您可以在 `package | PORT | Flowise 运行的 HTTP 端口 | 数字 | 3000 | | FLOWISE_USERNAME | 登录用户名 | 字符串 | | | FLOWISE_PASSWORD | 登录密码 | 字符串 | | +| FLOWISE_FILE_SIZE_LIMIT | 上传文件大小限制 | 字符串 | 50mb | | DEBUG | 打印组件的日志 | 布尔值 | | | LOG_PATH | 存储日志文件的位置 | 字符串 | `your-path/Flowise/logs` | | LOG_LEVEL | 日志的不同级别 | 枚举字符串: `error`, `info`, `verbose`, `debug` | `info` | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 25a27e84..fdeb848b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -127,6 +127,7 @@ Flowise support different environment variables to configure your instance. You | IFRAME_ORIGINS | The allowed origins for iframe src embedding | String | | | FLOWISE_USERNAME | Username to login | String | | | FLOWISE_PASSWORD | Password to login | String | | +| FLOWISE_FILE_SIZE_LIMIT | Upload File Size Limit | String | 50mb | | DEBUG | Print logs from components | Boolean | | | LOG_PATH | Location where log files are stored | String | `your-path/Flowise/logs` | | LOG_LEVEL | Different levels of logs | Enum String: `error`, `info`, `verbose`, `debug` | `info` | diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 71bcfcfb..4da945fe 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -10,6 +10,7 @@ services: - IFRAME_ORIGINS=${IFRAME_ORIGINS} - FLOWISE_USERNAME=${FLOWISE_USERNAME} - FLOWISE_PASSWORD=${FLOWISE_PASSWORD} + - FLOWISE_FILE_SIZE_LIMIT=${FLOWISE_FILE_SIZE_LIMIT} - DEBUG=${DEBUG} - DATABASE_PATH=${DATABASE_PATH} - DATABASE_TYPE=${DATABASE_TYPE} diff --git a/packages/server/src/commands/start.ts b/packages/server/src/commands/start.ts index dfb20766..a649dba6 100644 --- a/packages/server/src/commands/start.ts +++ b/packages/server/src/commands/start.ts @@ -18,6 +18,7 @@ export default class Start extends Command { static flags = { FLOWISE_USERNAME: Flags.string(), FLOWISE_PASSWORD: Flags.string(), + FLOWISE_FILE_SIZE_LIMIT: Flags.string(), PORT: Flags.string(), CORS_ORIGINS: Flags.string(), IFRAME_ORIGINS: Flags.string(), @@ -91,6 +92,9 @@ export default class Start extends Command { if (flags.FLOWISE_PASSWORD) process.env.FLOWISE_PASSWORD = flags.FLOWISE_PASSWORD if (flags.APIKEY_PATH) process.env.APIKEY_PATH = flags.APIKEY_PATH + //API Configuration + if (flags.FLOWISE_FILE_SIZE_LIMIT) process.env.FLOWISE_FILE_SIZE_LIMIT = flags.FLOWISE_FILE_SIZE_LIMIT + // Credentials if (flags.SECRETKEY_PATH) process.env.SECRETKEY_PATH = flags.SECRETKEY_PATH if (flags.FLOWISE_SECRETKEY_OVERWRITE) process.env.FLOWISE_SECRETKEY_OVERWRITE = flags.FLOWISE_SECRETKEY_OVERWRITE From 5471a4c9aa48068a7aecf6433dc7e7da6bd8d973 Mon Sep 17 00:00:00 2001 From: Ilango Date: Mon, 12 Feb 2024 12:01:19 +0530 Subject: [PATCH 31/39] Show error when relative links method is not set and allow 0 as limit value --- .../nodes/documentloaders/Cheerio/Cheerio.ts | 4 +- .../documentloaders/Playwright/Playwright.ts | 4 +- .../documentloaders/Puppeteer/Puppeteer.ts | 4 +- packages/server/src/index.ts | 4 ++ .../dialog/ManageScrapedLinksDialog.js | 50 +++++++++++++++++-- 5 files changed, 58 insertions(+), 8 deletions(-) diff --git a/packages/components/nodes/documentloaders/Cheerio/Cheerio.ts b/packages/components/nodes/documentloaders/Cheerio/Cheerio.ts index 6af1f9a9..48ae85bc 100644 --- a/packages/components/nodes/documentloaders/Cheerio/Cheerio.ts +++ b/packages/components/nodes/documentloaders/Cheerio/Cheerio.ts @@ -126,7 +126,9 @@ class Cheerio_DocumentLoaders implements INode { let docs = [] if (relativeLinksMethod) { if (process.env.DEBUG === 'true') options.logger.info(`Start ${relativeLinksMethod}`) - if (!limit) limit = 10 + // if limit is 0 we don't want it to default to 10 so we check explicitly for null or undefined + // so when limit is 0 we can fetch all the links + if (limit === null || limit === undefined) limit = 10 else if (limit < 0) throw new Error('Limit cannot be less than 0') const pages: string[] = selectedLinks && selectedLinks.length > 0 diff --git a/packages/components/nodes/documentloaders/Playwright/Playwright.ts b/packages/components/nodes/documentloaders/Playwright/Playwright.ts index 2ba60d0f..55fa9608 100644 --- a/packages/components/nodes/documentloaders/Playwright/Playwright.ts +++ b/packages/components/nodes/documentloaders/Playwright/Playwright.ts @@ -167,7 +167,9 @@ class Playwright_DocumentLoaders implements INode { let docs = [] if (relativeLinksMethod) { if (process.env.DEBUG === 'true') options.logger.info(`Start ${relativeLinksMethod}`) - if (!limit) limit = 10 + // if limit is 0 we don't want it to default to 10 so we check explicitly for null or undefined + // so when limit is 0 we can fetch all the links + if (limit === null || limit === undefined) limit = 10 else if (limit < 0) throw new Error('Limit cannot be less than 0') const pages: string[] = selectedLinks && selectedLinks.length > 0 diff --git a/packages/components/nodes/documentloaders/Puppeteer/Puppeteer.ts b/packages/components/nodes/documentloaders/Puppeteer/Puppeteer.ts index 1f8c8f3f..90b5a277 100644 --- a/packages/components/nodes/documentloaders/Puppeteer/Puppeteer.ts +++ b/packages/components/nodes/documentloaders/Puppeteer/Puppeteer.ts @@ -168,7 +168,9 @@ class Puppeteer_DocumentLoaders implements INode { let docs = [] if (relativeLinksMethod) { if (process.env.DEBUG === 'true') options.logger.info(`Start ${relativeLinksMethod}`) - if (!limit) limit = 10 + // if limit is 0 we don't want it to default to 10 so we check explicitly for null or undefined + // so when limit is 0 we can fetch all the links + if (limit === null || limit === undefined) limit = 10 else if (limit < 0) throw new Error('Limit cannot be less than 0') const pages: string[] = selectedLinks && selectedLinks.length > 0 diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index 7ceba556..b994ba62 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -1148,6 +1148,10 @@ export class App { this.app.get('/api/v1/fetch-links', async (req: Request, res: Response) => { const url = decodeURIComponent(req.query.url as string) const relativeLinksMethod = req.query.relativeLinksMethod as string + if (!relativeLinksMethod) { + return res.status(500).send('Please choose a Relative Links Method in Additional Parameters.') + } + const limit = parseInt(req.query.limit as string) if (process.env.DEBUG === 'true') console.info(`Start ${relativeLinksMethod}`) const links: string[] = relativeLinksMethod === 'webCrawl' ? await webCrawl(url, limit) : await xmlScrape(url, limit) diff --git a/packages/ui/src/ui-component/dialog/ManageScrapedLinksDialog.js b/packages/ui/src/ui-component/dialog/ManageScrapedLinksDialog.js index 9a846ce9..a4199504 100644 --- a/packages/ui/src/ui-component/dialog/ManageScrapedLinksDialog.js +++ b/packages/ui/src/ui-component/dialog/ManageScrapedLinksDialog.js @@ -16,7 +16,7 @@ import { Stack, Typography } from '@mui/material' -import { IconTrash } from '@tabler/icons' +import { IconTrash, IconX } from '@tabler/icons' import PerfectScrollbar from 'react-perfect-scrollbar' import { BackdropLoader } from 'ui-component/loading/BackdropLoader' @@ -24,12 +24,23 @@ import { StyledButton } from 'ui-component/button/StyledButton' import scraperApi from 'api/scraper' -import { HIDE_CANVAS_DIALOG, SHOW_CANVAS_DIALOG } from 'store/actions' +import useNotifier from 'utils/useNotifier' + +import { + HIDE_CANVAS_DIALOG, + SHOW_CANVAS_DIALOG, + enqueueSnackbar as enqueueSnackbarAction, + closeSnackbar as closeSnackbarAction +} from 'store/actions' const ManageScrapedLinksDialog = ({ show, dialogProps, onCancel, onSave }) => { const portalElement = document.getElementById('portal') const dispatch = useDispatch() + useNotifier() + const enqueueSnackbar = (...args) => dispatch(enqueueSnackbarAction(...args)) + const closeSnackbar = (...args) => dispatch(closeSnackbarAction(...args)) + const [loading, setLoading] = useState(false) const [selectedLinks, setSelectedLinks] = useState([]) const [url, setUrl] = useState('') @@ -53,9 +64,38 @@ const ManageScrapedLinksDialog = ({ show, dialogProps, onCancel, onSave }) => { const handleFetchLinks = async () => { setLoading(true) - const fetchLinksResp = await scraperApi.fetchLinks(url, dialogProps.relativeLinksMethod, dialogProps.limit) - if (fetchLinksResp.data) { - setSelectedLinks(fetchLinksResp.data.links) + try { + const fetchLinksResp = await scraperApi.fetchLinks(url, dialogProps.relativeLinksMethod, dialogProps.limit) + if (fetchLinksResp.data) { + setSelectedLinks(fetchLinksResp.data.links) + enqueueSnackbar({ + message: 'Successfully fetched links', + options: { + key: new Date().getTime() + Math.random(), + variant: 'success', + action: (key) => ( + + ) + } + }) + } + } catch (error) { + const errorData = error.response.data || `${error.response.status}: ${error.response.statusText}` + enqueueSnackbar({ + message: errorData, + options: { + key: new Date().getTime() + Math.random(), + variant: 'error', + persist: true, + action: (key) => ( + + ) + } + }) } setLoading(false) } From 55c2a8612b9065a1ee5d2cbafb0dfb34fed53710 Mon Sep 17 00:00:00 2001 From: Jared Tracy Date: Mon, 12 Feb 2024 20:12:54 -0600 Subject: [PATCH 32/39] fixes bug where querying by chatId results in no records previous logic for where clause of memoryType checked for existence of chatId and would query for memoryType is null This where clause logic results in an empty result for any request to the endpoint that filters by chatId --- packages/server/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index 07797f32..a6566a5b 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -1453,7 +1453,7 @@ export class App { chatflowid, chatType, chatId, - memoryType: memoryType ?? (chatId ? IsNull() : undefined), + memoryType: memoryType ?? undefined, sessionId: sessionId ?? undefined, createdDate: toDate && fromDate ? Between(fromDate, toDate) : undefined }, From a6abd593a62c743f1c2949e9b012b7017aff6e37 Mon Sep 17 00:00:00 2001 From: Jared Tracy Date: Mon, 12 Feb 2024 20:53:40 -0600 Subject: [PATCH 33/39] Allows query chatmessage API endpoint by messageId This will be useful when the exact message is required by another system. --- packages/server/src/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index 07797f32..284c88d6 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -511,6 +511,7 @@ export class App { const chatId = req.query?.chatId as string | undefined const memoryType = req.query?.memoryType as string | undefined const sessionId = req.query?.sessionId as string | undefined + const messageId = req.query?.messageId as string | undefined const startDate = req.query?.startDate as string | undefined const endDate = req.query?.endDate as string | undefined let chatTypeFilter = req.query?.chatType as chatType | undefined @@ -538,7 +539,8 @@ export class App { memoryType, sessionId, startDate, - endDate + endDate, + messageId ) return res.json(chatmessages) }) @@ -1440,7 +1442,8 @@ export class App { memoryType?: string, sessionId?: string, startDate?: string, - endDate?: string + endDate?: string, + messageId?: string ): Promise { let fromDate if (startDate) fromDate = new Date(startDate) @@ -1455,7 +1458,8 @@ export class App { chatId, memoryType: memoryType ?? (chatId ? IsNull() : undefined), sessionId: sessionId ?? undefined, - createdDate: toDate && fromDate ? Between(fromDate, toDate) : undefined + createdDate: toDate && fromDate ? Between(fromDate, toDate) : undefined, + id: messageId ?? undefined }, order: { createdDate: sortOrder === 'DESC' ? 'DESC' : 'ASC' From 6de1e8aceccccf86e2bf78a13d7c533ea2a0679b Mon Sep 17 00:00:00 2001 From: Jared Tracy Date: Tue, 13 Feb 2024 10:44:05 -0600 Subject: [PATCH 34/39] handles invalid values for startDate, endDate also sets time window to beginning of the date or end of the date. This will be helpful with the timezone gap between the server (usually UTC) and the client (localized timezone) Ideal date solution to consider for the future would be to adjust the timestamp query based upon the server timezone setup. This becomes particularly helpful when the client is filtering by the end date but they are in a timezone behind UTC after the UTC has advanced to the next date. For example, being in Pacific time and querying for the current date after 4PM will result in not finding records that have been created after 4PM Pacific b/c the server timestamp (in UTC) will be the next calendar date. --- packages/server/src/index.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index a6566a5b..d3453320 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -1442,11 +1442,20 @@ export class App { startDate?: string, endDate?: string ): Promise { + const setDateToStartOrEndOfDay = (dateTimeStr: string, setHours: 'start' | 'end') => { + const date = new Date(dateTimeStr) + if (isNaN(date.getTime())) { + return undefined + } + setHours === 'start' ? date.setHours(0, 0, 0, 0) : date.setHours(23, 59, 59, 999) + return date + } + let fromDate - if (startDate) fromDate = new Date(startDate) + if (startDate) fromDate = setDateToStartOrEndOfDay(startDate, 'start') let toDate - if (endDate) toDate = new Date(endDate) + if (endDate) toDate = setDateToStartOrEndOfDay(endDate, 'end') return await this.AppDataSource.getRepository(ChatMessage).find({ where: { From 4d7c7d6ef5df5db53576ddd9e80bbffbd6acd952 Mon Sep 17 00:00:00 2001 From: Jared Tracy Date: Tue, 13 Feb 2024 11:11:53 -0600 Subject: [PATCH 35/39] Changes getMessage date logic from Between to >= and <= to fix issue if invalid startDate is passed in also cleans up imports from typeorm lib --- packages/server/src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index d3453320..f401bbc1 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -10,7 +10,7 @@ import logger from './utils/logger' import { expressRequestLogger } from './utils/logger' import { v4 as uuidv4 } from 'uuid' import OpenAI from 'openai' -import { Between, IsNull, FindOptionsWhere } from 'typeorm' +import { FindOptionsWhere, MoreThanOrEqual, LessThanOrEqual } from 'typeorm' import { IChatFlow, IncomingInput, @@ -1464,7 +1464,8 @@ export class App { chatId, memoryType: memoryType ?? undefined, sessionId: sessionId ?? undefined, - createdDate: toDate && fromDate ? Between(fromDate, toDate) : undefined + ...(fromDate && { createdDate: MoreThanOrEqual(fromDate) }), + ...(toDate && { createdDate: LessThanOrEqual(toDate) }) }, order: { createdDate: sortOrder === 'DESC' ? 'DESC' : 'ASC' From 778e024c02f5fd292546b3416f9edc77dbba558b Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 14 Feb 2024 18:40:35 +0800 Subject: [PATCH 36/39] update query engine tool --- .../nodes/engine/QueryEngine/QueryEngine.ts | 94 ++- .../SubQuestionQueryEngine.ts | 160 ++-- .../tools/QueryEngineTool/QueryEngineTool.ts | 21 +- .../marketplaces/chatflows/Query Engine.json | 8 +- .../chatflows/SubQuestion Query Engine.json | 766 ++++++++++-------- 5 files changed, 581 insertions(+), 468 deletions(-) diff --git a/packages/components/nodes/engine/QueryEngine/QueryEngine.ts b/packages/components/nodes/engine/QueryEngine/QueryEngine.ts index bd6e040d..8ced3fcc 100644 --- a/packages/components/nodes/engine/QueryEngine/QueryEngine.ts +++ b/packages/components/nodes/engine/QueryEngine/QueryEngine.ts @@ -28,12 +28,12 @@ class QueryEngine_LlamaIndex implements INode { constructor(fields?: { sessionId?: string }) { this.label = 'Query Engine' this.name = 'queryEngine' - this.version = 1.0 + this.version = 2.0 this.type = 'QueryEngine' this.icon = 'query-engine.png' this.category = 'Engine' this.description = 'Simple query engine built to answer question over your data, without memory' - this.baseClasses = [this.type] + this.baseClasses = [this.type, 'BaseQueryEngine'] this.tags = ['LlamaIndex'] this.inputs = [ { @@ -59,52 +59,13 @@ class QueryEngine_LlamaIndex implements INode { this.sessionId = fields?.sessionId } - async init(): Promise { - return null + async init(nodeData: INodeData): Promise { + return prepareEngine(nodeData) } async run(nodeData: INodeData, input: string, options: ICommonObject): Promise { const returnSourceDocuments = nodeData.inputs?.returnSourceDocuments as boolean - const vectorStoreRetriever = nodeData.inputs?.vectorStoreRetriever - const responseSynthesizerObj = nodeData.inputs?.responseSynthesizer - - let queryEngine = new RetrieverQueryEngine(vectorStoreRetriever) - - if (responseSynthesizerObj) { - if (responseSynthesizerObj.type === 'TreeSummarize') { - const responseSynthesizer = new ResponseSynthesizer({ - responseBuilder: new TreeSummarize(vectorStoreRetriever.serviceContext, responseSynthesizerObj.textQAPromptTemplate), - serviceContext: vectorStoreRetriever.serviceContext - }) - queryEngine = new RetrieverQueryEngine(vectorStoreRetriever, responseSynthesizer) - } else if (responseSynthesizerObj.type === 'CompactAndRefine') { - const responseSynthesizer = new ResponseSynthesizer({ - responseBuilder: new CompactAndRefine( - vectorStoreRetriever.serviceContext, - responseSynthesizerObj.textQAPromptTemplate, - responseSynthesizerObj.refinePromptTemplate - ), - serviceContext: vectorStoreRetriever.serviceContext - }) - queryEngine = new RetrieverQueryEngine(vectorStoreRetriever, responseSynthesizer) - } else if (responseSynthesizerObj.type === 'Refine') { - const responseSynthesizer = new ResponseSynthesizer({ - responseBuilder: new Refine( - vectorStoreRetriever.serviceContext, - responseSynthesizerObj.textQAPromptTemplate, - responseSynthesizerObj.refinePromptTemplate - ), - serviceContext: vectorStoreRetriever.serviceContext - }) - queryEngine = new RetrieverQueryEngine(vectorStoreRetriever, responseSynthesizer) - } else if (responseSynthesizerObj.type === 'SimpleResponseBuilder') { - const responseSynthesizer = new ResponseSynthesizer({ - responseBuilder: new SimpleResponseBuilder(vectorStoreRetriever.serviceContext), - serviceContext: vectorStoreRetriever.serviceContext - }) - queryEngine = new RetrieverQueryEngine(vectorStoreRetriever, responseSynthesizer) - } - } + const queryEngine = prepareEngine(nodeData) let text = '' let sourceDocuments: ICommonObject[] = [] @@ -140,4 +101,49 @@ class QueryEngine_LlamaIndex implements INode { } } +const prepareEngine = (nodeData: INodeData) => { + const vectorStoreRetriever = nodeData.inputs?.vectorStoreRetriever + const responseSynthesizerObj = nodeData.inputs?.responseSynthesizer + + let queryEngine = new RetrieverQueryEngine(vectorStoreRetriever) + + if (responseSynthesizerObj) { + if (responseSynthesizerObj.type === 'TreeSummarize') { + const responseSynthesizer = new ResponseSynthesizer({ + responseBuilder: new TreeSummarize(vectorStoreRetriever.serviceContext, responseSynthesizerObj.textQAPromptTemplate), + serviceContext: vectorStoreRetriever.serviceContext + }) + queryEngine = new RetrieverQueryEngine(vectorStoreRetriever, responseSynthesizer) + } else if (responseSynthesizerObj.type === 'CompactAndRefine') { + const responseSynthesizer = new ResponseSynthesizer({ + responseBuilder: new CompactAndRefine( + vectorStoreRetriever.serviceContext, + responseSynthesizerObj.textQAPromptTemplate, + responseSynthesizerObj.refinePromptTemplate + ), + serviceContext: vectorStoreRetriever.serviceContext + }) + queryEngine = new RetrieverQueryEngine(vectorStoreRetriever, responseSynthesizer) + } else if (responseSynthesizerObj.type === 'Refine') { + const responseSynthesizer = new ResponseSynthesizer({ + responseBuilder: new Refine( + vectorStoreRetriever.serviceContext, + responseSynthesizerObj.textQAPromptTemplate, + responseSynthesizerObj.refinePromptTemplate + ), + serviceContext: vectorStoreRetriever.serviceContext + }) + queryEngine = new RetrieverQueryEngine(vectorStoreRetriever, responseSynthesizer) + } else if (responseSynthesizerObj.type === 'SimpleResponseBuilder') { + const responseSynthesizer = new ResponseSynthesizer({ + responseBuilder: new SimpleResponseBuilder(vectorStoreRetriever.serviceContext), + serviceContext: vectorStoreRetriever.serviceContext + }) + queryEngine = new RetrieverQueryEngine(vectorStoreRetriever, responseSynthesizer) + } + } + + return queryEngine +} + module.exports = { nodeClass: QueryEngine_LlamaIndex } diff --git a/packages/components/nodes/engine/SubQuestionQueryEngine/SubQuestionQueryEngine.ts b/packages/components/nodes/engine/SubQuestionQueryEngine/SubQuestionQueryEngine.ts index a872c0a2..a2a1e029 100644 --- a/packages/components/nodes/engine/SubQuestionQueryEngine/SubQuestionQueryEngine.ts +++ b/packages/components/nodes/engine/SubQuestionQueryEngine/SubQuestionQueryEngine.ts @@ -33,13 +33,13 @@ class SubQuestionQueryEngine_LlamaIndex implements INode { constructor(fields?: { sessionId?: string }) { this.label = 'Sub Question Query Engine' this.name = 'subQuestionQueryEngine' - this.version = 1.0 + this.version = 2.0 this.type = 'SubQuestionQueryEngine' this.icon = 'subQueryEngine.svg' this.category = 'Engine' this.description = 'Breaks complex query into sub questions for each relevant data source, then gather all the intermediate reponses and synthesizes a final response' - this.baseClasses = [this.type] + this.baseClasses = [this.type, 'BaseQueryEngine'] this.tags = ['LlamaIndex'] this.inputs = [ { @@ -76,85 +76,13 @@ class SubQuestionQueryEngine_LlamaIndex implements INode { this.sessionId = fields?.sessionId } - async init(): Promise { - return null + async init(nodeData: INodeData): Promise { + return prepareEngine(nodeData) } async run(nodeData: INodeData, input: string, options: ICommonObject): Promise { const returnSourceDocuments = nodeData.inputs?.returnSourceDocuments as boolean - const embeddings = nodeData.inputs?.embeddings as BaseEmbedding - const model = nodeData.inputs?.model - - const serviceContext = serviceContextFromDefaults({ - llm: model, - embedModel: embeddings - }) - - let queryEngineTools = nodeData.inputs?.queryEngineTools as QueryEngineTool[] - queryEngineTools = flatten(queryEngineTools) - - let queryEngine = SubQuestionQueryEngine.fromDefaults({ - serviceContext, - queryEngineTools, - questionGen: new LLMQuestionGenerator({ llm: model }) - }) - - const responseSynthesizerObj = nodeData.inputs?.responseSynthesizer - if (responseSynthesizerObj) { - if (responseSynthesizerObj.type === 'TreeSummarize') { - const responseSynthesizer = new ResponseSynthesizer({ - responseBuilder: new TreeSummarize(serviceContext, responseSynthesizerObj.textQAPromptTemplate), - serviceContext - }) - queryEngine = SubQuestionQueryEngine.fromDefaults({ - responseSynthesizer, - serviceContext, - queryEngineTools, - questionGen: new LLMQuestionGenerator({ llm: model }) - }) - } else if (responseSynthesizerObj.type === 'CompactAndRefine') { - const responseSynthesizer = new ResponseSynthesizer({ - responseBuilder: new CompactAndRefine( - serviceContext, - responseSynthesizerObj.textQAPromptTemplate, - responseSynthesizerObj.refinePromptTemplate - ), - serviceContext - }) - queryEngine = SubQuestionQueryEngine.fromDefaults({ - responseSynthesizer, - serviceContext, - queryEngineTools, - questionGen: new LLMQuestionGenerator({ llm: model }) - }) - } else if (responseSynthesizerObj.type === 'Refine') { - const responseSynthesizer = new ResponseSynthesizer({ - responseBuilder: new Refine( - serviceContext, - responseSynthesizerObj.textQAPromptTemplate, - responseSynthesizerObj.refinePromptTemplate - ), - serviceContext - }) - queryEngine = SubQuestionQueryEngine.fromDefaults({ - responseSynthesizer, - serviceContext, - queryEngineTools, - questionGen: new LLMQuestionGenerator({ llm: model }) - }) - } else if (responseSynthesizerObj.type === 'SimpleResponseBuilder') { - const responseSynthesizer = new ResponseSynthesizer({ - responseBuilder: new SimpleResponseBuilder(serviceContext), - serviceContext - }) - queryEngine = SubQuestionQueryEngine.fromDefaults({ - responseSynthesizer, - serviceContext, - queryEngineTools, - questionGen: new LLMQuestionGenerator({ llm: model }) - }) - } - } + const queryEngine = prepareEngine(nodeData) let text = '' let sourceDocuments: ICommonObject[] = [] @@ -190,4 +118,82 @@ class SubQuestionQueryEngine_LlamaIndex implements INode { } } +const prepareEngine = (nodeData: INodeData) => { + const embeddings = nodeData.inputs?.embeddings as BaseEmbedding + const model = nodeData.inputs?.model + + const serviceContext = serviceContextFromDefaults({ + llm: model, + embedModel: embeddings + }) + + let queryEngineTools = nodeData.inputs?.queryEngineTools as QueryEngineTool[] + queryEngineTools = flatten(queryEngineTools) + + let queryEngine = SubQuestionQueryEngine.fromDefaults({ + serviceContext, + queryEngineTools, + questionGen: new LLMQuestionGenerator({ llm: model }) + }) + + const responseSynthesizerObj = nodeData.inputs?.responseSynthesizer + if (responseSynthesizerObj) { + if (responseSynthesizerObj.type === 'TreeSummarize') { + const responseSynthesizer = new ResponseSynthesizer({ + responseBuilder: new TreeSummarize(serviceContext, responseSynthesizerObj.textQAPromptTemplate), + serviceContext + }) + queryEngine = SubQuestionQueryEngine.fromDefaults({ + responseSynthesizer, + serviceContext, + queryEngineTools, + questionGen: new LLMQuestionGenerator({ llm: model }) + }) + } else if (responseSynthesizerObj.type === 'CompactAndRefine') { + const responseSynthesizer = new ResponseSynthesizer({ + responseBuilder: new CompactAndRefine( + serviceContext, + responseSynthesizerObj.textQAPromptTemplate, + responseSynthesizerObj.refinePromptTemplate + ), + serviceContext + }) + queryEngine = SubQuestionQueryEngine.fromDefaults({ + responseSynthesizer, + serviceContext, + queryEngineTools, + questionGen: new LLMQuestionGenerator({ llm: model }) + }) + } else if (responseSynthesizerObj.type === 'Refine') { + const responseSynthesizer = new ResponseSynthesizer({ + responseBuilder: new Refine( + serviceContext, + responseSynthesizerObj.textQAPromptTemplate, + responseSynthesizerObj.refinePromptTemplate + ), + serviceContext + }) + queryEngine = SubQuestionQueryEngine.fromDefaults({ + responseSynthesizer, + serviceContext, + queryEngineTools, + questionGen: new LLMQuestionGenerator({ llm: model }) + }) + } else if (responseSynthesizerObj.type === 'SimpleResponseBuilder') { + const responseSynthesizer = new ResponseSynthesizer({ + responseBuilder: new SimpleResponseBuilder(serviceContext), + serviceContext + }) + queryEngine = SubQuestionQueryEngine.fromDefaults({ + responseSynthesizer, + serviceContext, + queryEngineTools, + questionGen: new LLMQuestionGenerator({ llm: model }) + }) + } + } + + return queryEngine +} + module.exports = { nodeClass: SubQuestionQueryEngine_LlamaIndex } diff --git a/packages/components/nodes/tools/QueryEngineTool/QueryEngineTool.ts b/packages/components/nodes/tools/QueryEngineTool/QueryEngineTool.ts index 163eff76..cc25fa6f 100644 --- a/packages/components/nodes/tools/QueryEngineTool/QueryEngineTool.ts +++ b/packages/components/nodes/tools/QueryEngineTool/QueryEngineTool.ts @@ -1,5 +1,5 @@ import { INode, INodeData, INodeParams } from '../../../src/Interface' -import { VectorStoreIndex } from 'llamaindex' +import { BaseQueryEngine } from 'llamaindex' class QueryEngine_Tools implements INode { label: string @@ -16,7 +16,7 @@ class QueryEngine_Tools implements INode { constructor() { this.label = 'QueryEngine Tool' this.name = 'queryEngineToolLlamaIndex' - this.version = 1.0 + this.version = 2.0 this.type = 'QueryEngineTool' this.icon = 'queryEngineTool.svg' this.category = 'Tools' @@ -25,9 +25,9 @@ class QueryEngine_Tools implements INode { this.baseClasses = [this.type] this.inputs = [ { - label: 'Vector Store Index', - name: 'vectorStoreIndex', - type: 'VectorStoreIndex' + label: 'Base QueryEngine', + name: 'baseQueryEngine', + type: 'BaseQueryEngine' }, { label: 'Tool Name', @@ -45,20 +45,15 @@ class QueryEngine_Tools implements INode { } async init(nodeData: INodeData): Promise { - const vectorStoreIndex = nodeData.inputs?.vectorStoreIndex as VectorStoreIndex + const baseQueryEngine = nodeData.inputs?.baseQueryEngine as BaseQueryEngine const toolName = nodeData.inputs?.toolName as string const toolDesc = nodeData.inputs?.toolDesc as string const queryEngineTool = { - queryEngine: vectorStoreIndex.asQueryEngine({ - preFilters: { - ...(vectorStoreIndex as any).metadatafilter - } - }), + queryEngine: baseQueryEngine, metadata: { name: toolName, description: toolDesc - }, - vectorStoreIndex + } } return queryEngineTool diff --git a/packages/server/marketplaces/chatflows/Query Engine.json b/packages/server/marketplaces/chatflows/Query Engine.json index b3a3c292..63bbabfe 100644 --- a/packages/server/marketplaces/chatflows/Query Engine.json +++ b/packages/server/marketplaces/chatflows/Query Engine.json @@ -16,10 +16,10 @@ "data": { "id": "queryEngine_0", "label": "Query Engine", - "version": 1, + "version": 2, "name": "queryEngine", "type": "QueryEngine", - "baseClasses": ["QueryEngine"], + "baseClasses": ["QueryEngine", "BaseQueryEngine"], "tags": ["LlamaIndex"], "category": "Engine", "description": "Simple query engine built to answer question over your data, without memory", @@ -55,10 +55,10 @@ }, "outputAnchors": [ { - "id": "queryEngine_0-output-queryEngine-QueryEngine", + "id": "queryEngine_0-output-queryEngine-QueryEngine|BaseQueryEngine", "name": "queryEngine", "label": "QueryEngine", - "type": "QueryEngine" + "type": "QueryEngine | BaseQueryEngine" } ], "outputs": {}, diff --git a/packages/server/marketplaces/chatflows/SubQuestion Query Engine.json b/packages/server/marketplaces/chatflows/SubQuestion Query Engine.json index 620712c4..f8f6f430 100644 --- a/packages/server/marketplaces/chatflows/SubQuestion Query Engine.json +++ b/packages/server/marketplaces/chatflows/SubQuestion Query Engine.json @@ -9,8 +9,8 @@ "height": 749, "id": "compactrefineLlamaIndex_0", "position": { - "x": -1214.7329938486841, - "y": 56.52482754447425 + "x": -443.9012456561584, + "y": 826.6100190232154 }, "type": "customNode", "data": { @@ -63,8 +63,8 @@ }, "selected": false, "positionAbsolute": { - "x": -1214.7329938486841, - "y": 56.52482754447425 + "x": -443.9012456561584, + "y": 826.6100190232154 }, "dragging": false }, @@ -73,8 +73,8 @@ "height": 611, "id": "pineconeLlamaIndex_0", "position": { - "x": 37.23548045607484, - "y": -119.7364648743818 + "x": 35.45798119088212, + "y": -132.1789597307308 }, "type": "customNode", "data": { @@ -183,14 +183,14 @@ } ], "outputs": { - "output": "vectorStore" + "output": "retriever" }, "selected": false }, "selected": false, "positionAbsolute": { - "x": 37.23548045607484, - "y": -119.7364648743818 + "x": 35.45798119088212, + "y": -132.1789597307308 }, "dragging": false }, @@ -405,79 +405,13 @@ "y": -127.15143353229783 } }, - { - "width": 300, - "height": 511, - "id": "queryEngineToolLlamaIndex_0", - "position": { - "x": 460.37559236135905, - "y": -565.6224030941121 - }, - "type": "customNode", - "data": { - "id": "queryEngineToolLlamaIndex_0", - "label": "QueryEngine Tool", - "version": 1, - "name": "queryEngineToolLlamaIndex", - "type": "QueryEngineTool", - "baseClasses": ["QueryEngineTool"], - "tags": ["LlamaIndex"], - "category": "Tools", - "description": "Execute actions using ChatGPT Plugin Url", - "inputParams": [ - { - "label": "Tool Name", - "name": "toolName", - "type": "string", - "description": "Tool name must be small capital letter with underscore. Ex: my_tool", - "id": "queryEngineToolLlamaIndex_0-input-toolName-string" - }, - { - "label": "Tool Description", - "name": "toolDesc", - "type": "string", - "rows": 4, - "id": "queryEngineToolLlamaIndex_0-input-toolDesc-string" - } - ], - "inputAnchors": [ - { - "label": "Vector Store Index", - "name": "vectorStoreIndex", - "type": "VectorStoreIndex", - "id": "queryEngineToolLlamaIndex_0-input-vectorStoreIndex-VectorStoreIndex" - } - ], - "inputs": { - "vectorStoreIndex": "{{pineconeLlamaIndex_1.data.instance}}", - "toolName": "apple_tool", - "toolDesc": "A SEC Form 10K filing describing the financials of Apple Inc (APPL) for the 2022 time period." - }, - "outputAnchors": [ - { - "id": "queryEngineToolLlamaIndex_0-output-queryEngineToolLlamaIndex-QueryEngineTool", - "name": "queryEngineToolLlamaIndex", - "label": "QueryEngineTool", - "type": "QueryEngineTool" - } - ], - "outputs": {}, - "selected": false - }, - "selected": false, - "positionAbsolute": { - "x": 460.37559236135905, - "y": -565.6224030941121 - }, - "dragging": false - }, { "width": 300, "height": 611, "id": "pineconeLlamaIndex_1", "position": { - "x": 42.17855025460784, - "y": -839.8824444107056 + "x": 43.95604951980056, + "y": -783.0024679245387 }, "type": "customNode", "data": { @@ -586,162 +520,14 @@ } ], "outputs": { - "output": "vectorStore" + "output": "retriever" }, "selected": false }, "selected": false, "positionAbsolute": { - "x": 42.17855025460784, - "y": -839.8824444107056 - }, - "dragging": false - }, - { - "width": 300, - "height": 511, - "id": "queryEngineToolLlamaIndex_1", - "position": { - "x": 462.16721384216123, - "y": -17.750065363429798 - }, - "type": "customNode", - "data": { - "id": "queryEngineToolLlamaIndex_1", - "label": "QueryEngine Tool", - "version": 1, - "name": "queryEngineToolLlamaIndex", - "type": "QueryEngineTool", - "baseClasses": ["QueryEngineTool"], - "tags": ["LlamaIndex"], - "category": "Tools", - "description": "Execute actions using ChatGPT Plugin Url", - "inputParams": [ - { - "label": "Tool Name", - "name": "toolName", - "type": "string", - "description": "Tool name must be small capital letter with underscore. Ex: my_tool", - "id": "queryEngineToolLlamaIndex_1-input-toolName-string" - }, - { - "label": "Tool Description", - "name": "toolDesc", - "type": "string", - "rows": 4, - "id": "queryEngineToolLlamaIndex_1-input-toolDesc-string" - } - ], - "inputAnchors": [ - { - "label": "Vector Store Index", - "name": "vectorStoreIndex", - "type": "VectorStoreIndex", - "id": "queryEngineToolLlamaIndex_1-input-vectorStoreIndex-VectorStoreIndex" - } - ], - "inputs": { - "vectorStoreIndex": "{{pineconeLlamaIndex_0.data.instance}}", - "toolName": "tesla_tool", - "toolDesc": "A SEC Form 10K filing describing the financials of Tesla Inc (TSLA) for the 2022 time period." - }, - "outputAnchors": [ - { - "id": "queryEngineToolLlamaIndex_1-output-queryEngineToolLlamaIndex-QueryEngineTool", - "name": "queryEngineToolLlamaIndex", - "label": "QueryEngineTool", - "type": "QueryEngineTool" - } - ], - "outputs": {}, - "selected": false - }, - "selected": false, - "positionAbsolute": { - "x": 462.16721384216123, - "y": -17.750065363429798 - }, - "dragging": false - }, - { - "width": 300, - "height": 484, - "id": "subQuestionQueryEngine_0", - "position": { - "x": 982.7583030231563, - "y": 349.50858200305896 - }, - "type": "customNode", - "data": { - "id": "subQuestionQueryEngine_0", - "label": "Sub Question Query Engine", - "version": 1, - "name": "subQuestionQueryEngine", - "type": "SubQuestionQueryEngine", - "baseClasses": ["SubQuestionQueryEngine"], - "tags": ["LlamaIndex"], - "category": "Engine", - "description": "Simple query engine built to answer question over your data, without memory", - "inputParams": [ - { - "label": "Return Source Documents", - "name": "returnSourceDocuments", - "type": "boolean", - "optional": true, - "id": "subQuestionQueryEngine_0-input-returnSourceDocuments-boolean" - } - ], - "inputAnchors": [ - { - "label": "QueryEngine Tools", - "name": "queryEngineTools", - "type": "QueryEngineTool", - "list": true, - "id": "subQuestionQueryEngine_0-input-queryEngineTools-QueryEngineTool" - }, - { - "label": "Chat Model", - "name": "model", - "type": "BaseChatModel_LlamaIndex", - "id": "subQuestionQueryEngine_0-input-model-BaseChatModel_LlamaIndex" - }, - { - "label": "Embeddings", - "name": "embeddings", - "type": "BaseEmbedding_LlamaIndex", - "id": "subQuestionQueryEngine_0-input-embeddings-BaseEmbedding_LlamaIndex" - }, - { - "label": "Response Synthesizer", - "name": "responseSynthesizer", - "type": "ResponseSynthesizer", - "description": "ResponseSynthesizer is responsible for sending the query, nodes, and prompt templates to the LLM to generate a response. See more", - "optional": true, - "id": "subQuestionQueryEngine_0-input-responseSynthesizer-ResponseSynthesizer" - } - ], - "inputs": { - "queryEngineTools": ["{{queryEngineToolLlamaIndex_1.data.instance}}", "{{queryEngineToolLlamaIndex_0.data.instance}}"], - "model": "{{chatOpenAI_LlamaIndex_1.data.instance}}", - "embeddings": "{{openAIEmbedding_LlamaIndex_1.data.instance}}", - "responseSynthesizer": "{{compactrefineLlamaIndex_0.data.instance}}", - "returnSourceDocuments": true - }, - "outputAnchors": [ - { - "id": "subQuestionQueryEngine_0-output-subQuestionQueryEngine-SubQuestionQueryEngine", - "name": "subQuestionQueryEngine", - "label": "SubQuestionQueryEngine", - "type": "SubQuestionQueryEngine" - } - ], - "outputs": {}, - "selected": false - }, - "selected": false, - "positionAbsolute": { - "x": 982.7583030231563, - "y": 349.50858200305896 + "x": 43.95604951980056, + "y": -783.0024679245387 }, "dragging": false }, @@ -750,8 +536,8 @@ "height": 529, "id": "chatOpenAI_LlamaIndex_1", "position": { - "x": -846.9087470244615, - "y": 23.446501495097493 + "x": -446.80851289432655, + "y": 246.8790997755625 }, "type": "customNode", "data": { @@ -884,8 +670,8 @@ }, "selected": false, "positionAbsolute": { - "x": -846.9087470244615, - "y": 23.446501495097493 + "x": -446.80851289432655, + "y": 246.8790997755625 }, "dragging": false }, @@ -894,8 +680,8 @@ "height": 334, "id": "openAIEmbedding_LlamaIndex_1", "position": { - "x": -437.3136244622061, - "y": 329.99986619821175 + "x": -37.812177549447284, + "y": 577.9112529482311 }, "type": "customNode", "data": { @@ -952,17 +738,370 @@ "selected": false, "dragging": false, "positionAbsolute": { - "x": -437.3136244622061, - "y": 329.99986619821175 + "x": -37.812177549447284, + "y": 577.9112529482311 } }, + { + "width": 300, + "height": 382, + "id": "queryEngine_0", + "position": { + "x": 416.2466817793368, + "y": -600.1335182096643 + }, + "type": "customNode", + "data": { + "id": "queryEngine_0", + "label": "Query Engine", + "version": 2, + "name": "queryEngine", + "type": "QueryEngine", + "baseClasses": ["QueryEngine", "BaseQueryEngine"], + "tags": ["LlamaIndex"], + "category": "Engine", + "description": "Simple query engine built to answer question over your data, without memory", + "inputParams": [ + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true, + "id": "queryEngine_0-input-returnSourceDocuments-boolean" + } + ], + "inputAnchors": [ + { + "label": "Vector Store Retriever", + "name": "vectorStoreRetriever", + "type": "VectorIndexRetriever", + "id": "queryEngine_0-input-vectorStoreRetriever-VectorIndexRetriever" + }, + { + "label": "Response Synthesizer", + "name": "responseSynthesizer", + "type": "ResponseSynthesizer", + "description": "ResponseSynthesizer is responsible for sending the query, nodes, and prompt templates to the LLM to generate a response. See more", + "optional": true, + "id": "queryEngine_0-input-responseSynthesizer-ResponseSynthesizer" + } + ], + "inputs": { + "vectorStoreRetriever": "{{pineconeLlamaIndex_1.data.instance}}", + "responseSynthesizer": "", + "returnSourceDocuments": "" + }, + "outputAnchors": [ + { + "id": "queryEngine_0-output-queryEngine-QueryEngine|BaseQueryEngine", + "name": "queryEngine", + "label": "QueryEngine", + "description": "Simple query engine built to answer question over your data, without memory", + "type": "QueryEngine | BaseQueryEngine" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 416.2466817793368, + "y": -600.1335182096643 + }, + "dragging": false + }, + { + "width": 300, + "height": 511, + "id": "queryEngineToolLlamaIndex_2", + "position": { + "x": 766.9839000102993, + "y": -654.6926410455919 + }, + "type": "customNode", + "data": { + "id": "queryEngineToolLlamaIndex_2", + "label": "QueryEngine Tool", + "version": 2, + "name": "queryEngineToolLlamaIndex", + "type": "QueryEngineTool", + "baseClasses": ["QueryEngineTool"], + "tags": ["LlamaIndex"], + "category": "Tools", + "description": "Tool used to invoke query engine", + "inputParams": [ + { + "label": "Tool Name", + "name": "toolName", + "type": "string", + "description": "Tool name must be small capital letter with underscore. Ex: my_tool", + "id": "queryEngineToolLlamaIndex_2-input-toolName-string" + }, + { + "label": "Tool Description", + "name": "toolDesc", + "type": "string", + "rows": 4, + "id": "queryEngineToolLlamaIndex_2-input-toolDesc-string" + } + ], + "inputAnchors": [ + { + "label": "Base QueryEngine", + "name": "baseQueryEngine", + "type": "BaseQueryEngine", + "id": "queryEngineToolLlamaIndex_2-input-baseQueryEngine-BaseQueryEngine" + } + ], + "inputs": { + "baseQueryEngine": "{{queryEngine_0.data.instance}}", + "toolName": "apple_tool", + "toolDesc": "A SEC Form 10K filing describing the financials of Apple Inc (APPL) for the 2022 time period." + }, + "outputAnchors": [ + { + "id": "queryEngineToolLlamaIndex_2-output-queryEngineToolLlamaIndex-QueryEngineTool", + "name": "queryEngineToolLlamaIndex", + "label": "QueryEngineTool", + "description": "Tool used to invoke query engine", + "type": "QueryEngineTool" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 766.9839000102993, + "y": -654.6926410455919 + }, + "dragging": false + }, + { + "width": 300, + "height": 511, + "id": "queryEngineToolLlamaIndex_1", + "position": { + "x": 771.5434180813253, + "y": -109.03650423344013 + }, + "type": "customNode", + "data": { + "id": "queryEngineToolLlamaIndex_1", + "label": "QueryEngine Tool", + "version": 2, + "name": "queryEngineToolLlamaIndex", + "type": "QueryEngineTool", + "baseClasses": ["QueryEngineTool"], + "tags": ["LlamaIndex"], + "category": "Tools", + "description": "Tool used to invoke query engine", + "inputParams": [ + { + "label": "Tool Name", + "name": "toolName", + "type": "string", + "description": "Tool name must be small capital letter with underscore. Ex: my_tool", + "id": "queryEngineToolLlamaIndex_1-input-toolName-string" + }, + { + "label": "Tool Description", + "name": "toolDesc", + "type": "string", + "rows": 4, + "id": "queryEngineToolLlamaIndex_1-input-toolDesc-string" + } + ], + "inputAnchors": [ + { + "label": "Base QueryEngine", + "name": "baseQueryEngine", + "type": "BaseQueryEngine", + "id": "queryEngineToolLlamaIndex_1-input-baseQueryEngine-BaseQueryEngine" + } + ], + "inputs": { + "baseQueryEngine": "{{queryEngine_1.data.instance}}", + "toolName": "tesla_tool", + "toolDesc": "A SEC Form 10K filing describing the financials of Tesla Inc (TSLA) for the 2022 time period." + }, + "outputAnchors": [ + { + "id": "queryEngineToolLlamaIndex_1-output-queryEngineToolLlamaIndex-QueryEngineTool", + "name": "queryEngineToolLlamaIndex", + "label": "QueryEngineTool", + "description": "Tool used to invoke query engine", + "type": "QueryEngineTool" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 771.5434180813253, + "y": -109.03650423344013 + }, + "dragging": false + }, + { + "width": 300, + "height": 382, + "id": "queryEngine_1", + "position": { + "x": 411.8632262885343, + "y": -68.91392354277994 + }, + "type": "customNode", + "data": { + "id": "queryEngine_1", + "label": "Query Engine", + "version": 2, + "name": "queryEngine", + "type": "QueryEngine", + "baseClasses": ["QueryEngine", "BaseQueryEngine"], + "tags": ["LlamaIndex"], + "category": "Engine", + "description": "Simple query engine built to answer question over your data, without memory", + "inputParams": [ + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true, + "id": "queryEngine_1-input-returnSourceDocuments-boolean" + } + ], + "inputAnchors": [ + { + "label": "Vector Store Retriever", + "name": "vectorStoreRetriever", + "type": "VectorIndexRetriever", + "id": "queryEngine_1-input-vectorStoreRetriever-VectorIndexRetriever" + }, + { + "label": "Response Synthesizer", + "name": "responseSynthesizer", + "type": "ResponseSynthesizer", + "description": "ResponseSynthesizer is responsible for sending the query, nodes, and prompt templates to the LLM to generate a response. See more", + "optional": true, + "id": "queryEngine_1-input-responseSynthesizer-ResponseSynthesizer" + } + ], + "inputs": { + "vectorStoreRetriever": "{{pineconeLlamaIndex_0.data.instance}}", + "responseSynthesizer": "", + "returnSourceDocuments": "" + }, + "outputAnchors": [ + { + "id": "queryEngine_1-output-queryEngine-QueryEngine|BaseQueryEngine", + "name": "queryEngine", + "label": "QueryEngine", + "description": "Simple query engine built to answer question over your data, without memory", + "type": "QueryEngine | BaseQueryEngine" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 411.8632262885343, + "y": -68.91392354277994 + }, + "dragging": false + }, + { + "width": 300, + "height": 484, + "id": "subQuestionQueryEngine_0", + "position": { + "x": 1204.489328490966, + "y": 347.2090726754211 + }, + "type": "customNode", + "data": { + "id": "subQuestionQueryEngine_0", + "label": "Sub Question Query Engine", + "version": 2, + "name": "subQuestionQueryEngine", + "type": "SubQuestionQueryEngine", + "baseClasses": ["SubQuestionQueryEngine", "BaseQueryEngine"], + "tags": ["LlamaIndex"], + "category": "Engine", + "description": "Breaks complex query into sub questions for each relevant data source, then gather all the intermediate reponses and synthesizes a final response", + "inputParams": [ + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true, + "id": "subQuestionQueryEngine_0-input-returnSourceDocuments-boolean" + } + ], + "inputAnchors": [ + { + "label": "QueryEngine Tools", + "name": "queryEngineTools", + "type": "QueryEngineTool", + "list": true, + "id": "subQuestionQueryEngine_0-input-queryEngineTools-QueryEngineTool" + }, + { + "label": "Chat Model", + "name": "model", + "type": "BaseChatModel_LlamaIndex", + "id": "subQuestionQueryEngine_0-input-model-BaseChatModel_LlamaIndex" + }, + { + "label": "Embeddings", + "name": "embeddings", + "type": "BaseEmbedding_LlamaIndex", + "id": "subQuestionQueryEngine_0-input-embeddings-BaseEmbedding_LlamaIndex" + }, + { + "label": "Response Synthesizer", + "name": "responseSynthesizer", + "type": "ResponseSynthesizer", + "description": "ResponseSynthesizer is responsible for sending the query, nodes, and prompt templates to the LLM to generate a response. See more", + "optional": true, + "id": "subQuestionQueryEngine_0-input-responseSynthesizer-ResponseSynthesizer" + } + ], + "inputs": { + "queryEngineTools": ["{{queryEngineToolLlamaIndex_2.data.instance}}", "{{queryEngineToolLlamaIndex_1.data.instance}}"], + "model": "{{chatOpenAI_LlamaIndex_1.data.instance}}", + "embeddings": "{{openAIEmbedding_LlamaIndex_1.data.instance}}", + "responseSynthesizer": "{{compactrefineLlamaIndex_0.data.instance}}", + "returnSourceDocuments": true + }, + "outputAnchors": [ + { + "id": "subQuestionQueryEngine_0-output-subQuestionQueryEngine-SubQuestionQueryEngine|BaseQueryEngine", + "name": "subQuestionQueryEngine", + "label": "SubQuestionQueryEngine", + "description": "Breaks complex query into sub questions for each relevant data source, then gather all the intermediate reponses and synthesizes a final response", + "type": "SubQuestionQueryEngine | BaseQueryEngine" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 1204.489328490966, + "y": 347.2090726754211 + }, + "dragging": false + }, { "width": 300, "height": 82, "id": "stickyNote_0", "position": { - "x": 35.90892935132143, - "y": -936.1282632923861 + "x": 1208.1786832265154, + "y": 238.26647262900994 }, "type": "stickyNote", "data": { @@ -987,13 +1126,14 @@ ], "inputAnchors": [], "inputs": { - "note": "Query previously upserted documents with corresponding metadata key value pair - \n{ source: \"apple\"}" + "note": "Break questions into subqueries, then retrieve corresponding context using queryengine tools" }, "outputAnchors": [ { "id": "stickyNote_0-output-stickyNote-StickyNote", "name": "stickyNote", "label": "StickyNote", + "description": "Add a sticky note", "type": "StickyNote" } ], @@ -1002,8 +1142,8 @@ }, "selected": false, "positionAbsolute": { - "x": 35.90892935132143, - "y": -936.1282632923861 + "x": 1208.1786832265154, + "y": 238.26647262900994 }, "dragging": false }, @@ -1012,8 +1152,8 @@ "height": 82, "id": "stickyNote_1", "position": { - "x": 37.74909394815296, - "y": -215.17456133022054 + "x": 416.8958270395809, + "y": -179.9680840754678 }, "type": "stickyNote", "data": { @@ -1038,13 +1178,14 @@ ], "inputAnchors": [], "inputs": { - "note": "Query previously upserted documents with corresponding metadata key value pair - \n{ source: \"tesla\"}" + "note": "Query previously upserted documents with corresponding metadata key value pair - \n{ source: \"\"}" }, "outputAnchors": [ { "id": "stickyNote_1-output-stickyNote-StickyNote", "name": "stickyNote", "label": "StickyNote", + "description": "Add a sticky note", "type": "StickyNote" } ], @@ -1053,59 +1194,8 @@ }, "selected": false, "positionAbsolute": { - "x": 37.74909394815296, - "y": -215.17456133022054 - }, - "dragging": false - }, - { - "width": 300, - "height": 163, - "id": "stickyNote_2", - "position": { - "x": 984.9543031068163, - "y": 171.04264459503852 - }, - "type": "stickyNote", - "data": { - "id": "stickyNote_2", - "label": "Sticky Note", - "version": 1, - "name": "stickyNote", - "type": "StickyNote", - "baseClasses": ["StickyNote"], - "category": "Utilities", - "description": "Add a sticky note", - "inputParams": [ - { - "label": "", - "name": "note", - "type": "string", - "rows": 1, - "placeholder": "Type something here", - "optional": true, - "id": "stickyNote_2-input-note-string" - } - ], - "inputAnchors": [], - "inputs": { - "note": "Break questions into subqueries, then retrieve corresponding context using queryengine tool.\n\nThis implementation does not contains memory, we can use OpenAI Agent to function call this flow" - }, - "outputAnchors": [ - { - "id": "stickyNote_2-output-stickyNote-StickyNote", - "name": "stickyNote", - "label": "StickyNote", - "type": "StickyNote" - } - ], - "outputs": {}, - "selected": false - }, - "selected": false, - "positionAbsolute": { - "x": 984.9543031068163, - "y": 171.04264459503852 + "x": 416.8958270395809, + "y": -179.9680840754678 }, "dragging": false } @@ -1128,20 +1218,60 @@ "id": "openAIEmbedding_LlamaIndex_0-openAIEmbedding_LlamaIndex_0-output-openAIEmbedding_LlamaIndex-OpenAIEmbedding|BaseEmbedding_LlamaIndex|BaseEmbedding-pineconeLlamaIndex_1-pineconeLlamaIndex_1-input-embeddings-BaseEmbedding_LlamaIndex" }, { - "source": "pineconeLlamaIndex_1", - "sourceHandle": "pineconeLlamaIndex_1-output-vectorStore-Pinecone|VectorStoreIndex", - "target": "queryEngineToolLlamaIndex_0", - "targetHandle": "queryEngineToolLlamaIndex_0-input-vectorStoreIndex-VectorStoreIndex", + "source": "openAIEmbedding_LlamaIndex_0", + "sourceHandle": "openAIEmbedding_LlamaIndex_0-output-openAIEmbedding_LlamaIndex-OpenAIEmbedding|BaseEmbedding_LlamaIndex|BaseEmbedding", + "target": "pineconeLlamaIndex_0", + "targetHandle": "pineconeLlamaIndex_0-input-embeddings-BaseEmbedding_LlamaIndex", "type": "buttonedge", - "id": "pineconeLlamaIndex_1-pineconeLlamaIndex_1-output-vectorStore-Pinecone|VectorStoreIndex-queryEngineToolLlamaIndex_0-queryEngineToolLlamaIndex_0-input-vectorStoreIndex-VectorStoreIndex" + "id": "openAIEmbedding_LlamaIndex_0-openAIEmbedding_LlamaIndex_0-output-openAIEmbedding_LlamaIndex-OpenAIEmbedding|BaseEmbedding_LlamaIndex|BaseEmbedding-pineconeLlamaIndex_0-pineconeLlamaIndex_0-input-embeddings-BaseEmbedding_LlamaIndex" + }, + { + "source": "chatOpenAI_LlamaIndex_0", + "sourceHandle": "chatOpenAI_LlamaIndex_0-output-chatOpenAI_LlamaIndex-ChatOpenAI|BaseChatModel_LlamaIndex|BaseLLM", + "target": "pineconeLlamaIndex_0", + "targetHandle": "pineconeLlamaIndex_0-input-model-BaseChatModel_LlamaIndex", + "type": "buttonedge", + "id": "chatOpenAI_LlamaIndex_0-chatOpenAI_LlamaIndex_0-output-chatOpenAI_LlamaIndex-ChatOpenAI|BaseChatModel_LlamaIndex|BaseLLM-pineconeLlamaIndex_0-pineconeLlamaIndex_0-input-model-BaseChatModel_LlamaIndex" + }, + { + "source": "pineconeLlamaIndex_1", + "sourceHandle": "pineconeLlamaIndex_1-output-retriever-Pinecone|VectorIndexRetriever", + "target": "queryEngine_0", + "targetHandle": "queryEngine_0-input-vectorStoreRetriever-VectorIndexRetriever", + "type": "buttonedge", + "id": "pineconeLlamaIndex_1-pineconeLlamaIndex_1-output-retriever-Pinecone|VectorIndexRetriever-queryEngine_0-queryEngine_0-input-vectorStoreRetriever-VectorIndexRetriever" + }, + { + "source": "queryEngine_0", + "sourceHandle": "queryEngine_0-output-queryEngine-QueryEngine|BaseQueryEngine", + "target": "queryEngineToolLlamaIndex_2", + "targetHandle": "queryEngineToolLlamaIndex_2-input-baseQueryEngine-BaseQueryEngine", + "type": "buttonedge", + "id": "queryEngine_0-queryEngine_0-output-queryEngine-QueryEngine|BaseQueryEngine-queryEngineToolLlamaIndex_2-queryEngineToolLlamaIndex_2-input-baseQueryEngine-BaseQueryEngine" }, { "source": "pineconeLlamaIndex_0", - "sourceHandle": "pineconeLlamaIndex_0-output-vectorStore-Pinecone|VectorStoreIndex", - "target": "queryEngineToolLlamaIndex_1", - "targetHandle": "queryEngineToolLlamaIndex_1-input-vectorStoreIndex-VectorStoreIndex", + "sourceHandle": "pineconeLlamaIndex_0-output-retriever-Pinecone|VectorIndexRetriever", + "target": "queryEngine_1", + "targetHandle": "queryEngine_1-input-vectorStoreRetriever-VectorIndexRetriever", "type": "buttonedge", - "id": "pineconeLlamaIndex_0-pineconeLlamaIndex_0-output-vectorStore-Pinecone|VectorStoreIndex-queryEngineToolLlamaIndex_1-queryEngineToolLlamaIndex_1-input-vectorStoreIndex-VectorStoreIndex" + "id": "pineconeLlamaIndex_0-pineconeLlamaIndex_0-output-retriever-Pinecone|VectorIndexRetriever-queryEngine_1-queryEngine_1-input-vectorStoreRetriever-VectorIndexRetriever" + }, + { + "source": "queryEngine_1", + "sourceHandle": "queryEngine_1-output-queryEngine-QueryEngine|BaseQueryEngine", + "target": "queryEngineToolLlamaIndex_1", + "targetHandle": "queryEngineToolLlamaIndex_1-input-baseQueryEngine-BaseQueryEngine", + "type": "buttonedge", + "id": "queryEngine_1-queryEngine_1-output-queryEngine-QueryEngine|BaseQueryEngine-queryEngineToolLlamaIndex_1-queryEngineToolLlamaIndex_1-input-baseQueryEngine-BaseQueryEngine" + }, + { + "source": "queryEngineToolLlamaIndex_2", + "sourceHandle": "queryEngineToolLlamaIndex_2-output-queryEngineToolLlamaIndex-QueryEngineTool", + "target": "subQuestionQueryEngine_0", + "targetHandle": "subQuestionQueryEngine_0-input-queryEngineTools-QueryEngineTool", + "type": "buttonedge", + "id": "queryEngineToolLlamaIndex_2-queryEngineToolLlamaIndex_2-output-queryEngineToolLlamaIndex-QueryEngineTool-subQuestionQueryEngine_0-subQuestionQueryEngine_0-input-queryEngineTools-QueryEngineTool" }, { "source": "queryEngineToolLlamaIndex_1", @@ -1151,14 +1281,6 @@ "type": "buttonedge", "id": "queryEngineToolLlamaIndex_1-queryEngineToolLlamaIndex_1-output-queryEngineToolLlamaIndex-QueryEngineTool-subQuestionQueryEngine_0-subQuestionQueryEngine_0-input-queryEngineTools-QueryEngineTool" }, - { - "source": "queryEngineToolLlamaIndex_0", - "sourceHandle": "queryEngineToolLlamaIndex_0-output-queryEngineToolLlamaIndex-QueryEngineTool", - "target": "subQuestionQueryEngine_0", - "targetHandle": "subQuestionQueryEngine_0-input-queryEngineTools-QueryEngineTool", - "type": "buttonedge", - "id": "queryEngineToolLlamaIndex_0-queryEngineToolLlamaIndex_0-output-queryEngineToolLlamaIndex-QueryEngineTool-subQuestionQueryEngine_0-subQuestionQueryEngine_0-input-queryEngineTools-QueryEngineTool" - }, { "source": "chatOpenAI_LlamaIndex_1", "sourceHandle": "chatOpenAI_LlamaIndex_1-output-chatOpenAI_LlamaIndex-ChatOpenAI|BaseChatModel_LlamaIndex|BaseLLM", @@ -1182,22 +1304,6 @@ "targetHandle": "subQuestionQueryEngine_0-input-responseSynthesizer-ResponseSynthesizer", "type": "buttonedge", "id": "compactrefineLlamaIndex_0-compactrefineLlamaIndex_0-output-compactrefineLlamaIndex-CompactRefine|ResponseSynthesizer-subQuestionQueryEngine_0-subQuestionQueryEngine_0-input-responseSynthesizer-ResponseSynthesizer" - }, - { - "source": "openAIEmbedding_LlamaIndex_0", - "sourceHandle": "openAIEmbedding_LlamaIndex_0-output-openAIEmbedding_LlamaIndex-OpenAIEmbedding|BaseEmbedding_LlamaIndex|BaseEmbedding", - "target": "pineconeLlamaIndex_0", - "targetHandle": "pineconeLlamaIndex_0-input-embeddings-BaseEmbedding_LlamaIndex", - "type": "buttonedge", - "id": "openAIEmbedding_LlamaIndex_0-openAIEmbedding_LlamaIndex_0-output-openAIEmbedding_LlamaIndex-OpenAIEmbedding|BaseEmbedding_LlamaIndex|BaseEmbedding-pineconeLlamaIndex_0-pineconeLlamaIndex_0-input-embeddings-BaseEmbedding_LlamaIndex" - }, - { - "source": "chatOpenAI_LlamaIndex_0", - "sourceHandle": "chatOpenAI_LlamaIndex_0-output-chatOpenAI_LlamaIndex-ChatOpenAI|BaseChatModel_LlamaIndex|BaseLLM", - "target": "pineconeLlamaIndex_0", - "targetHandle": "pineconeLlamaIndex_0-input-model-BaseChatModel_LlamaIndex", - "type": "buttonedge", - "id": "chatOpenAI_LlamaIndex_0-chatOpenAI_LlamaIndex_0-output-chatOpenAI_LlamaIndex-ChatOpenAI|BaseChatModel_LlamaIndex|BaseLLM-pineconeLlamaIndex_0-pineconeLlamaIndex_0-input-model-BaseChatModel_LlamaIndex" } ] } From 342adff8cb551c0166c75a6b10d66e7832dcef95 Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Fri, 16 Feb 2024 20:20:17 +0800 Subject: [PATCH 37/39] fix weird error --- packages/components/nodes/tools/CustomTool/core.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/components/nodes/tools/CustomTool/core.ts b/packages/components/nodes/tools/CustomTool/core.ts index 19be88f1..baaddb42 100644 --- a/packages/components/nodes/tools/CustomTool/core.ts +++ b/packages/components/nodes/tools/CustomTool/core.ts @@ -100,6 +100,7 @@ export class DynamicStructuredTool< return result } + // @ts-ignore protected async _call( arg: z.output, _?: CallbackManagerForToolRun, From a035940d1d8e0e1680729755302db7422799f8c0 Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Sat, 17 Feb 2024 20:25:20 +0800 Subject: [PATCH 38/39] add gpt-4-1106-vision-preview into ChatOpenAI node --- packages/components/nodes/chatmodels/ChatOpenAI/ChatOpenAI.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/components/nodes/chatmodels/ChatOpenAI/ChatOpenAI.ts b/packages/components/nodes/chatmodels/ChatOpenAI/ChatOpenAI.ts index a0d0bd6e..d50c0012 100644 --- a/packages/components/nodes/chatmodels/ChatOpenAI/ChatOpenAI.ts +++ b/packages/components/nodes/chatmodels/ChatOpenAI/ChatOpenAI.ts @@ -59,6 +59,10 @@ class ChatOpenAI_ChatModels implements INode { label: 'gpt-4-1106-preview', name: 'gpt-4-1106-preview' }, + { + label: 'gpt-4-1106-vision-preview', + name: 'gpt-4-1106-vision-preview' + }, { label: 'gpt-4-vision-preview', name: 'gpt-4-vision-preview' From dd64bd028bae1a992ef979f0c5fa01725840a8e5 Mon Sep 17 00:00:00 2001 From: chungyau97 Date: Sat, 17 Feb 2024 21:11:27 +0800 Subject: [PATCH 39/39] add gpt-4-1106-vision-preview into ChatOpenAI marketplace --- .../chatflows/API Agent OpenAI.json | 16 +++++++++++++ .../marketplaces/chatflows/API Agent.json | 24 +++++++++++++++++++ .../Advanced Structured Output Parser.json | 4 ++++ .../marketplaces/chatflows/Antonym.json | 8 +++++++ .../marketplaces/chatflows/AutoGPT.json | 8 +++++++ .../marketplaces/chatflows/BabyAGI.json | 8 +++++++ .../marketplaces/chatflows/CSV Agent.json | 8 +++++++ .../chatflows/Chat with a Podcast.json | 8 +++++++ .../marketplaces/chatflows/ChatGPTPlugin.json | 8 +++++++ .../chatflows/Conversational Agent.json | 8 +++++++ .../Conversational Retrieval Agent.json | 8 +++++++ .../Conversational Retrieval QA Chain.json | 8 +++++++ .../chatflows/Flowise Docs QnA.json | 8 +++++++ .../server/marketplaces/chatflows/IfElse.json | 8 +++++++ .../chatflows/Image Generation.json | 8 +++++++ .../chatflows/Input Moderation.json | 8 +++++++ .../chatflows/List Output Parser.json | 8 +++++++ .../chatflows/Long Term Memory.json | 8 +++++++ .../chatflows/Metadata Filter.json | 8 +++++++ .../chatflows/Multi Prompt Chain.json | 8 +++++++ .../chatflows/Multi Retrieval QA Chain.json | 8 +++++++ .../chatflows/Multiple VectorDB.json | 24 +++++++++++++++++++ .../marketplaces/chatflows/OpenAI Agent.json | 8 +++++++ .../Prompt Chaining with VectorStore.json | 16 +++++++++++++ .../marketplaces/chatflows/ReAct Agent.json | 8 +++++++ .../marketplaces/chatflows/SQL DB Chain.json | 8 +++++++ .../marketplaces/chatflows/SQL Prompt.json | 24 +++++++++++++++++++ .../chatflows/Simple Conversation Chain.json | 8 +++++++ .../chatflows/Structured Output Parser.json | 8 +++++++ .../marketplaces/chatflows/Translator.json | 8 +++++++ .../marketplaces/chatflows/WebBrowser.json | 16 +++++++++++++ .../marketplaces/chatflows/WebPage QnA.json | 8 +++++++ 32 files changed, 324 insertions(+) diff --git a/packages/server/marketplaces/chatflows/API Agent OpenAI.json b/packages/server/marketplaces/chatflows/API Agent OpenAI.json index 621529fc..f3b5636e 100644 --- a/packages/server/marketplaces/chatflows/API Agent OpenAI.json +++ b/packages/server/marketplaces/chatflows/API Agent OpenAI.json @@ -125,6 +125,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -145,6 +149,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" @@ -464,6 +472,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -484,6 +496,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/API Agent.json b/packages/server/marketplaces/chatflows/API Agent.json index 9d5a6c54..31679a92 100644 --- a/packages/server/marketplaces/chatflows/API Agent.json +++ b/packages/server/marketplaces/chatflows/API Agent.json @@ -433,6 +433,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -453,6 +457,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" @@ -624,6 +632,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -644,6 +656,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" @@ -815,6 +831,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -835,6 +855,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json b/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json index 3fd71988..bf477ba7 100644 --- a/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json +++ b/packages/server/marketplaces/chatflows/Advanced Structured Output Parser.json @@ -216,6 +216,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" diff --git a/packages/server/marketplaces/chatflows/Antonym.json b/packages/server/marketplaces/chatflows/Antonym.json index 97c5af71..a88b16cc 100644 --- a/packages/server/marketplaces/chatflows/Antonym.json +++ b/packages/server/marketplaces/chatflows/Antonym.json @@ -212,6 +212,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -232,6 +236,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/AutoGPT.json b/packages/server/marketplaces/chatflows/AutoGPT.json index c0ed0807..c2ec12b3 100644 --- a/packages/server/marketplaces/chatflows/AutoGPT.json +++ b/packages/server/marketplaces/chatflows/AutoGPT.json @@ -288,6 +288,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -308,6 +312,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/BabyAGI.json b/packages/server/marketplaces/chatflows/BabyAGI.json index 14976ad3..618a4920 100644 --- a/packages/server/marketplaces/chatflows/BabyAGI.json +++ b/packages/server/marketplaces/chatflows/BabyAGI.json @@ -381,6 +381,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -401,6 +405,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/CSV Agent.json b/packages/server/marketplaces/chatflows/CSV Agent.json index 3439625b..4d755155 100644 --- a/packages/server/marketplaces/chatflows/CSV Agent.json +++ b/packages/server/marketplaces/chatflows/CSV Agent.json @@ -106,6 +106,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -126,6 +130,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Chat with a Podcast.json b/packages/server/marketplaces/chatflows/Chat with a Podcast.json index c87b3f2c..e8f8399c 100644 --- a/packages/server/marketplaces/chatflows/Chat with a Podcast.json +++ b/packages/server/marketplaces/chatflows/Chat with a Podcast.json @@ -231,6 +231,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -251,6 +255,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/ChatGPTPlugin.json b/packages/server/marketplaces/chatflows/ChatGPTPlugin.json index 3777b637..2b87b51d 100644 --- a/packages/server/marketplaces/chatflows/ChatGPTPlugin.json +++ b/packages/server/marketplaces/chatflows/ChatGPTPlugin.json @@ -251,6 +251,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -271,6 +275,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Conversational Agent.json b/packages/server/marketplaces/chatflows/Conversational Agent.json index 4cb736a0..13b479af 100644 --- a/packages/server/marketplaces/chatflows/Conversational Agent.json +++ b/packages/server/marketplaces/chatflows/Conversational Agent.json @@ -193,6 +193,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -213,6 +217,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json b/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json index a4ec6b5b..4120ef17 100644 --- a/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json +++ b/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json @@ -524,6 +524,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -544,6 +548,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json b/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json index f76e89e6..32e0c762 100644 --- a/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json +++ b/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json @@ -406,6 +406,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -426,6 +430,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Flowise Docs QnA.json b/packages/server/marketplaces/chatflows/Flowise Docs QnA.json index 31d65c48..8ed4ac56 100644 --- a/packages/server/marketplaces/chatflows/Flowise Docs QnA.json +++ b/packages/server/marketplaces/chatflows/Flowise Docs QnA.json @@ -412,6 +412,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -432,6 +436,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/IfElse.json b/packages/server/marketplaces/chatflows/IfElse.json index e3b66f44..bcb2cd96 100644 --- a/packages/server/marketplaces/chatflows/IfElse.json +++ b/packages/server/marketplaces/chatflows/IfElse.json @@ -945,6 +945,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -965,6 +969,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Image Generation.json b/packages/server/marketplaces/chatflows/Image Generation.json index 46cb79ec..4b82dcf3 100644 --- a/packages/server/marketplaces/chatflows/Image Generation.json +++ b/packages/server/marketplaces/chatflows/Image Generation.json @@ -489,6 +489,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -509,6 +513,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Input Moderation.json b/packages/server/marketplaces/chatflows/Input Moderation.json index bd449777..2b78bdb2 100644 --- a/packages/server/marketplaces/chatflows/Input Moderation.json +++ b/packages/server/marketplaces/chatflows/Input Moderation.json @@ -201,6 +201,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -221,6 +225,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/List Output Parser.json b/packages/server/marketplaces/chatflows/List Output Parser.json index 0eb269b4..5bdfff71 100644 --- a/packages/server/marketplaces/chatflows/List Output Parser.json +++ b/packages/server/marketplaces/chatflows/List Output Parser.json @@ -260,6 +260,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -280,6 +284,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Long Term Memory.json b/packages/server/marketplaces/chatflows/Long Term Memory.json index c5681d3d..7b54b146 100644 --- a/packages/server/marketplaces/chatflows/Long Term Memory.json +++ b/packages/server/marketplaces/chatflows/Long Term Memory.json @@ -543,6 +543,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -563,6 +567,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Metadata Filter.json b/packages/server/marketplaces/chatflows/Metadata Filter.json index ed2efb9f..a37764df 100644 --- a/packages/server/marketplaces/chatflows/Metadata Filter.json +++ b/packages/server/marketplaces/chatflows/Metadata Filter.json @@ -490,6 +490,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -510,6 +514,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Multi Prompt Chain.json b/packages/server/marketplaces/chatflows/Multi Prompt Chain.json index 97cca308..8b933e8f 100644 --- a/packages/server/marketplaces/chatflows/Multi Prompt Chain.json +++ b/packages/server/marketplaces/chatflows/Multi Prompt Chain.json @@ -314,6 +314,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -334,6 +338,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json b/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json index 6b8f2c33..0fc6ff77 100644 --- a/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json +++ b/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json @@ -425,6 +425,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -445,6 +449,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Multiple VectorDB.json b/packages/server/marketplaces/chatflows/Multiple VectorDB.json index b76270e7..3d8a22f3 100644 --- a/packages/server/marketplaces/chatflows/Multiple VectorDB.json +++ b/packages/server/marketplaces/chatflows/Multiple VectorDB.json @@ -522,6 +522,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -542,6 +546,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" @@ -1040,6 +1048,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -1060,6 +1072,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" @@ -1238,6 +1254,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -1258,6 +1278,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/OpenAI Agent.json b/packages/server/marketplaces/chatflows/OpenAI Agent.json index 6f35e595..fa9184d2 100644 --- a/packages/server/marketplaces/chatflows/OpenAI Agent.json +++ b/packages/server/marketplaces/chatflows/OpenAI Agent.json @@ -316,6 +316,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -336,6 +340,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json b/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json index d225e41a..b2db86c4 100644 --- a/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json +++ b/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json @@ -464,6 +464,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -484,6 +488,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" @@ -662,6 +670,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -682,6 +694,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/ReAct Agent.json b/packages/server/marketplaces/chatflows/ReAct Agent.json index 5fd191fe..151583a2 100644 --- a/packages/server/marketplaces/chatflows/ReAct Agent.json +++ b/packages/server/marketplaces/chatflows/ReAct Agent.json @@ -136,6 +136,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -156,6 +160,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/SQL DB Chain.json b/packages/server/marketplaces/chatflows/SQL DB Chain.json index ec9d465d..0d6a656f 100644 --- a/packages/server/marketplaces/chatflows/SQL DB Chain.json +++ b/packages/server/marketplaces/chatflows/SQL DB Chain.json @@ -50,6 +50,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -70,6 +74,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/SQL Prompt.json b/packages/server/marketplaces/chatflows/SQL Prompt.json index 8d2691c6..aeb62416 100644 --- a/packages/server/marketplaces/chatflows/SQL Prompt.json +++ b/packages/server/marketplaces/chatflows/SQL Prompt.json @@ -210,6 +210,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -230,6 +234,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" @@ -408,6 +416,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -428,6 +440,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" @@ -1332,6 +1348,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -1352,6 +1372,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Simple Conversation Chain.json b/packages/server/marketplaces/chatflows/Simple Conversation Chain.json index 53cfeace..5bda9580 100644 --- a/packages/server/marketplaces/chatflows/Simple Conversation Chain.json +++ b/packages/server/marketplaces/chatflows/Simple Conversation Chain.json @@ -51,6 +51,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -71,6 +75,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Structured Output Parser.json b/packages/server/marketplaces/chatflows/Structured Output Parser.json index 9801a90f..2e693ee5 100644 --- a/packages/server/marketplaces/chatflows/Structured Output Parser.json +++ b/packages/server/marketplaces/chatflows/Structured Output Parser.json @@ -51,6 +51,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -71,6 +75,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/Translator.json b/packages/server/marketplaces/chatflows/Translator.json index 5c8a3cc5..a9a8b570 100644 --- a/packages/server/marketplaces/chatflows/Translator.json +++ b/packages/server/marketplaces/chatflows/Translator.json @@ -119,6 +119,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -139,6 +143,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/WebBrowser.json b/packages/server/marketplaces/chatflows/WebBrowser.json index 232bd83e..600639d8 100644 --- a/packages/server/marketplaces/chatflows/WebBrowser.json +++ b/packages/server/marketplaces/chatflows/WebBrowser.json @@ -162,6 +162,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -182,6 +186,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" @@ -460,6 +468,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -480,6 +492,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106" diff --git a/packages/server/marketplaces/chatflows/WebPage QnA.json b/packages/server/marketplaces/chatflows/WebPage QnA.json index 50806161..24b13b87 100644 --- a/packages/server/marketplaces/chatflows/WebPage QnA.json +++ b/packages/server/marketplaces/chatflows/WebPage QnA.json @@ -429,6 +429,10 @@ "label": "gpt-4-1106-preview", "name": "gpt-4-1106-preview" }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, { "label": "gpt-4-vision-preview", "name": "gpt-4-vision-preview" @@ -449,6 +453,10 @@ "label": "gpt-3.5-turbo", "name": "gpt-3.5-turbo" }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, { "label": "gpt-3.5-turbo-1106", "name": "gpt-3.5-turbo-1106"