def __init__(
        self,
        path: str,
        endpoint: Callable[..., Any],
        *,
        response_model: Any = Default(None),
        **kwargs: dict[str, Any],
    ) -> None:
        """Constructor method.

        Args:
            path: The path for the route.
            endpoint: The endpoint to call when the route is requested.
            response_model: The response model to use for the route.
            **kwargs: Keyword arguments to pass to the parent constructor.
        """
        # NOTE: LangchainAPIRoute is initialised again when
        # router is included in app. This is a hack to
        # build the factory endpoint only once.
        if not inspect.iscoroutinefunction(endpoint):
            factory_endpoint = build_factory_api_endpoint(path, endpoint)
            super().__init__(
                path, factory_endpoint, response_model=response_model, **kwargs
            )
        else:
            super().__init__(path, endpoint, response_model=response_model, **kwargs)
Constructor method.

        Args:
            path: The path for the route.
            endpoint: The endpoint to call when the route is requested.
            response_model: The response model to use for the route.
            **kwargs: Keyword arguments to pass to the parent constructor.
        
lanarky/adapters/langchain/routing.py