FlowiseAI / Flowise

Drag & drop UI to build your customized LLM flow
https://flowiseai.com
Apache License 2.0
31.43k stars 16.36k forks source link

[BUG] Error when connecting two LLM Nodes #3250

Closed Banbury closed 1 month ago

Banbury commented 1 month ago

Describe the bug When I connect two LLM Nodes in a sequence I get the error:

2024-09-25 09:12:57 2024-09-25 07:12:57 [VERBOSE]: [chain/error] [1:chain:LangGraph > 9:chain:summarizer > 10:chain:RunnableLambda] [1ms] Chain run errored with error: "Expected a Runnable, function or object.\nInstead got an unsupported type.\n\nError: Expected a Runnable, function or object.\nInstead got an unsupported type.\n    at _coerceToRunnable (/usr/local/lib/node_modules/flowise/node_modules/@langchain/core/dist/runnables/base.cjs:1772:15)\n    at RunnableSequence.from (/usr/local/lib/node_modules/flowise/node_modules/@langchain/core/dist/runnables/base.cjs:1288:19)\n    at createAgent (/usr/local/lib/node_modules/flowise/node_modules/flowise-components/dist/nodes/sequentialagents/LLMNode/LLMNode.js:417:46)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async RunnableLambda.workerNode [as func] (/usr/local/lib/node_modules/flowise/node_modules/flowise-components/dist/nodes/sequentialagents/LLMNode/LLMNode.js:350:24)\n    at async /usr/local/lib/node_modules/flowise/node_modules/@langchain/core/dist/runnables/base.cjs:1513:34"
2024-09-25 09:12:57 2024-09-25 07:12:57 [VERBOSE]: [chain/error] [1:chain:LangGraph > 9:chain:summarizer] [1ms] Chain run errored with error: "Expected a Runnable, function or object.\nInstead got an unsupported type.\n\nError: Expected a Runnable, function or object.\nInstead got an unsupported type.\n    at _coerceToRunnable (/usr/local/lib/node_modules/flowise/node_modules/@langchain/core/dist/runnables/base.cjs:1772:15)\n    at RunnableSequence.from (/usr/local/lib/node_modules/flowise/node_modules/@langchain/core/dist/runnables/base.cjs:1288:19)\n    at createAgent (/usr/local/lib/node_modules/flowise/node_modules/flowise-components/dist/nodes/sequentialagents/LLMNode/LLMNode.js:417:46)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async RunnableLambda.workerNode [as func] (/usr/local/lib/node_modules/flowise/node_modules/flowise-components/dist/nodes/sequentialagents/LLMNode/LLMNode.js:350:24)\n    at async /usr/local/lib/node_modules/flowise/node_modules/@langchain/core/dist/runnables/base.cjs:1513:34"
2024-09-25 09:12:57 2024-09-25 07:12:57 [VERBOSE]: [chain/error] [1:chain:LangGraph] [14.10s] Chain run errored with error: "Expected a Runnable, function or object.\nInstead got an unsupported type.\n\nError: Expected a Runnable, function or object.\nInstead got an unsupported type.\n    at _coerceToRunnable (/usr/local/lib/node_modules/flowise/node_modules/@langchain/core/dist/runnables/base.cjs:1772:15)\n    at RunnableSequence.from (/usr/local/lib/node_modules/flowise/node_modules/@langchain/core/dist/runnables/base.cjs:1288:19)\n    at createAgent (/usr/local/lib/node_modules/flowise/node_modules/flowise-components/dist/nodes/sequentialagents/LLMNode/LLMNode.js:417:46)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async RunnableLambda.workerNode [as func] (/usr/local/lib/node_modules/flowise/node_modules/flowise-components/dist/nodes/sequentialagents/LLMNode/LLMNode.js:350:24)\n    at async /usr/local/lib/node_modules/flowise/node_modules/@langchain/core/dist/runnables/base.cjs:1513:34"
2024-09-25 09:12:57 2024-09-25 07:12:57 [ERROR]: [server]: Error: Expected a Runnable, function or object.
2024-09-25 09:12:57 Instead got an unsupported type.
2024-09-25 09:12:57 Error: Expected a Runnable, function or object.
2024-09-25 09:12:57 Instead got an unsupported type.
2024-09-25 09:12:57     at buildAgentGraph (/usr/local/lib/node_modules/flowise/dist/utils/buildAgentGraph.js:355:19)
2024-09-25 09:12:57     at async utilBuildAgentResponse (/usr/local/lib/node_modules/flowise/dist/utils/buildChatflow.js:371:31)
2024-09-25 09:12:57     at async utilBuildChatflow (/usr/local/lib/node_modules/flowise/dist/utils/buildChatflow.js:157:20)
2024-09-25 09:12:57     at async createAndStreamInternalPrediction (/usr/local/lib/node_modules/flowise/dist/controllers/internal-predictions/index.js:32:29)
2024-09-25 09:12:57 2024-09-25 07:12:57 [ERROR]: [server]: Error: Error buildAgentGraph - Expected a Runnable, function or object.
2024-09-25 09:12:57 Instead got an unsupported type.
2024-09-25 09:12:57 Error: Error buildAgentGraph - Expected a Runnable, function or object.
2024-09-25 09:12:57 Instead got an unsupported type.
2024-09-25 09:12:57     at buildAgentGraph (/usr/local/lib/node_modules/flowise/dist/utils/buildAgentGraph.js:361:15)
2024-09-25 09:12:57     at async utilBuildAgentResponse (/usr/local/lib/node_modules/flowise/dist/utils/buildChatflow.js:371:31)
2024-09-25 09:12:57     at async utilBuildChatflow (/usr/local/lib/node_modules/flowise/dist/utils/buildChatflow.js:157:20)
2024-09-25 09:12:57     at async createAndStreamInternalPrediction (/usr/local/lib/node_modules/flowise/dist/controllers/internal-predictions/index.js:32:29)
2024-09-25 09:12:57 2024-09-25 07:12:57 [ERROR]: [server]: Error: Error buildAgentGraph - Expected a Runnable, function or object.
2024-09-25 09:12:57 Instead got an unsupported type.
2024-09-25 09:12:57 Error: Error buildAgentGraph - Expected a Runnable, function or object.
2024-09-25 09:12:57 Instead got an unsupported type.
2024-09-25 09:12:57     at utilBuildAgentResponse (/usr/local/lib/node_modules/flowise/dist/utils/buildChatflow.js:461:15)
2024-09-25 09:12:57     at async utilBuildChatflow (/usr/local/lib/node_modules/flowise/dist/utils/buildChatflow.js:157:20)
2024-09-25 09:12:57     at async createAndStreamInternalPrediction (/usr/local/lib/node_modules/flowise/dist/controllers/internal-predictions/index.js:32:29)

It also happens, if I connect an LLM Node to a Condition node. Apparently the only node, I can connect to an LLM Node, is the Start node.

To Reproduce Bug Test Agents.json Run this workflow.

Expected behavior The Agent flow should run through to the end without error.

Flow See above.

Setup

HenryHengZJ commented 1 month ago

not sure why, but I deleted the 2nd LLM Node and add a new one, it works: image

test Agents.json

Banbury commented 1 month ago

I think the problem lies with the Copy function. I get these errors, when I copy a node. I redid my whole workflow without copying, and it worked.