code: def redirect_root_to_docs(
      fast_app: FastAPI, func_name: str, endpoint: str, method: str
  ) -> None:
      """Adds api route to server that redirects user from root to docs with opened `endpoint` description."""
  
      @fast_app.get("/", include_in_schema=False)
      async def redirect_to_docs() -> RedirectResponse:
          operation_id = generate_operation_id_for_path(
              name=func_name, path=endpoint, method=method
          )
          response = RedirectResponse(
              url=f"/docs#/default/{operation_id}"
          )
          return response
  
imports: import asyncio
  import os
  from collections import namedtuple
  from logging import getLogger
  from pathlib import Path
  from ssl import PROTOCOL_TLSv1_2
  from typing import Dict, List, Optional, Union
  import uvicorn
  from fastapi import Body, FastAPI, HTTPException
  from fastapi.utils import generate_operation_id_for_path
  from pydantic import BaseConfig, BaseModel
  from pydantic.fields import Field, ModelField
  from pydantic.main import ModelMetaclass
  from starlette.middleware.cors import CORSMiddleware
  from starlette.responses import RedirectResponse
  from deeppavlov.core.commands.infer import build_model
  from deeppavlov.core.commands.utils import parse_config
  from deeppavlov.core.common.chainer import Chainer
  from deeppavlov.core.common.file import read_json
  from deeppavlov.core.common.log import log_config
  from deeppavlov.core.common.paths import get_settings_path
  from deeppavlov.core.data.utils import check_nested_dict_keys, jsonify_data
  from deeppavlov.utils.connector import DialogLogger
  from deeppavlov.utils.server.metrics import metrics, PrometheusMiddleware
label_desc: Use image node_id 3 for calling a global function with example usage: redirect_root_to_docs(fast_app, func_name, endpoint, method) and returns: response