Auto creation of input and output mappings could handle conflicts by creating new entries
Auto Input Mapping Creation
In SuperComponents if an input mapping is not provided by the user we automatically create one. However, the way we try to create one tries to combine all variables of the same name together. E.g. If my pipeline has a BM25Retriever (takes in query) and a PromptBuilder (also takes query) it will try to make the mapping of input_mapping = {"query": ["BM25Retriever.query", "PromptBuilder.query"]} as long as the types of BM25Retriever.query and PromptBuilder.query are compatible.
If they aren't compatible then an error is thrown. I wonder if instead of throwing an error we should instead make a new entry in the input_mapping. So let's pretend the two query types aren't compatible then we could have input_mapping = {"BM25Retriever_query": ["BM25Retriever.query"], "PromptBuilder_query": ["PromptBuilder.query"]} instead.
Auto Output Mapping Creation
Also similar idea for the automatic creation of the output_mapping. Right now we throw an error if two outputs (e.g. documents from two different components) have the same name. Instead of throwing an error we could create new names to handle multiple sets of documents being returned.
@julian-risch I'm wondering about closing this. This doesn't seem to have come up in practice and perhaps throwing an error makes sense to encourage the user to create their own mapping which is often the case when SuperComponent is used. WDYT?