mirror of https://github.com/FlowiseAI/Flowise.git
1247 lines
52 KiB
JSON
1247 lines
52 KiB
JSON
{
|
|
"description": "Split flows based on if else condition",
|
|
"framework": ["Langchain"],
|
|
"usecases": ["Basic"],
|
|
"nodes": [
|
|
{
|
|
"width": 300,
|
|
"height": 513,
|
|
"id": "promptTemplate_0",
|
|
"position": {
|
|
"x": 792.9464838535649,
|
|
"y": 527.1718536712464
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "promptTemplate_0",
|
|
"label": "Prompt Template",
|
|
"version": 1,
|
|
"name": "promptTemplate",
|
|
"type": "PromptTemplate",
|
|
"baseClasses": ["PromptTemplate", "BaseStringPromptTemplate", "BasePromptTemplate"],
|
|
"category": "Prompts",
|
|
"description": "Schema to represent a basic prompt for an LLM",
|
|
"inputParams": [
|
|
{
|
|
"label": "Template",
|
|
"name": "template",
|
|
"type": "string",
|
|
"rows": 4,
|
|
"placeholder": "What is a good name for a company that makes {product}?",
|
|
"id": "promptTemplate_0-input-template-string"
|
|
},
|
|
{
|
|
"label": "Format Prompt Values",
|
|
"name": "promptValues",
|
|
"type": "json",
|
|
"optional": true,
|
|
"acceptVariable": true,
|
|
"list": true,
|
|
"id": "promptTemplate_0-input-promptValues-json"
|
|
}
|
|
],
|
|
"inputAnchors": [],
|
|
"inputs": {
|
|
"template": "You are an AI who performs one task based on the following objective: {objective}.\nRespond with how you would complete this task:",
|
|
"promptValues": "{\"objective\":\"{{question}}\"}"
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"id": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
|
|
"name": "promptTemplate",
|
|
"label": "PromptTemplate",
|
|
"type": "PromptTemplate | BaseStringPromptTemplate | BasePromptTemplate"
|
|
}
|
|
],
|
|
"outputs": {},
|
|
"selected": false
|
|
},
|
|
"selected": false,
|
|
"positionAbsolute": {
|
|
"x": 792.9464838535649,
|
|
"y": 527.1718536712464
|
|
},
|
|
"dragging": false
|
|
},
|
|
{
|
|
"width": 300,
|
|
"height": 513,
|
|
"id": "promptTemplate_1",
|
|
"position": {
|
|
"x": 1995.1328578238122,
|
|
"y": -14.648035759690174
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "promptTemplate_1",
|
|
"label": "Prompt Template",
|
|
"version": 1,
|
|
"name": "promptTemplate",
|
|
"type": "PromptTemplate",
|
|
"baseClasses": ["PromptTemplate", "BaseStringPromptTemplate", "BasePromptTemplate"],
|
|
"category": "Prompts",
|
|
"description": "Schema to represent a basic prompt for an LLM",
|
|
"inputParams": [
|
|
{
|
|
"label": "Template",
|
|
"name": "template",
|
|
"type": "string",
|
|
"rows": 4,
|
|
"placeholder": "What is a good name for a company that makes {product}?",
|
|
"id": "promptTemplate_1-input-template-string"
|
|
},
|
|
{
|
|
"label": "Format Prompt Values",
|
|
"name": "promptValues",
|
|
"type": "json",
|
|
"optional": true,
|
|
"acceptVariable": true,
|
|
"list": true,
|
|
"id": "promptTemplate_1-input-promptValues-json"
|
|
}
|
|
],
|
|
"inputAnchors": [],
|
|
"inputs": {
|
|
"template": "You are a task creation AI that uses the result of an execution agent to create new tasks with the following objective: {objective}.\nThe last completed task has the result: {result}.\nBased on the result, create new tasks to be completed by the AI system that do not overlap with result.\nReturn the tasks as an array.",
|
|
"promptValues": "{\"objective\":\"{{question}}\",\"result\":\"{{ifElseFunction_0.data.instance}}\"}"
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"id": "promptTemplate_1-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
|
|
"name": "promptTemplate",
|
|
"label": "PromptTemplate",
|
|
"type": "PromptTemplate | BaseStringPromptTemplate | BasePromptTemplate"
|
|
}
|
|
],
|
|
"outputs": {},
|
|
"selected": false
|
|
},
|
|
"positionAbsolute": {
|
|
"x": 1995.1328578238122,
|
|
"y": -14.648035759690174
|
|
},
|
|
"selected": false,
|
|
"dragging": false
|
|
},
|
|
{
|
|
"width": 300,
|
|
"height": 508,
|
|
"id": "llmChain_0",
|
|
"position": {
|
|
"x": 1183.0899727188096,
|
|
"y": 385.0159960992951
|
|
},
|
|
"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_2.data.instance}}",
|
|
"prompt": "{{promptTemplate_0.data.instance}}",
|
|
"outputParser": "",
|
|
"chainName": "FirstChain",
|
|
"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": "outputPrediction"
|
|
},
|
|
"selected": false
|
|
},
|
|
"selected": false,
|
|
"positionAbsolute": {
|
|
"x": 1183.0899727188096,
|
|
"y": 385.0159960992951
|
|
},
|
|
"dragging": false
|
|
},
|
|
{
|
|
"width": 300,
|
|
"height": 508,
|
|
"id": "llmChain_1",
|
|
"position": {
|
|
"x": 2773.675809586143,
|
|
"y": 114.39482869328754
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "llmChain_1",
|
|
"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_1-input-chainName-string"
|
|
}
|
|
],
|
|
"inputAnchors": [
|
|
{
|
|
"label": "Language Model",
|
|
"name": "model",
|
|
"type": "BaseLanguageModel",
|
|
"id": "llmChain_1-input-model-BaseLanguageModel"
|
|
},
|
|
{
|
|
"label": "Prompt",
|
|
"name": "prompt",
|
|
"type": "BasePromptTemplate",
|
|
"id": "llmChain_1-input-prompt-BasePromptTemplate"
|
|
},
|
|
{
|
|
"label": "Output Parser",
|
|
"name": "outputParser",
|
|
"type": "BaseLLMOutputParser",
|
|
"optional": true,
|
|
"id": "llmChain_1-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_1-input-inputModeration-Moderation"
|
|
}
|
|
],
|
|
"inputs": {
|
|
"model": "{{chatOpenAI_1.data.instance}}",
|
|
"prompt": "{{promptTemplate_1.data.instance}}",
|
|
"outputParser": "",
|
|
"chainName": "SuccessChain",
|
|
"inputModeration": ""
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"name": "output",
|
|
"label": "Output",
|
|
"type": "options",
|
|
"options": [
|
|
{
|
|
"id": "llmChain_1-output-llmChain-LLMChain|BaseChain|Runnable",
|
|
"name": "llmChain",
|
|
"label": "LLM Chain",
|
|
"type": "LLMChain | BaseChain | Runnable"
|
|
},
|
|
{
|
|
"id": "llmChain_1-output-outputPrediction-string|json",
|
|
"name": "outputPrediction",
|
|
"label": "Output Prediction",
|
|
"type": "string | json"
|
|
}
|
|
],
|
|
"default": "llmChain"
|
|
}
|
|
],
|
|
"outputs": {
|
|
"output": "llmChain"
|
|
},
|
|
"selected": false
|
|
},
|
|
"selected": false,
|
|
"positionAbsolute": {
|
|
"x": 2773.675809586143,
|
|
"y": 114.39482869328754
|
|
},
|
|
"dragging": false
|
|
},
|
|
{
|
|
"width": 300,
|
|
"height": 513,
|
|
"id": "promptTemplate_2",
|
|
"position": {
|
|
"x": 1992.5456174373144,
|
|
"y": 675.5277193898106
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "promptTemplate_2",
|
|
"label": "Prompt Template",
|
|
"version": 1,
|
|
"name": "promptTemplate",
|
|
"type": "PromptTemplate",
|
|
"baseClasses": ["PromptTemplate", "BaseStringPromptTemplate", "BasePromptTemplate"],
|
|
"category": "Prompts",
|
|
"description": "Schema to represent a basic prompt for an LLM",
|
|
"inputParams": [
|
|
{
|
|
"label": "Template",
|
|
"name": "template",
|
|
"type": "string",
|
|
"rows": 4,
|
|
"placeholder": "What is a good name for a company that makes {product}?",
|
|
"id": "promptTemplate_2-input-template-string"
|
|
},
|
|
{
|
|
"label": "Format Prompt Values",
|
|
"name": "promptValues",
|
|
"type": "json",
|
|
"optional": true,
|
|
"acceptVariable": true,
|
|
"list": true,
|
|
"id": "promptTemplate_2-input-promptValues-json"
|
|
}
|
|
],
|
|
"inputAnchors": [],
|
|
"inputs": {
|
|
"template": "Politely say \"I'm not able to answer the query\"",
|
|
"promptValues": "{\"objective\":\"{{question}}\",\"result\":\"\"}"
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"id": "promptTemplate_2-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
|
|
"name": "promptTemplate",
|
|
"label": "PromptTemplate",
|
|
"type": "PromptTemplate | BaseStringPromptTemplate | BasePromptTemplate"
|
|
}
|
|
],
|
|
"outputs": {},
|
|
"selected": false
|
|
},
|
|
"positionAbsolute": {
|
|
"x": 1992.5456174373144,
|
|
"y": 675.5277193898106
|
|
},
|
|
"selected": false,
|
|
"dragging": false
|
|
},
|
|
{
|
|
"width": 300,
|
|
"height": 508,
|
|
"id": "llmChain_2",
|
|
"position": {
|
|
"x": 2800.114465373451,
|
|
"y": 909.2318348964463
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "llmChain_2",
|
|
"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_2-input-chainName-string"
|
|
}
|
|
],
|
|
"inputAnchors": [
|
|
{
|
|
"label": "Language Model",
|
|
"name": "model",
|
|
"type": "BaseLanguageModel",
|
|
"id": "llmChain_2-input-model-BaseLanguageModel"
|
|
},
|
|
{
|
|
"label": "Prompt",
|
|
"name": "prompt",
|
|
"type": "BasePromptTemplate",
|
|
"id": "llmChain_2-input-prompt-BasePromptTemplate"
|
|
},
|
|
{
|
|
"label": "Output Parser",
|
|
"name": "outputParser",
|
|
"type": "BaseLLMOutputParser",
|
|
"optional": true,
|
|
"id": "llmChain_2-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_2-input-inputModeration-Moderation"
|
|
}
|
|
],
|
|
"inputs": {
|
|
"model": "{{chatAnthropic_0.data.instance}}",
|
|
"prompt": "{{promptTemplate_2.data.instance}}",
|
|
"outputParser": "",
|
|
"chainName": "FallbackChain",
|
|
"inputModeration": ""
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"name": "output",
|
|
"label": "Output",
|
|
"type": "options",
|
|
"options": [
|
|
{
|
|
"id": "llmChain_2-output-llmChain-LLMChain|BaseChain|Runnable",
|
|
"name": "llmChain",
|
|
"label": "LLM Chain",
|
|
"type": "LLMChain | BaseChain | Runnable"
|
|
},
|
|
{
|
|
"id": "llmChain_2-output-outputPrediction-string|json",
|
|
"name": "outputPrediction",
|
|
"label": "Output Prediction",
|
|
"type": "string | json"
|
|
}
|
|
],
|
|
"default": "llmChain"
|
|
}
|
|
],
|
|
"outputs": {
|
|
"output": "llmChain"
|
|
},
|
|
"selected": false
|
|
},
|
|
"selected": false,
|
|
"positionAbsolute": {
|
|
"x": 2800.114465373451,
|
|
"y": 909.2318348964463
|
|
},
|
|
"dragging": false
|
|
},
|
|
{
|
|
"width": 300,
|
|
"height": 757,
|
|
"id": "ifElseFunction_0",
|
|
"position": {
|
|
"x": 1590.6560099561739,
|
|
"y": 265.36655719326177
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "ifElseFunction_0",
|
|
"label": "IfElse Function",
|
|
"version": 2,
|
|
"name": "ifElseFunction",
|
|
"type": "IfElseFunction",
|
|
"baseClasses": ["IfElseFunction", "Utilities"],
|
|
"tags": ["Utilities"],
|
|
"category": "Utilities",
|
|
"description": "Split flows based on If Else javascript functions",
|
|
"inputParams": [
|
|
{
|
|
"label": "Input Variables",
|
|
"name": "functionInputVariables",
|
|
"description": "Input variables can be used in the function with prefix $. For example: $var",
|
|
"type": "json",
|
|
"optional": true,
|
|
"acceptVariable": true,
|
|
"list": true,
|
|
"id": "ifElseFunction_0-input-functionInputVariables-json"
|
|
},
|
|
{
|
|
"label": "IfElse Name",
|
|
"name": "functionName",
|
|
"type": "string",
|
|
"optional": true,
|
|
"placeholder": "If Condition Match",
|
|
"id": "ifElseFunction_0-input-functionName-string"
|
|
},
|
|
{
|
|
"label": "If Function",
|
|
"name": "ifFunction",
|
|
"description": "Function must return a value",
|
|
"type": "code",
|
|
"rows": 2,
|
|
"default": "if (\"hello\" == \"hello\") {\n return true;\n}",
|
|
"id": "ifElseFunction_0-input-ifFunction-code"
|
|
},
|
|
{
|
|
"label": "Else Function",
|
|
"name": "elseFunction",
|
|
"description": "Function must return a value",
|
|
"type": "code",
|
|
"rows": 2,
|
|
"default": "return false;",
|
|
"id": "ifElseFunction_0-input-elseFunction-code"
|
|
}
|
|
],
|
|
"inputAnchors": [],
|
|
"inputs": {
|
|
"functionInputVariables": "{\"task\":\"{{llmChain_0.data.instance}}\"}",
|
|
"functionName": "If Condition Match",
|
|
"ifFunction": "if ($task.includes(\"task\")) {\n // return $task to be used in next prompt as variable\n return $task;\n}",
|
|
"elseFunction": "return false;"
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"name": "output",
|
|
"label": "Output",
|
|
"type": "options",
|
|
"description": "",
|
|
"options": [
|
|
{
|
|
"id": "ifElseFunction_0-output-returnTrue-string|number|boolean|json|array",
|
|
"name": "returnTrue",
|
|
"label": "True",
|
|
"description": "",
|
|
"type": "string | number | boolean | json | array"
|
|
},
|
|
{
|
|
"id": "ifElseFunction_0-output-returnFalse-string|number|boolean|json|array",
|
|
"name": "returnFalse",
|
|
"label": "False",
|
|
"description": "",
|
|
"type": "string | number | boolean | json | array"
|
|
}
|
|
],
|
|
"default": "returnTrue"
|
|
}
|
|
],
|
|
"outputs": {
|
|
"output": "returnTrue"
|
|
},
|
|
"selected": false
|
|
},
|
|
"selected": false,
|
|
"positionAbsolute": {
|
|
"x": 1590.6560099561739,
|
|
"y": 265.36655719326177
|
|
},
|
|
"dragging": false
|
|
},
|
|
{
|
|
"width": 300,
|
|
"height": 670,
|
|
"id": "chatOpenAI_1",
|
|
"position": {
|
|
"x": 2351.7234095119156,
|
|
"y": -394.0409300837044
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "chatOpenAI_1",
|
|
"label": "ChatOpenAI",
|
|
"version": 6,
|
|
"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_1-input-credential-credential"
|
|
},
|
|
{
|
|
"label": "Model Name",
|
|
"name": "modelName",
|
|
"type": "asyncOptions",
|
|
"loadMethod": "listModels",
|
|
"default": "gpt-3.5-turbo",
|
|
"id": "chatOpenAI_1-input-modelName-options"
|
|
},
|
|
{
|
|
"label": "Temperature",
|
|
"name": "temperature",
|
|
"type": "number",
|
|
"step": 0.1,
|
|
"default": 0.9,
|
|
"optional": true,
|
|
"id": "chatOpenAI_1-input-temperature-number"
|
|
},
|
|
{
|
|
"label": "Max Tokens",
|
|
"name": "maxTokens",
|
|
"type": "number",
|
|
"step": 1,
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_1-input-maxTokens-number"
|
|
},
|
|
{
|
|
"label": "Top Probability",
|
|
"name": "topP",
|
|
"type": "number",
|
|
"step": 0.1,
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_1-input-topP-number"
|
|
},
|
|
{
|
|
"label": "Frequency Penalty",
|
|
"name": "frequencyPenalty",
|
|
"type": "number",
|
|
"step": 0.1,
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_1-input-frequencyPenalty-number"
|
|
},
|
|
{
|
|
"label": "Presence Penalty",
|
|
"name": "presencePenalty",
|
|
"type": "number",
|
|
"step": 0.1,
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_1-input-presencePenalty-number"
|
|
},
|
|
{
|
|
"label": "Timeout",
|
|
"name": "timeout",
|
|
"type": "number",
|
|
"step": 1,
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_1-input-timeout-number"
|
|
},
|
|
{
|
|
"label": "BasePath",
|
|
"name": "basepath",
|
|
"type": "string",
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_1-input-basepath-string"
|
|
},
|
|
{
|
|
"label": "BaseOptions",
|
|
"name": "baseOptions",
|
|
"type": "json",
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_1-input-baseOptions-json"
|
|
},
|
|
{
|
|
"label": "Allow Image Uploads",
|
|
"name": "allowImageUploads",
|
|
"type": "boolean",
|
|
"description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent",
|
|
"default": false,
|
|
"optional": true,
|
|
"id": "chatOpenAI_1-input-allowImageUploads-boolean"
|
|
},
|
|
{
|
|
"label": "Image Resolution",
|
|
"description": "This parameter controls the resolution in which the model views the image.",
|
|
"name": "imageResolution",
|
|
"type": "options",
|
|
"options": [
|
|
{
|
|
"label": "Low",
|
|
"name": "low"
|
|
},
|
|
{
|
|
"label": "High",
|
|
"name": "high"
|
|
},
|
|
{
|
|
"label": "Auto",
|
|
"name": "auto"
|
|
}
|
|
],
|
|
"default": "low",
|
|
"optional": false,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_1-input-imageResolution-options"
|
|
}
|
|
],
|
|
"inputAnchors": [
|
|
{
|
|
"label": "Cache",
|
|
"name": "cache",
|
|
"type": "BaseCache",
|
|
"optional": true,
|
|
"id": "chatOpenAI_1-input-cache-BaseCache"
|
|
}
|
|
],
|
|
"inputs": {
|
|
"cache": "",
|
|
"modelName": "gpt-3.5-turbo",
|
|
"temperature": 0.9,
|
|
"maxTokens": "",
|
|
"topP": "",
|
|
"frequencyPenalty": "",
|
|
"presencePenalty": "",
|
|
"timeout": "",
|
|
"basepath": "",
|
|
"baseOptions": "",
|
|
"allowImageUploads": true,
|
|
"imageResolution": "low"
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"id": "chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
|
|
"name": "chatOpenAI",
|
|
"label": "ChatOpenAI",
|
|
"type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable"
|
|
}
|
|
],
|
|
"outputs": {},
|
|
"selected": false
|
|
},
|
|
"selected": false,
|
|
"positionAbsolute": {
|
|
"x": 2351.7234095119156,
|
|
"y": -394.0409300837044
|
|
},
|
|
"dragging": false
|
|
},
|
|
{
|
|
"width": 300,
|
|
"height": 670,
|
|
"id": "chatOpenAI_2",
|
|
"position": {
|
|
"x": 789.3453885560219,
|
|
"y": -179.07897273438854
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "chatOpenAI_2",
|
|
"label": "ChatOpenAI",
|
|
"version": 6,
|
|
"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_2-input-credential-credential"
|
|
},
|
|
{
|
|
"label": "Model Name",
|
|
"name": "modelName",
|
|
"type": "asyncOptions",
|
|
"loadMethod": "listModels",
|
|
"default": "gpt-3.5-turbo",
|
|
"id": "chatOpenAI_2-input-modelName-options"
|
|
},
|
|
{
|
|
"label": "Temperature",
|
|
"name": "temperature",
|
|
"type": "number",
|
|
"step": 0.1,
|
|
"default": 0.9,
|
|
"optional": true,
|
|
"id": "chatOpenAI_2-input-temperature-number"
|
|
},
|
|
{
|
|
"label": "Max Tokens",
|
|
"name": "maxTokens",
|
|
"type": "number",
|
|
"step": 1,
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_2-input-maxTokens-number"
|
|
},
|
|
{
|
|
"label": "Top Probability",
|
|
"name": "topP",
|
|
"type": "number",
|
|
"step": 0.1,
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_2-input-topP-number"
|
|
},
|
|
{
|
|
"label": "Frequency Penalty",
|
|
"name": "frequencyPenalty",
|
|
"type": "number",
|
|
"step": 0.1,
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_2-input-frequencyPenalty-number"
|
|
},
|
|
{
|
|
"label": "Presence Penalty",
|
|
"name": "presencePenalty",
|
|
"type": "number",
|
|
"step": 0.1,
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_2-input-presencePenalty-number"
|
|
},
|
|
{
|
|
"label": "Timeout",
|
|
"name": "timeout",
|
|
"type": "number",
|
|
"step": 1,
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_2-input-timeout-number"
|
|
},
|
|
{
|
|
"label": "BasePath",
|
|
"name": "basepath",
|
|
"type": "string",
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_2-input-basepath-string"
|
|
},
|
|
{
|
|
"label": "BaseOptions",
|
|
"name": "baseOptions",
|
|
"type": "json",
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_2-input-baseOptions-json"
|
|
},
|
|
{
|
|
"label": "Allow Image Uploads",
|
|
"name": "allowImageUploads",
|
|
"type": "boolean",
|
|
"description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent",
|
|
"default": false,
|
|
"optional": true,
|
|
"id": "chatOpenAI_2-input-allowImageUploads-boolean"
|
|
},
|
|
{
|
|
"label": "Image Resolution",
|
|
"description": "This parameter controls the resolution in which the model views the image.",
|
|
"name": "imageResolution",
|
|
"type": "options",
|
|
"options": [
|
|
{
|
|
"label": "Low",
|
|
"name": "low"
|
|
},
|
|
{
|
|
"label": "High",
|
|
"name": "high"
|
|
},
|
|
{
|
|
"label": "Auto",
|
|
"name": "auto"
|
|
}
|
|
],
|
|
"default": "low",
|
|
"optional": false,
|
|
"additionalParams": true,
|
|
"id": "chatOpenAI_2-input-imageResolution-options"
|
|
}
|
|
],
|
|
"inputAnchors": [
|
|
{
|
|
"label": "Cache",
|
|
"name": "cache",
|
|
"type": "BaseCache",
|
|
"optional": true,
|
|
"id": "chatOpenAI_2-input-cache-BaseCache"
|
|
}
|
|
],
|
|
"inputs": {
|
|
"cache": "",
|
|
"modelName": "gpt-3.5-turbo",
|
|
"temperature": 0.9,
|
|
"maxTokens": "",
|
|
"topP": "",
|
|
"frequencyPenalty": "",
|
|
"presencePenalty": "",
|
|
"timeout": "",
|
|
"basepath": "",
|
|
"baseOptions": "",
|
|
"allowImageUploads": true,
|
|
"imageResolution": "low"
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"id": "chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
|
|
"name": "chatOpenAI",
|
|
"label": "ChatOpenAI",
|
|
"type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable"
|
|
}
|
|
],
|
|
"outputs": {},
|
|
"selected": false
|
|
},
|
|
"selected": false,
|
|
"positionAbsolute": {
|
|
"x": 789.3453885560219,
|
|
"y": -179.07897273438854
|
|
},
|
|
"dragging": false
|
|
},
|
|
{
|
|
"id": "chatAnthropic_0",
|
|
"position": {
|
|
"x": 2381.220361865136,
|
|
"y": 393.26149491753074
|
|
},
|
|
"type": "customNode",
|
|
"data": {
|
|
"id": "chatAnthropic_0",
|
|
"label": "ChatAnthropic",
|
|
"version": 6,
|
|
"name": "chatAnthropic",
|
|
"type": "ChatAnthropic",
|
|
"baseClasses": ["ChatAnthropic", "ChatAnthropicMessages", "BaseChatModel", "BaseLanguageModel", "Runnable"],
|
|
"category": "Chat Models",
|
|
"description": "Wrapper around ChatAnthropic large language models that use the Chat endpoint",
|
|
"inputParams": [
|
|
{
|
|
"label": "Connect Credential",
|
|
"name": "credential",
|
|
"type": "credential",
|
|
"credentialNames": ["anthropicApi"],
|
|
"id": "chatAnthropic_0-input-credential-credential"
|
|
},
|
|
{
|
|
"label": "Model Name",
|
|
"name": "modelName",
|
|
"type": "asyncOptions",
|
|
"loadMethod": "listModels",
|
|
"default": "claude-3-haiku",
|
|
"id": "chatAnthropic_0-input-modelName-asyncOptions"
|
|
},
|
|
{
|
|
"label": "Temperature",
|
|
"name": "temperature",
|
|
"type": "number",
|
|
"step": 0.1,
|
|
"default": 0.9,
|
|
"optional": true,
|
|
"id": "chatAnthropic_0-input-temperature-number"
|
|
},
|
|
{
|
|
"label": "Max Tokens",
|
|
"name": "maxTokensToSample",
|
|
"type": "number",
|
|
"step": 1,
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatAnthropic_0-input-maxTokensToSample-number"
|
|
},
|
|
{
|
|
"label": "Top P",
|
|
"name": "topP",
|
|
"type": "number",
|
|
"step": 0.1,
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatAnthropic_0-input-topP-number"
|
|
},
|
|
{
|
|
"label": "Top K",
|
|
"name": "topK",
|
|
"type": "number",
|
|
"step": 0.1,
|
|
"optional": true,
|
|
"additionalParams": true,
|
|
"id": "chatAnthropic_0-input-topK-number"
|
|
},
|
|
{
|
|
"label": "Allow Image Uploads",
|
|
"name": "allowImageUploads",
|
|
"type": "boolean",
|
|
"description": "Automatically uses claude-3-* models when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent",
|
|
"default": false,
|
|
"optional": true,
|
|
"id": "chatAnthropic_0-input-allowImageUploads-boolean"
|
|
}
|
|
],
|
|
"inputAnchors": [
|
|
{
|
|
"label": "Cache",
|
|
"name": "cache",
|
|
"type": "BaseCache",
|
|
"optional": true,
|
|
"id": "chatAnthropic_0-input-cache-BaseCache"
|
|
}
|
|
],
|
|
"inputs": {
|
|
"cache": "",
|
|
"modelName": "claude-3-haiku-20240307",
|
|
"temperature": 0.9,
|
|
"maxTokensToSample": "",
|
|
"topP": "",
|
|
"topK": "",
|
|
"allowImageUploads": ""
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"id": "chatAnthropic_0-output-chatAnthropic-ChatAnthropic|ChatAnthropicMessages|BaseChatModel|BaseLanguageModel|Runnable",
|
|
"name": "chatAnthropic",
|
|
"label": "ChatAnthropic",
|
|
"description": "Wrapper around ChatAnthropic large language models that use the Chat endpoint",
|
|
"type": "ChatAnthropic | ChatAnthropicMessages | BaseChatModel | BaseLanguageModel | Runnable"
|
|
}
|
|
],
|
|
"outputs": {},
|
|
"selected": false
|
|
},
|
|
"width": 300,
|
|
"height": 670,
|
|
"selected": false,
|
|
"dragging": false,
|
|
"positionAbsolute": {
|
|
"x": 2381.220361865136,
|
|
"y": 393.26149491753074
|
|
}
|
|
},
|
|
{
|
|
"id": "stickyNote_0",
|
|
"position": {
|
|
"x": 1585.520839473698,
|
|
"y": 51.83677692300674
|
|
},
|
|
"type": "stickyNote",
|
|
"data": {
|
|
"id": "stickyNote_0",
|
|
"label": "Sticky Note",
|
|
"version": 2,
|
|
"name": "stickyNote",
|
|
"type": "StickyNote",
|
|
"baseClasses": ["StickyNote"],
|
|
"tags": ["Utilities"],
|
|
"category": "Utilities",
|
|
"description": "Add a sticky note",
|
|
"inputParams": [
|
|
{
|
|
"label": "",
|
|
"name": "note",
|
|
"type": "string",
|
|
"rows": 1,
|
|
"placeholder": "Type something here",
|
|
"optional": true,
|
|
"id": "stickyNote_0-input-note-string"
|
|
}
|
|
],
|
|
"inputAnchors": [],
|
|
"inputs": {
|
|
"note": "Split the path into 2 ways according to condition\n\n1. If response from first LLM Chain contains the word \"task\", carry on with the next prompt\n\n2. Otherwise, politely reject user's request"
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"id": "stickyNote_0-output-stickyNote-StickyNote",
|
|
"name": "stickyNote",
|
|
"label": "StickyNote",
|
|
"description": "Add a sticky note",
|
|
"type": "StickyNote"
|
|
}
|
|
],
|
|
"outputs": {},
|
|
"selected": false
|
|
},
|
|
"width": 300,
|
|
"height": 183,
|
|
"selected": false,
|
|
"positionAbsolute": {
|
|
"x": 1585.520839473698,
|
|
"y": 51.83677692300674
|
|
},
|
|
"dragging": false
|
|
},
|
|
{
|
|
"id": "stickyNote_1",
|
|
"position": {
|
|
"x": 2791.378655166414,
|
|
"y": 699.1817665106969
|
|
},
|
|
"type": "stickyNote",
|
|
"data": {
|
|
"id": "stickyNote_1",
|
|
"label": "Sticky Note",
|
|
"version": 2,
|
|
"name": "stickyNote",
|
|
"type": "StickyNote",
|
|
"baseClasses": ["StickyNote"],
|
|
"tags": ["Utilities"],
|
|
"category": "Utilities",
|
|
"description": "Add a sticky note",
|
|
"inputParams": [
|
|
{
|
|
"label": "",
|
|
"name": "note",
|
|
"type": "string",
|
|
"rows": 1,
|
|
"placeholder": "Type something here",
|
|
"optional": true,
|
|
"id": "stickyNote_1-input-note-string"
|
|
}
|
|
],
|
|
"inputAnchors": [],
|
|
"inputs": {
|
|
"note": "Example question:\n\n- Solve world hunger"
|
|
},
|
|
"outputAnchors": [
|
|
{
|
|
"id": "stickyNote_1-output-stickyNote-StickyNote",
|
|
"name": "stickyNote",
|
|
"label": "StickyNote",
|
|
"description": "Add a sticky note",
|
|
"type": "StickyNote"
|
|
}
|
|
],
|
|
"outputs": {},
|
|
"selected": false
|
|
},
|
|
"width": 300,
|
|
"height": 82,
|
|
"selected": false,
|
|
"positionAbsolute": {
|
|
"x": 2791.378655166414,
|
|
"y": 699.1817665106969
|
|
},
|
|
"dragging": false
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": "promptTemplate_0",
|
|
"sourceHandle": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
|
|
"target": "llmChain_0",
|
|
"targetHandle": "llmChain_0-input-prompt-BasePromptTemplate",
|
|
"type": "buttonedge",
|
|
"id": "promptTemplate_0-promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate-llmChain_0-llmChain_0-input-prompt-BasePromptTemplate",
|
|
"data": {
|
|
"label": ""
|
|
}
|
|
},
|
|
{
|
|
"source": "promptTemplate_1",
|
|
"sourceHandle": "promptTemplate_1-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
|
|
"target": "llmChain_1",
|
|
"targetHandle": "llmChain_1-input-prompt-BasePromptTemplate",
|
|
"type": "buttonedge",
|
|
"id": "promptTemplate_1-promptTemplate_1-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate-llmChain_1-llmChain_1-input-prompt-BasePromptTemplate",
|
|
"data": {
|
|
"label": ""
|
|
}
|
|
},
|
|
{
|
|
"source": "promptTemplate_2",
|
|
"sourceHandle": "promptTemplate_2-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
|
|
"target": "llmChain_2",
|
|
"targetHandle": "llmChain_2-input-prompt-BasePromptTemplate",
|
|
"type": "buttonedge",
|
|
"id": "promptTemplate_2-promptTemplate_2-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate-llmChain_2-llmChain_2-input-prompt-BasePromptTemplate"
|
|
},
|
|
{
|
|
"source": "llmChain_0",
|
|
"sourceHandle": "llmChain_0-output-outputPrediction-string|json",
|
|
"target": "ifElseFunction_0",
|
|
"targetHandle": "ifElseFunction_0-input-functionInputVariables-json",
|
|
"type": "buttonedge",
|
|
"id": "llmChain_0-llmChain_0-output-outputPrediction-string|json-ifElseFunction_0-ifElseFunction_0-input-functionInputVariables-json"
|
|
},
|
|
{
|
|
"source": "ifElseFunction_0",
|
|
"sourceHandle": "ifElseFunction_0-output-returnFalse-string|number|boolean|json|array",
|
|
"target": "promptTemplate_2",
|
|
"targetHandle": "promptTemplate_2-input-promptValues-json",
|
|
"type": "buttonedge",
|
|
"id": "ifElseFunction_0-ifElseFunction_0-output-returnFalse-string|number|boolean|json|array-promptTemplate_2-promptTemplate_2-input-promptValues-json"
|
|
},
|
|
{
|
|
"source": "ifElseFunction_0",
|
|
"sourceHandle": "ifElseFunction_0-output-returnTrue-string|number|boolean|json|array",
|
|
"target": "promptTemplate_1",
|
|
"targetHandle": "promptTemplate_1-input-promptValues-json",
|
|
"type": "buttonedge",
|
|
"id": "ifElseFunction_0-ifElseFunction_0-output-returnTrue-string|number|boolean|json|array-promptTemplate_1-promptTemplate_1-input-promptValues-json"
|
|
},
|
|
{
|
|
"source": "chatOpenAI_1",
|
|
"sourceHandle": "chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
|
|
"target": "llmChain_1",
|
|
"targetHandle": "llmChain_1-input-model-BaseLanguageModel",
|
|
"type": "buttonedge",
|
|
"id": "chatOpenAI_1-chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_1-llmChain_1-input-model-BaseLanguageModel"
|
|
},
|
|
{
|
|
"source": "chatOpenAI_2",
|
|
"sourceHandle": "chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable",
|
|
"target": "llmChain_0",
|
|
"targetHandle": "llmChain_0-input-model-BaseLanguageModel",
|
|
"type": "buttonedge",
|
|
"id": "chatOpenAI_2-chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_0-llmChain_0-input-model-BaseLanguageModel"
|
|
},
|
|
{
|
|
"source": "chatAnthropic_0",
|
|
"sourceHandle": "chatAnthropic_0-output-chatAnthropic-ChatAnthropic|ChatAnthropicMessages|BaseChatModel|BaseLanguageModel|Runnable",
|
|
"target": "llmChain_2",
|
|
"targetHandle": "llmChain_2-input-model-BaseLanguageModel",
|
|
"type": "buttonedge",
|
|
"id": "chatAnthropic_0-chatAnthropic_0-output-chatAnthropic-ChatAnthropic|ChatAnthropicMessages|BaseChatModel|BaseLanguageModel|Runnable-llmChain_2-llmChain_2-input-model-BaseLanguageModel"
|
|
}
|
|
]
|
|
}
|