Describe the problem/error/question
The example code for LangChain Code
node does not work.
What is the error message (if any)?
Expected a Runnable, function or object. [line 5]
Please share your workflow
Share the output returned by the last node
Information on your n8n setup
n8n version: 1.38.1
Database (default: SQLite): SQLite
n8n EXECUTIONS_PROCESS setting (default: own, main): own
Running n8n via (Docker, npm, n8n cloud, desktop app): k8s
Operating system: ubuntu
As answered in another topic, if the Max Connections
attribute is set to 1, this minimal example does work. Otherwise, it needs to be accessed as an array (i.e. llm[0]
)
Hi @miguel-mconf ,
The problem you’re seeing is due to the LLM input configuration. If Max Connections is set to -1, the const llm = await this.getInputConnectionData('ai_languageModel', 0); would return an array inputs. So you would need to return it as llm[0]. But if you know you’re only going to use a single LLM for the passthrough, I would suggest to set it to 1 which would make your code work as expected.
[CleanShot 2024-04-30 at 11.19.53]
2 Likes
jan
May 2, 2024, 12:52pm
3
New version [email protected]
got released which includes the GitHub PR 9258 .
1 Like
system
Closed
May 9, 2024, 12:52pm
4
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.