Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Update Langchain modules & add Ollama tools support #10208

Merged
merged 7 commits into from
Jul 26, 2024

Conversation

OlegIvaniv
Copy link
Contributor

@OlegIvaniv OlegIvaniv commented Jul 26, 2024

Summary

This PR updates Langchain and its related packages to the latest version. It also enables lmChatOllama to be used with the Tools agent.
Additionally, I had to update ts-ics package to 1.4.0 as the previous version was clashing with some other sub-deps with the following error:

n8n-nodes-base:build: Failed to load dist/nodes/Files/ExtractFromFile/ExtractFromFile.node.js: Package subpath './format/index.js' is not defined by "exports" in /Users/oleg/Projects/n8n/node_modules/.pnpm/date-fns-tz@2.0.0_date-fns@3.6.0/node_modules/date-fns/package.json undefined
n8n-nodes-base:build: Detected 418 nodes undefined
n8n-nodes-base:build: Detected 356 credentials undefined
n8n-nodes-base:build: Error loading node "ExtractFromFile" from: "/Users/oleg/Projects/n8n/packages/nodes-base/dist/nodes/Files/ExtractFromFile/ExtractFromFile.node.js" - Package subpath './format/index.js' is not defined by "exports" in /Users/oleg/Projects/n8n/node_modules/.pnpm/date-fns-tz@2.0.0_date-fns@3.6.0/node_modules/date-fns/package.json undefined
n8n-nodes-base:build: node:internal/modules/cjs/loader:553
n8n-nodes-base:build:       throw e;
n8n-nodes-base:build:       ^
n8n-nodes-base:build: 
n8n-nodes-base:build: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './format/index.js' is not defined by "exports" in /Users/oleg/Projects/n8n/node_modules/.pnpm/date-fns-tz@2.0.0_date-fns@3.6.0/node_modules/date-fns/package.json
n8n-nodes-base:build:     at new NodeError (node:internal/errors:406:5)
n8n-nodes-base:build:     at exportsNotFound (node:internal/modules/esm/resolve:268:10)
n8n-nodes-base:build:     at packageExportsResolve (node:internal/modules/esm/resolve:598:9)
n8n-nodes-base:build:     at resolveExports (node:internal/modules/cjs/loader:547:36)
n8n-nodes-base:build:     at Module._findPath (node:internal/modules/cjs/loader:621:31)
n8n-nodes-base:build:     at Module._resolveFilename (node:internal/modules/cjs/loader:1034:27)
n8n-nodes-base:build:     at Module._load (node:internal/modules/cjs/loader:901:27)
n8n-nodes-base:build:     at Module.require (node:internal/modules/cjs/loader:1115:19)
n8n-nodes-base:build:     at require (node:internal/modules/helpers:130:18)
n8n-nodes-base:build:     at Object.<anonymous> (/Users/oleg/Projects/n8n/node_modules/.pnpm/date-fns-tz@2.0.0_date-fns@3.6.0/node_modules/date-fns-tz/format/index.js:8:37) {
n8n-nodes-base:build:   code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
n8n-nodes-base:build: }
n8n-nodes-base:build: 

I ran WF tests and updated snapshots:

Execution finished.
Summary:
        Success: 19
        Failures: 0
        Warnings: 0

Nodes successfully tested:
        @n8n/n8n-nodes-langchain.lmChatMistralCloud: 1
        @n8n/n8n-nodes-langchain.chainLlm: 6
        n8n-nodes-base.manualTrigger: 18
        @n8n/n8n-nodes-langchain.lmOpenAi: 1
        @n8n/n8n-nodes-langchain.lmChatAzureOpenAi: 2
        n8n-nodes-base.set: 17
        @n8n/n8n-nodes-langchain.lmChatOpenAi: 19
        @n8n/n8n-nodes-langchain.toolCalculator: 5
        @n8n/n8n-nodes-langchain.outputParserStructured: 2
        @n8n/n8n-nodes-langchain.agent: 6
        n8n-nodes-base.code: 7
        @n8n/n8n-nodes-langchain.chainSummarization: 5
        @n8n/n8n-nodes-langchain.code: 5
        n8n-nodes-base.convertToFile: 1
        @n8n/n8n-nodes-langchain.lmChatAwsBedrock: 1
        @n8n/n8n-nodes-langchain.textSplitterTokenSplitter: 3
        @n8n/n8n-nodes-langchain.embeddingsOpenAi: 6
        @n8n/n8n-nodes-langchain.documentDefaultDataLoader: 2
        n8n-nodes-base.httpRequest: 1
        n8n-nodes-base.wait: 2
        @n8n/n8n-nodes-langchain.chainRetrievalQa: 2
        @n8n/n8n-nodes-langchain.retrieverVectorStore: 2
        @n8n/n8n-nodes-langchain.vectorStoreQdrant: 3
        @n8n/n8n-nodes-langchain.vectorStoreInMemory: 3
        n8n-nodes-base.executeWorkflowTrigger: 1
        n8n-nodes-base.switch: 1
        @n8n/n8n-nodes-langchain.toolWorkflow: 2

Related Linear tickets, Github issues, and Community forum posts

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@OlegIvaniv OlegIvaniv changed the title refactor: Update Langchain modules refactor: Update Langchain modules & add Ollama tools support Jul 26, 2024
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Jul 26, 2024
Copy link
Member

@netroy netroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

besides the one import comment, LGTM

@OlegIvaniv OlegIvaniv requested a review from netroy July 26, 2024 11:11
Copy link
Contributor

✅ All Cypress E2E specs passed

Copy link

cypress bot commented Jul 26, 2024

Passing run #6159 ↗︎

0 389 0 0 Flakiness 0

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 OlegIvaniv 🗃️ e2e/*
Project: n8n Commit: 855c1df2e7
Status: Passed Duration: 04:12 💡
Started: Jul 26, 2024 12:09 PM Ended: Jul 26, 2024 12:13 PM

Review all test suite changes for PR #10208 ↗︎

@netroy netroy merged commit 5a51b1d into master Jul 26, 2024
27 checks passed
@netroy netroy deleted the update_langchain branch July 26, 2024 12:30
MiloradFilipovic added a commit that referenced this pull request Jul 29, 2024
* master:
  feat(HTTP Request Node): Add option to disable lowercase headers (#10154)
  feat: Recovery option for jsonParse helper (#10182)
  fix: Better error message when calling data transformation functions on a null value (#10210)
  refactor: Delete mistakenly commited node file (no-changelog) (#10213)
  refactor(editor): Add Infisical deprecation notice (#10191)
  feat(editor): Show new executions as `Queued` in the UI, until they actually start (#10204)
  refactor: Update Langchain modules & add Ollama tools support (#10208)
  feat(Sentiment Analysis Node): Implement Sentiment Analysis node (#10184)
  fix: Add original error message to messages, do not obfuscate if description provided in options (no-changelog) (#10202)
  fix(Google Sheets Node): Fix Google Sheet URL regex (#10195)
  fix(Google Sheets Node): Add column names row if sheet is empty (#10200)
  fix(Google Sheets Node): Do not insert row_number as a new column, do not checkForSchemaChanges in update operation (#10201)
  docs: Update credential urls (no-changelog) (#10193)
  fix(editor): Add back prompt requesting to save unsaved changes (no-changelog) (#10190)
  fix(HTTP Request Node): Resolve max pages expression (#10192)
@janober
Copy link
Member

janober commented Jul 31, 2024

Got released with n8n@1.53.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants