More robust `default_from_dict`, `default_to_dict` that handle Secrets, StreamingCallbackT, Tool, Toolset automatically
Is your feature request related to a problem? Please describe.
When users create a custom component that accepts a Secret (an API key etc) in the init, they need to define from_dict and to_dict methods. In contrast, simpler custom components can directly use the default implementations default_from_dict and default_to_dict methods, making the implementation much more compact.
Describe the solution you'd like
We should provide more robust versions of default_from_dict, default_to_dict that automatically handle the (de-)serialization of components that have a Secret in the init.
Secrets can be a first example. Later, in a separate issue/PR, other functionality could follow, for example serialize_callable or serialize_tools_or_toolset.
If all three were covered by the default_from_dict and default_to_dict, the OpenAIChatGenerator for example wouldn't need a custom implementation of from_dict and to_dict.
self.document_store.to_dict(), is another example
In addition, it would be a great simplification for users if the @component decorator automatically adds to_dict and from_dict, which internally call component_from_dict, component_to_dict
Related https://github.com/deepset-ai/haystack/pull/9345#discussion_r2091046966