FastAPI inputs check format and execute according method for that given format
You can create a pydantic scheme as a dependency, that includes all the possible fields (Optional) for both data types and check incoming data by special field into it. Also you can use different routes. Could you show JSON samples?
I am using FastAPI for Machine Learning model deployment in two cases based on the nature of the data we feed as inputs (features) which it an array of json. Thus, if inputs are matching method1 we execute the according model to it otherwise we apply method2 and execute the trained model for this case.
How can I achieve this process using FastAPI ? (process of verifieng the input data and apply the matching model for that data)