-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix: Fix pipeline with join node #7510
Conversation
It seems like the mypy error is unrelated to changes made in this PR
|
@sjrl I'm trying to fix the mypy error. I would prefer that this PR be reviewed by someone who knows the 1.x Pipeline run logic better than I do. |
@tstadel I added a out["_debug"]["QueryPromptNode"]
{'input': {'query': 'What is the captial of Grmny?', 'debug': True},
'output': {'results': ['What is the capital of Germany?'],
'invocation_context': {'query': 'What is the captial of Grmny?',
'results': ['What is the capital of Germany?'],
'prompts': ['You are a spell checker. Given a user query return the same query with all spelling errors fixed.\nUser Query: What is the captial of Grmny?\nSpell Checked Query:']}},
'runtime': {'prompts_used': ['You are a spell checker. Given a user query return the same query with all spelling errors fixed.\nUser Query: What is the captial of Grmny?\nSpell Checked Query:']},
'exec_time_ms': 540.78} gives the expected debug output. Without the shaper change in particular you get
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the additional invocation_context fix and test! Looking very good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tstadel thanks for your help!
I left a comment about the release note.
When all is good, feel free to merge.
releasenotes/notes/fix-pipeline-with-join-node-5f23a426cd4d88d9.yaml
Outdated
Show resolved
Hide resolved
Nice! I just checked. This PR will fix the issue regarding batch debug output of nodes previous to JoinNode reported in #2962 (comment) 🎉 |
Co-authored-by: tstadel <[email protected]>
…aystack into fix-pipeline-with-join-node
* Update Pipeline.run method to pass on more info when using join node * Add release notes * Update docs and update _arun method as well * Added support for unique keys * Simplify the method * fix mypy error * ignore mypy in image converter * Ignore mypy warning * Update _debug as well when there are more than two streams being joined. * Add copy to invocation_context instead of overwriting * Fix the copy * Add copy to Shaper as well * Add another test to make sure query stays changed * Updated test to make sure that it does only pass with the new changes * Add to run_batch as well * Fix type annotations * Make join nodes work when no docs are provided * Ignore pylint error * Update haystack/nodes/other/join_docs.py Co-authored-by: tstadel <[email protected]> * Expand on release note * Fix test --------- Co-authored-by: Stefano Fiorucci <[email protected]> Co-authored-by: tstadel <[email protected]>
Related Issues
Proposed Changes:
We have started to develop multi prompt node pipelines for clients. Some of the most popular ones include rewriting the query during the pipeline execution. Here is a simple example using a PromptNode as a spell checker for the incoming user query.
The issue is that the
query
used in the second prompt node (qa_prompt_node
) is the original query and not the one rewritten by the first prompt node (query_prompt_node
). This has to do with how information thePipeline.run
method passes throughJoinNodes
specifically.This PR fixes this issue by updating the
Pipeline.run
method to properly passnode_output
information through aJoinNode
.How did you test it?
Notes for the reviewer
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.