Providing Runtime Page Ranges for DoclingConverter in a Pipeline #11879
-
|
If I wish to have a pipeline which processes PDF files, I know I can instantiate a DoclingConverter component and provide page ranges I wish to processes via the convert_kwargs parameter. This is fine, if I am processing just a single file whose page ranges are a priory known. But what should I do if I have a bunch of files, each with their own page ranges which I only get to know at the time of pipeline execution? I understand that haystack allows one to provide runtime parameters when the pipeline is executed which can be used by the run method of the various components. Unfortunately I cannot pass convert_kwargs since it's only a parameter used to instantiate the DoclingConverter component and not exposed by the run method of the component. Surprisingly enough upon inspection of the source the convert_kwargs are only ever used within the run method of the DoclingConverter. Is there some solution which I am missing or should I write my own CustomDoclingConverter to realize this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Your reading is right: this is not a good fit for normal Pipeline runtime parameters as-is. Haystack runtime parameters can only be passed to inputs that a component exposes through its The options I would consider are:
I would avoid mutating one converter instance's So yes: for heterogeneous page ranges known only at execution time, a custom wrapper around If that matches your use case, please mark this as answered so others can find the runtime-parameter boundary quickly. |
Beta Was this translation helpful? Give feedback.
Your reading is right: this is not a good fit for normal Pipeline runtime parameters as-is.
Haystack runtime parameters can only be passed to inputs that a component exposes through its
run()signature.DoclingConverterexposesconvert_kwargsas constructor/configuration state, whilerun()is the conversion call. So if each source needs a differentpage_range, there is no clean built-in way to pass a per-fileconvert_kwargsmap into one sharedDoclingConverterinstance at pipeline execution time.The options I would consider are:
convert_kwargs.