haystack
haystack copied to clipboard
Handling Component inputs with default values must be done explicitly
The two data
dicts passed to a pipeline have different behaviours
This makes some components run twice
pipe_from_file.run(
{"prompt_builder": {"query": query},
"retriever": {'query': 'What is the capital of France?'}
}
)
whereas if we explicitly pass the None
values to some inputs makes the job of the Pipeline run()
method easier
pipe_from_file.run(
{"prompt_builder": {"query": query},
"retriever": {
'filters': None,
'query': 'What is the capital of France?',
'scale_score': None,
'top_k': None}
}
)
On way to solve this is to overwrite the data
dict at the beginning of the run
with all the parameters default/None parameters needed for a component.