Good question! You could take a look at my newer article How to Build a Stock Tracker with Plotly and Flask where the callback function simple reads the value of each input and then constructs a response.
The article is here:
https://projectcodeed.blogspot.com/2021/07/how-to-build-stock-tracker-with-plotly.html
The code is on this page https://alanjones2.github.io/Flask-Plotly/
A more generic solution would be to have a list in input ids which the callback function would loop through getting each value and construction a response from them - the list could be constructed directly in JS on the client side or in Python on the server and transferred to the template when the page is loaded