docstr: Creates FastAPI app for `api_type`
  Args:
      api_type: Type of the API. See `API.available_api_types()`
      model: Any ML/DL model
      preprocess_fn: Override Data Preprocessing Function, data will
      be processed with this function
      before calling model.
      postprocess_fn: Override Data Postprocessing Function, model
      output will be passed into this function.
      **kwargs:
docstr_tok: ["Creates","FastAPI","app","for","`","api_type","`","Args",":","api_type",":","Type","of","the","API",".","See","`","API.available_api_types","(",")","`","model",":","Any","ML\/DL","model","preprocess_fn",":","Override","Data","Preprocessing","Function",",","data","will","be","processed","with","this","function","before","calling","model",".","postprocess_fn",":","Override","Data","Postprocessing","Function",",","model","output","will","be","passed","into","this","function",".","*","*","kwargs",":"]
code: def __init__(
      self,
      api_type: str,
      model: Callable,
      preprocess_fn: Optional[Callable] = None,
      preprocess_conf: Optional[Dict] = None,
      postprocess_fn: Optional[Callable] = None,
      postprocess_conf: Optional[Dict] = None,
      **kwargs,
  ):
      """
      Creates FastAPI app for `api_type`
      Args:
          api_type: Type of the API. See `API.available_api_types()`
          model: Any ML/DL model
          preprocess_fn: Override Data Preprocessing Function, data will
          be processed with this function
          before calling model.
          postprocess_fn: Override Data Postprocessing Function, model
          output will be passed into this function.
          **kwargs:
      """
      super(API, self).__init__(
          api_type, model, preprocess_fn, postprocess_fn, **kwargs
      )
  
      docs_url = kwargs.get("docs_url", "/docs")
      title = kwargs.get("title", "Chitra Model Server 🔥")
      desc = kwargs.get(
          "description",
          f"<a href={documentation_url}>Goto Chitra Docs</a> 🔗",
      )
  
      self.app: FastAPI = FastAPI(
          title=title, description=desc, docs_url=docs_url
      )
      if not preprocess_conf:
          preprocess_conf = {}
      if not postprocess_conf:
          postprocess_conf = {}
      self.preprocess_conf = preprocess_conf
      self.postprocess_conf = postprocess_conf
      self.setup(**kwargs)
  
file_path: chitra/chitra/serve/api.py
imports: from typing import Callable, Dict, Optional
  import uvicorn
  from fastapi import FastAPI, File, UploadFile
  from chitra.__about__ import documentation_url
  from chitra.serve import schema
  from chitra.serve.base import ModelServer
  from chitra.serve.constants import IMAGE_CLF, OBJECT_DETECTION, QNA, TXT_CLF
label_desc: Use image node_id 1 to create a new API object from inherited base classes: ModelServer with example: obj = API(api_type, model, preprocess_fn, preprocess_conf, postprocess_fn, postprocess_conf)