1. Learn
  2. /
  3. Courses
  4. /
  5. Deploying AI into Production with FastAPI

Connected

Exercise

Nesting models

You've been asked to create a schema for a batch job that executes a weather prediction model on a list of inputs and returns all the results in a list.

Instructions

100 XP
  • Import the class from typing that can be used for nested lists.
  • Create class BatchInput using BaseModel.
  • In the BatchInput model, complete the inputs field so that it has a list of ModelInput schemas.