code: def set_dynamic_routes(self, config: GatewayConfig) -> None:
      self.dynamic_routes.clear()
      for route in config.routes:
          self.add_api_route(
              path=(
                  MLFLOW_DEPLOYMENTS_ENDPOINTS_BASE
                  + route.name
                  + MLFLOW_DEPLOYMENTS_QUERY_SUFFIX
              ),
              endpoint=_route_type_to_endpoint(route),
              methods=["POST"],
          )
          # TODO: Remove Gateway server URLs after deprecation window elapses
          self.add_api_route(
              path=f"{MLFLOW_GATEWAY_ROUTE_BASE}{route.name}{MLFLOW_QUERY_SUFFIX}",
              endpoint=_route_type_to_endpoint(route),
              methods=["POST"],
              include_in_schema=False,
          )
          self.dynamic_routes[route.name] = route.to_route()
  
imports: import logging
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Union
  from fastapi import FastAPI, HTTPException, Request
  from fastapi.openapi.docs import get_swagger_ui_html
  from fastapi.responses import FileResponse, RedirectResponse
  from pydantic import BaseModel
  from mlflow.deployments.server.config import Endpoint
  from mlflow.deployments.server.constants import MLFLOW_DEPLOYMENTS_CRUD_ENDPOINT_BASE, MLFLOW_DEPLOYMENTS_ENDPOINTS_BASE, MLFLOW_DEPLOYMENTS_HEALTH_ENDPOINT, MLFLOW_DEPLOYMENTS_LIMITS_BASE, MLFLOW_DEPLOYMENTS_LIST_ENDPOINTS_PAGE_SIZE, MLFLOW_DEPLOYMENTS_QUERY_SUFFIX
  from mlflow.environment_variables import MLFLOW_DEPLOYMENTS_CONFIG
  from mlflow.exceptions import MlflowException
  from mlflow.gateway.base_models import SetLimitsModel
  from mlflow.gateway.config import GatewayConfig, LimitsConfig, Route, RouteConfig, RouteType, _load_route_config
  from mlflow.gateway.constants import MLFLOW_GATEWAY_CRUD_ROUTE_BASE, MLFLOW_GATEWAY_HEALTH_ENDPOINT, MLFLOW_GATEWAY_LIMITS_BASE, MLFLOW_GATEWAY_ROUTE_BASE, MLFLOW_GATEWAY_SEARCH_ROUTES_PAGE_SIZE, MLFLOW_QUERY_SUFFIX
  from mlflow.gateway.providers import get_provider
  from mlflow.gateway.schemas import chat, completions, embeddings
  from mlflow.gateway.utils import SearchRoutesToken
  from mlflow.version import VERSION
label_desc: Use image node_id 2 for calling the GatewayAPI obj's underlying member method code with example usage: obj.set_dynamic_routes(config) without return types