DocumentJoiner component's run method doesn't accept a top_k value #7702
Labels
Contributions wanted!
Looking for external contributions
good first issue
Good for newcomers
P3
Low priority, leave it in the backlog
Describe the bug
The
DocumentJoiner
component's run method doesn't allow you to pass a value for thetop_k
parameter, see here. If you try to do so, you'll get the following:ValueError: Input top_k not found in component joiner.
This means you can only pass a value for
top_k
when you initialize the component, and so you can't give it a value e.g. at query time usingpipe.run("DocumentJoiner": {"top_k": top_k})
if you use it in a query pipeline.Expected behavior
Providing this component with a
top_k
value in a pipeline using e.g.pipe.run("DocumentJoiner": {"top_k": top_k})
should not raise a ValueError.A simple change to the run method, adding
top_k
as an argument, and replacing these lines inside the function with the following should fix it:To Reproduce
Create a query pipeline containing a
DocumentJoiner
and run it usingpipe.run("DocumentJoiner": {"top_k": top_k})
.FAQ Check
The text was updated successfully, but these errors were encountered: