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(Question and Answer Chain Node): Use new LangChain's syntax #13868

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

burivuhster
Copy link
Contributor

Summary

RetrievalQAChain.fromLLM is deprecated and will be removed in LangChain 1.0.0.
This PR updates the QA Chain node to use the newer syntax recommended by LangChain

The retrieval chain created with createRetrievalChain expects users query in {input} template parameter, while previously RetrievalQAChain expected {question} parameter.

Also, updated version does not wrap the result in an object { text: '...' } and returns a plain text.

As those changes are not backwards compatible, the new version of the node introduced (1.5).

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)

Copy link

codecov bot commented Mar 12, 2025

Codecov Report

Attention: Patch coverage is 0% with 27 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...s/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts 0.00% 27 Missing ⚠️

📢 Thoughts on this report? Let us know!

@n8n-assistant n8n-assistant bot added the n8n team Authored by the n8n team label Mar 12, 2025
@burivuhster burivuhster marked this pull request as ready for review March 12, 2025 16:32
@burivuhster burivuhster requested a review from OlegIvaniv March 12, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant