You can achieve automatic document type recognition and extraction using Azure Cognitive Services, specifically the Form Recognizer service (AI document intelligence). Form Recognizer is designed to automatically extract key-value pairs from documents.
And yes it can handle different document types without sending every document to every model, you can train a custom model for each document type using the supervised learning capabilities of Form Recognizer.
a custom model is advised kindly go through this document for a more detailed approach
If you find this helpful, kindly accept the answer thanks much.