Giter Site home page Giter Site logo

Comments (22)

the-trading-ai avatar the-trading-ai commented on June 9, 2024 1

Here's the process : (Someone told me that It look that this problem happened yesterday in langchain community with the Huggingface library)
image

image

TypeError: message.toJSON is not a function
at /usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/utils/logWrapper.js:168:73
at Array.map ()
at Proxy.connectionType (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/utils/logWrapper.js:168:48)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at Proxy._generateUncached (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/langchain/node_modules/@langchain/core/dist/language_models/llms.cjs:138:22)
at LLMChain._call (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/langchain/dist/chains/llm_chain.cjs:157:37)
at LLMChain.call (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/langchain/dist/chains/base.cjs:120:28)
at createSimpleLLMChain (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/ChainLLM/ChainLlm.node.js:84:23)
at getChain (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/ChainLLM/ChainLlm.node.js:93:16)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/ChainLLM/ChainLlm.node.js:360:31)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:730:19)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:662:53
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1064:20

from n8n.

dkindlund avatar dkindlund commented on June 9, 2024 1

This code was introduced by this commit:
7501ad8

As part of this PR:
#8526

I'm going to upgrade to [email protected] and see if that fixes the issue.

from n8n.

Joffcom avatar Joffcom commented on June 9, 2024 1

@dkindlund the good news is that sounds like a different issue so I believe the original issue here is solved and there is another one to look into.

You also don't need to worry about tagging us if we are commenting we will get notifications on new posts we are also mainly around during Berlin office hours 🙂

We will look into this new issue on Monday morning. It may be worth opening a new issue so it doesn't get confused with the original issue here.

from n8n.

Joffcom avatar Joffcom commented on June 9, 2024

Hey @the-trading-ai

If you open the LLM chain is there a larger error in there? Can you also share the workflow json so we can use it to reproduce the issue?

from n8n.

the-trading-ai avatar the-trading-ai commented on June 9, 2024
image

ok, it look that is a general issue. Probably from the latest version. I updated yesterday my version to the latest one

from n8n.

groundbreakersonline avatar groundbreakersonline commented on June 9, 2024

Same problem here in using any type o Summarization Chain (1.29.1) :

TypeError: message.toJSON is not a function
at /usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/utils/logWrapper.js:168:73
at Array.map ()
at Proxy.connectionType (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/utils/logWrapper.js:168:48)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at Proxy._generateUncached (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/langchain/node_modules/@langchain/core/dist/language_models/llms.cjs:138:22)
at LLMChain._call (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/langchain/dist/chains/llm_chain.cjs:157:37)
at LLMChain.call (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/langchain/dist/chains/base.cjs:120:28)
at StuffDocumentsChain._call (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/langchain/dist/chains/combine_docs_chain.cjs:62:24)
at StuffDocumentsChain.call (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/langchain/dist/chains/base.cjs:120:28)
at MapReduceDocumentsChain._call (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/langchain/dist/chains/combine_docs_chain.cjs:210:24)
at MapReduceDocumentsChain.call (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/langchain/dist/chains/base.cjs:120:28)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js:337:34)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:730:19)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:662:53
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1064:20

from n8n.

dkindlund avatar dkindlund commented on June 9, 2024

I'm also seeing the same error on [email protected]:

TypeError: message.toJSON is not a function
    at /usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/utils/logWrapper.js:168:73
    at Array.map (<anonymous>)
    at Proxy.connectionType (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/utils/logWrapper.js:168:48)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Proxy._generateUncached (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/langchain/node_modules/@langchain/core/dist/language_models/llms.cjs:138:22)
    at LLMChain._call (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/langchain/dist/chains/llm_chain.cjs:157:37)
    at LLMChain.call (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/langchain/dist/chains/base.cjs:120:28)
    at createSimpleLLMChain (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/ChainLLM/ChainLlm.node.js:84:23)
    at getChain (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/ChainLLM/ChainLlm.node.js:93:16)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/ChainLLM/ChainLlm.node.js:360:31)
    ```

from n8n.

dkindlund avatar dkindlund commented on June 9, 2024

^ This issue affects all LLM function -- including OpenAI (not just HuggingFace).

from n8n.

dkindlund avatar dkindlund commented on June 9, 2024

Pretty sure this is the line that the error is referring to:

: messages.map((message) => message.toJSON()),

from n8n.

Joffcom avatar Joffcom commented on June 9, 2024

We will look into this in the morning and potentially put out a new released for now though you can go back to a previous release and you should be good to go.

from n8n.

dkindlund avatar dkindlund commented on June 9, 2024

Getting a different error on [email protected] - FYI:

Error: Could not get parameter
    at getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1513:15)
    at Object.getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:2189:24)
    at getPromptInputByType (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/utils/helpers.js:29:24)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/ChainLLM/ChainLlm.node.js:396:61)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:730:19)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:662:53
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1064:20

from n8n.

dkindlund avatar dkindlund commented on June 9, 2024

Ironically, the Conversational Agent node works in [email protected] -- it's just the Basic LLM Chain node that appears to be broken.

from n8n.

dkindlund avatar dkindlund commented on June 9, 2024

Confirmed that this issue is not present in [email protected] -- it does presently exist in all later versions.

from n8n.

janober avatar janober commented on June 9, 2024

Fix got released with [email protected]

from n8n.

Joffcom avatar Joffcom commented on June 9, 2024

Good news, This should now be resolved. I am going to mark this as closed and if you are still seeing this issue let me know.

from n8n.

dkindlund avatar dkindlund commented on June 9, 2024

@Joffcom , no dice. I'm still seeing these errors using the Basic LLM Chain node in [email protected]. CC: @janober

Error: Could not get parameter
    at getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1514:15)
    at Object.getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:2190:24)
    at getPromptInputByType (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/utils/helpers.js:29:24)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/ChainLLM/ChainLlm.node.js:396:61)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:730:19)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:660:53
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1062:20

from n8n.

dkindlund avatar dkindlund commented on June 9, 2024

image

image

from n8n.

dkindlund avatar dkindlund commented on June 9, 2024

image

from n8n.

dkindlund avatar dkindlund commented on June 9, 2024

^ This workflow works fine on [email protected]

from n8n.

dkindlund avatar dkindlund commented on June 9, 2024

Hey @Joffcom and @janober , I think I sort of understand the issue.

This error appears only for legacy workflows and legacy nodes. If I create a brand new workflow with the same identical nodes, this error doesn't exist.

This tells me that there's some backwards compatibility issue that's breaking older workflows/nodes.

Steps to reproduce:

  1. Create a simple Basic LLM Chain workflow in [email protected]
  2. Upgrade to [email protected]
  3. Try to run your simple workflow -- see error

As it stands right now, if there's no way to "auto-upgrade" legacy workflows/nodes to support new 1.30.1+ features, then all your existing users will be experiencing this same pain along the way. I'm not sure how to solve this issue, but FYI.

Recreating the simple Basic LLM Chain workflow has no issues:
image

from n8n.

dkindlund avatar dkindlund commented on June 9, 2024

Oh, interesting... the newer Basic LLM Chain node in [email protected] does not have the Output Parser optional connector any more -- I don't know if that's intended or a possible secondary regression, @Joffcom . Compare the past couple of screenshots and you'll see what I mean.

from n8n.

dkindlund avatar dkindlund commented on June 9, 2024

Yup, confirmed. In [email protected]+, I had to manually regenerate the Basic LLM Chain node to get it to work. Here's the side-by-side comparison:

image

from n8n.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.