code: def _create_completions_endpoint(config: RouteConfig):
      prov = get_provider(config.model.provider)(config)
  
      async def _completions(
          payload: completions.RequestPayload,
      ) -> completions.ResponsePayload:
          return await prov.completions(payload)
  
      return _completions
  
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 a global function with example usage: _create_completions_endpoint(config) and returns: _completions, unknown