We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Docs:  Build errors
### Summary

```
/home/peter/PycharmProjects/litestar/litestar/plugins/base.py:docstring of litestar.plugins.base.InitPluginProtocol.on_app_init:5: ERROR: Error in "code-block" directive:
maximum 1 argument(s) allowed, 14 supplied.

.. code-block:: python
    from litestar import Litestar, get
    from litestar.di import Provide
    from litestar.plugins import InitPluginProtocol


    def get_name() -> str:
        return "world"


    @get("/my-path")
    def my_route_handler(name: str) -> dict[str, str]:
        return {"hello": name}


    class MyPlugin(InitPluginProtocol):
        def on_app_init(self, app_config: AppConfig) -> AppConfig:
            app_config.dependencies["name"] = Provide(get_name)
            app_config.route_handlers.append(my_route_handler)
            return app_config


    app = Litestar(plugins=[MyPlugin()])
```

And

```
/home/peter/PycharmProjects/litestar/docs/topics/deployment/manually-with-asgi-server.rst:2: WARNING: Title underline too short.

Manually with ASGI server
==========
```

<!-- POLAR PLEDGE BADGE START -->
---
> [!NOTE]  
> While we are open for sponsoring on [GitHub Sponsors](https://github.com/sponsors/litestar-org/) and 
> [OpenCollective](https://opencollective.com/litestar), we also utilize [Polar.sh](https://polar.sh/) to engage in pledge-based sponsorship.
>
> Check out all issues funded or available for funding [on our Polar.sh Litestar dashboard](https://polar.sh/litestar-org)
> * If you would like to see an issue prioritized, make a pledge towards it!
> * We receive the pledge once the issue is completed & verified
> * This, along with engagement in the community, helps us know which features are a priority to our users.

<a href="https://polar.sh/litestar-org/litestar/issues/2680">
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/api/github/litestar-org/litestar/issues/2680/pledge.svg?darkmode=1">
  <img alt="Fund with Polar" src="https://polar.sh/api/github/litestar-org/litestar/issues/2680/pledge.svg">
</picture>
</a>
<!-- POLAR PLEDGE BADGE END -->


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `litestar/plugins/base.py`
Content:
```
1 from __future__ import annotations
2 
3 from typing import TYPE_CHECKING, Any, Iterator, Protocol, TypeVar, Union, cast, runtime_checkable
4 
5 if TYPE_CHECKING:
6     from click import Group
7 
8     from litestar._openapi.schema_generation import SchemaCreator
9     from litestar.config.app import AppConfig
10     from litestar.dto import AbstractDTO
11     from litestar.openapi.spec import Schema
12     from litestar.typing import FieldDefinition
13 
14 __all__ = (
15     "SerializationPluginProtocol",
16     "InitPluginProtocol",
17     "OpenAPISchemaPluginProtocol",
18     "OpenAPISchemaPlugin",
19     "PluginProtocol",
20     "CLIPluginProtocol",
21     "PluginRegistry",
22 )
23 
24 
25 @runtime_checkable
26 class InitPluginProtocol(Protocol):
27     """Protocol used to define plugins that affect the application's init process."""
28 
29     __slots__ = ()
30 
31     def on_app_init(self, app_config: AppConfig) -> AppConfig:
32         """Receive the :class:`AppConfig<.config.app.AppConfig>` instance after `on_app_init` hooks have been called.
33 
34         Examples:
35             .. code-block:: python
36                 from litestar import Litestar, get
37                 from litestar.di import Provide
38                 from litestar.plugins import InitPluginProtocol
39 
40 
41                 def get_name() -> str:
42                     return "world"
43 
44 
45                 @get("/my-path")
46                 def my_route_handler(name: str) -> dict[str, str]:
47                     return {"hello": name}
48 
49 
50                 class MyPlugin(InitPluginProtocol):
51                     def on_app_init(self, app_config: AppConfig) -> AppConfig:
52                         app_config.dependencies["name"] = Provide(get_name)
53                         app_config.route_handlers.append(my_route_handler)
54                         return app_config
55 
56 
57                 app = Litestar(plugins=[MyPlugin()])
58 
59         Args:
60             app_config: The :class:`AppConfig <litestar.config.app.AppConfig>` instance.
61 
62         Returns:
63             The app config object.
64         """
65         return app_config  # pragma: no cover
66 
67 
68 @runtime_checkable
69 class CLIPluginProtocol(Protocol):
70     """Plugin protocol to extend the CLI."""
71 
72     def on_cli_init(self, cli: Group) -> None:
73         """Called when the CLI is initialized.
74 
75         This can be used to extend or override existing commands.
76 
77         Args:
78             cli: The root :class:`click.Group` of the Litestar CLI
79 
80         Examples:
81             .. code-block:: python
82 
83                 from litestar import Litestar
84                 from litestar.plugins import CLIPluginProtocol
85                 from click import Group
86 
87 
88                 class CLIPlugin(CLIPluginProtocol):
89                     def on_cli_init(self, cli: Group) -> None:
90                         @cli.command()
91                         def is_debug_mode(app: Litestar):
92                             print(app.debug)
93 
94 
95                 app = Litestar(plugins=[CLIPlugin()])
96         """
97 
98 
99 @runtime_checkable
100 class SerializationPluginProtocol(Protocol):
101     """Protocol used to define a serialization plugin for DTOs."""
102 
103     __slots__ = ()
104 
105     def supports_type(self, field_definition: FieldDefinition) -> bool:
106         """Given a value of indeterminate type, determine if this value is supported by the plugin.
107 
108         Args:
109             field_definition: A parsed type.
110 
111         Returns:
112             Whether the type is supported by the plugin.
113         """
114         raise NotImplementedError()
115 
116     def create_dto_for_type(self, field_definition: FieldDefinition) -> type[AbstractDTO]:
117         """Given a parsed type, create a DTO class.
118 
119         Args:
120             field_definition: A parsed type.
121 
122         Returns:
123             A DTO class.
124         """
125         raise NotImplementedError()
126 
127 
128 @runtime_checkable
129 class OpenAPISchemaPluginProtocol(Protocol):
130     """Plugin protocol to extend the support of OpenAPI schema generation for non-library types."""
131 
132     __slots__ = ()
133 
134     @staticmethod
135     def is_plugin_supported_type(value: Any) -> bool:
136         """Given a value of indeterminate type, determine if this value is supported by the plugin.
137 
138         Args:
139             value: An arbitrary value.
140 
141         Returns:
142             A typeguard dictating whether the value is supported by the plugin.
143         """
144         raise NotImplementedError()
145 
146     def to_openapi_schema(self, field_definition: FieldDefinition, schema_creator: SchemaCreator) -> Schema:
147         """Given a type annotation, transform it into an OpenAPI schema class.
148 
149         Args:
150             field_definition: An :class:`OpenAPI <litestar.openapi.spec.schema.Schema>` instance.
151             schema_creator: An instance of the openapi SchemaCreator.
152 
153         Returns:
154             An :class:`OpenAPI <litestar.openapi.spec.schema.Schema>` instance.
155         """
156         raise NotImplementedError()
157 
158 
159 class OpenAPISchemaPlugin(OpenAPISchemaPluginProtocol):
160     """Plugin to extend the support of OpenAPI schema generation for non-library types."""
161 
162     @staticmethod
163     def is_undefined_sentinel(value: Any) -> bool:
164         """Return ``True`` if ``value`` should be treated as an undefined field"""
165         return False
166 
167     @staticmethod
168     def is_constrained_field(field_definition: FieldDefinition) -> bool:
169         """Return ``True`` if the field should be treated as constrained. If returning
170         ``True``, constraints should be defined in the field's extras
171         """
172         return False
173 
174 
175 PluginProtocol = Union[
176     SerializationPluginProtocol,
177     InitPluginProtocol,
178     OpenAPISchemaPluginProtocol,
179     OpenAPISchemaPlugin,
180     CLIPluginProtocol,
181 ]
182 
183 PluginT = TypeVar("PluginT", bound=PluginProtocol)
184 
185 
186 class PluginRegistry:
187     __slots__ = {
188         "init": "Plugins that implement the InitPluginProtocol",
189         "openapi": "Plugins that implement the OpenAPISchemaPluginProtocol",
190         "serialization": "Plugins that implement the SerializationPluginProtocol",
191         "cli": "Plugins that implement the CLIPluginProtocol",
192         "_plugins_by_type": None,
193         "_plugins": None,
194         "_get_plugins_of_type": None,
195     }
196 
197     def __init__(self, plugins: list[PluginProtocol]) -> None:
198         self._plugins_by_type = {type(p): p for p in plugins}
199         self._plugins = frozenset(plugins)
200         self.init = tuple(p for p in plugins if isinstance(p, InitPluginProtocol))
201         self.openapi = tuple(p for p in plugins if isinstance(p, OpenAPISchemaPluginProtocol))
202         self.serialization = tuple(p for p in plugins if isinstance(p, SerializationPluginProtocol))
203         self.cli = tuple(p for p in plugins if isinstance(p, CLIPluginProtocol))
204 
205     def get(self, type_: type[PluginT]) -> PluginT:
206         """Return the registered plugin of ``type_``.
207 
208         This should be used with subclasses of the plugin protocols.
209         """
210         try:
211             return cast(PluginT, self._plugins_by_type[type_])  # type: ignore[index]
212         except KeyError as e:
213             raise KeyError(f"No plugin of type {type_.__name__!r} registered") from e
214 
215     def __iter__(self) -> Iterator[PluginProtocol]:
216         return iter(self._plugins)
217 
218     def __contains__(self, item: PluginProtocol) -> bool:
219         return item in self._plugins
220
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/litestar/plugins/base.py b/litestar/plugins/base.py
--- a/litestar/plugins/base.py
+++ b/litestar/plugins/base.py
@@ -33,6 +33,7 @@
 
         Examples:
             .. code-block:: python
+
                 from litestar import Litestar, get
                 from litestar.di import Provide
                 from litestar.plugins import InitPluginProtocol

{"golden_diff": "diff --git a/litestar/plugins/base.py b/litestar/plugins/base.py\n--- a/litestar/plugins/base.py\n+++ b/litestar/plugins/base.py\n@@ -33,6 +33,7 @@\n \n         Examples:\n             .. code-block:: python\n+\n                 from litestar import Litestar, get\n                 from litestar.di import Provide\n                 from litestar.plugins import InitPluginProtocol\n", "issue": "Docs:  Build errors\n### Summary\n\n```\r\n/home/peter/PycharmProjects/litestar/litestar/plugins/base.py:docstring of litestar.plugins.base.InitPluginProtocol.on_app_init:5: ERROR: Error in \"code-block\" directive:\r\nmaximum 1 argument(s) allowed, 14 supplied.\r\n\r\n.. code-block:: python\r\n    from litestar import Litestar, get\r\n    from litestar.di import Provide\r\n    from litestar.plugins import InitPluginProtocol\r\n\r\n\r\n    def get_name() -> str:\r\n        return \"world\"\r\n\r\n\r\n    @get(\"/my-path\")\r\n    def my_route_handler(name: str) -> dict[str, str]:\r\n        return {\"hello\": name}\r\n\r\n\r\n    class MyPlugin(InitPluginProtocol):\r\n        def on_app_init(self, app_config: AppConfig) -> AppConfig:\r\n            app_config.dependencies[\"name\"] = Provide(get_name)\r\n            app_config.route_handlers.append(my_route_handler)\r\n            return app_config\r\n\r\n\r\n    app = Litestar(plugins=[MyPlugin()])\r\n```\r\n\r\nAnd\r\n\r\n```\r\n/home/peter/PycharmProjects/litestar/docs/topics/deployment/manually-with-asgi-server.rst:2: WARNING: Title underline too short.\r\n\r\nManually with ASGI server\r\n==========\r\n```\n\n<!-- POLAR PLEDGE BADGE START -->\n---\n> [!NOTE]  \n> While we are open for sponsoring on [GitHub Sponsors](https://github.com/sponsors/litestar-org/) and \n> [OpenCollective](https://opencollective.com/litestar), we also utilize [Polar.sh](https://polar.sh/) to engage in pledge-based sponsorship.\n>\n> Check out all issues funded or available for funding [on our Polar.sh Litestar dashboard](https://polar.sh/litestar-org)\n> * If you would like to see an issue prioritized, make a pledge towards it!\n> * We receive the pledge once the issue is completed & verified\n> * This, along with engagement in the community, helps us know which features are a priority to our users.\n\n<a href=\"https://polar.sh/litestar-org/litestar/issues/2680\">\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://polar.sh/api/github/litestar-org/litestar/issues/2680/pledge.svg?darkmode=1\">\n  <img alt=\"Fund with Polar\" src=\"https://polar.sh/api/github/litestar-org/litestar/issues/2680/pledge.svg\">\n</picture>\n</a>\n<!-- POLAR PLEDGE BADGE END -->\n\n", "before_files": [{"content": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING, Any, Iterator, Protocol, TypeVar, Union, cast, runtime_checkable\n\nif TYPE_CHECKING:\n    from click import Group\n\n    from litestar._openapi.schema_generation import SchemaCreator\n    from litestar.config.app import AppConfig\n    from litestar.dto import AbstractDTO\n    from litestar.openapi.spec import Schema\n    from litestar.typing import FieldDefinition\n\n__all__ = (\n    \"SerializationPluginProtocol\",\n    \"InitPluginProtocol\",\n    \"OpenAPISchemaPluginProtocol\",\n    \"OpenAPISchemaPlugin\",\n    \"PluginProtocol\",\n    \"CLIPluginProtocol\",\n    \"PluginRegistry\",\n)\n\n\n@runtime_checkable\nclass InitPluginProtocol(Protocol):\n    \"\"\"Protocol used to define plugins that affect the application's init process.\"\"\"\n\n    __slots__ = ()\n\n    def on_app_init(self, app_config: AppConfig) -> AppConfig:\n        \"\"\"Receive the :class:`AppConfig<.config.app.AppConfig>` instance after `on_app_init` hooks have been called.\n\n        Examples:\n            .. code-block:: python\n                from litestar import Litestar, get\n                from litestar.di import Provide\n                from litestar.plugins import InitPluginProtocol\n\n\n                def get_name() -> str:\n                    return \"world\"\n\n\n                @get(\"/my-path\")\n                def my_route_handler(name: str) -> dict[str, str]:\n                    return {\"hello\": name}\n\n\n                class MyPlugin(InitPluginProtocol):\n                    def on_app_init(self, app_config: AppConfig) -> AppConfig:\n                        app_config.dependencies[\"name\"] = Provide(get_name)\n                        app_config.route_handlers.append(my_route_handler)\n                        return app_config\n\n\n                app = Litestar(plugins=[MyPlugin()])\n\n        Args:\n            app_config: The :class:`AppConfig <litestar.config.app.AppConfig>` instance.\n\n        Returns:\n            The app config object.\n        \"\"\"\n        return app_config  # pragma: no cover\n\n\n@runtime_checkable\nclass CLIPluginProtocol(Protocol):\n    \"\"\"Plugin protocol to extend the CLI.\"\"\"\n\n    def on_cli_init(self, cli: Group) -> None:\n        \"\"\"Called when the CLI is initialized.\n\n        This can be used to extend or override existing commands.\n\n        Args:\n            cli: The root :class:`click.Group` of the Litestar CLI\n\n        Examples:\n            .. code-block:: python\n\n                from litestar import Litestar\n                from litestar.plugins import CLIPluginProtocol\n                from click import Group\n\n\n                class CLIPlugin(CLIPluginProtocol):\n                    def on_cli_init(self, cli: Group) -> None:\n                        @cli.command()\n                        def is_debug_mode(app: Litestar):\n                            print(app.debug)\n\n\n                app = Litestar(plugins=[CLIPlugin()])\n        \"\"\"\n\n\n@runtime_checkable\nclass SerializationPluginProtocol(Protocol):\n    \"\"\"Protocol used to define a serialization plugin for DTOs.\"\"\"\n\n    __slots__ = ()\n\n    def supports_type(self, field_definition: FieldDefinition) -> bool:\n        \"\"\"Given a value of indeterminate type, determine if this value is supported by the plugin.\n\n        Args:\n            field_definition: A parsed type.\n\n        Returns:\n            Whether the type is supported by the plugin.\n        \"\"\"\n        raise NotImplementedError()\n\n    def create_dto_for_type(self, field_definition: FieldDefinition) -> type[AbstractDTO]:\n        \"\"\"Given a parsed type, create a DTO class.\n\n        Args:\n            field_definition: A parsed type.\n\n        Returns:\n            A DTO class.\n        \"\"\"\n        raise NotImplementedError()\n\n\n@runtime_checkable\nclass OpenAPISchemaPluginProtocol(Protocol):\n    \"\"\"Plugin protocol to extend the support of OpenAPI schema generation for non-library types.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def is_plugin_supported_type(value: Any) -> bool:\n        \"\"\"Given a value of indeterminate type, determine if this value is supported by the plugin.\n\n        Args:\n            value: An arbitrary value.\n\n        Returns:\n            A typeguard dictating whether the value is supported by the plugin.\n        \"\"\"\n        raise NotImplementedError()\n\n    def to_openapi_schema(self, field_definition: FieldDefinition, schema_creator: SchemaCreator) -> Schema:\n        \"\"\"Given a type annotation, transform it into an OpenAPI schema class.\n\n        Args:\n            field_definition: An :class:`OpenAPI <litestar.openapi.spec.schema.Schema>` instance.\n            schema_creator: An instance of the openapi SchemaCreator.\n\n        Returns:\n            An :class:`OpenAPI <litestar.openapi.spec.schema.Schema>` instance.\n        \"\"\"\n        raise NotImplementedError()\n\n\nclass OpenAPISchemaPlugin(OpenAPISchemaPluginProtocol):\n    \"\"\"Plugin to extend the support of OpenAPI schema generation for non-library types.\"\"\"\n\n    @staticmethod\n    def is_undefined_sentinel(value: Any) -> bool:\n        \"\"\"Return ``True`` if ``value`` should be treated as an undefined field\"\"\"\n        return False\n\n    @staticmethod\n    def is_constrained_field(field_definition: FieldDefinition) -> bool:\n        \"\"\"Return ``True`` if the field should be treated as constrained. If returning\n        ``True``, constraints should be defined in the field's extras\n        \"\"\"\n        return False\n\n\nPluginProtocol = Union[\n    SerializationPluginProtocol,\n    InitPluginProtocol,\n    OpenAPISchemaPluginProtocol,\n    OpenAPISchemaPlugin,\n    CLIPluginProtocol,\n]\n\nPluginT = TypeVar(\"PluginT\", bound=PluginProtocol)\n\n\nclass PluginRegistry:\n    __slots__ = {\n        \"init\": \"Plugins that implement the InitPluginProtocol\",\n        \"openapi\": \"Plugins that implement the OpenAPISchemaPluginProtocol\",\n        \"serialization\": \"Plugins that implement the SerializationPluginProtocol\",\n        \"cli\": \"Plugins that implement the CLIPluginProtocol\",\n        \"_plugins_by_type\": None,\n        \"_plugins\": None,\n        \"_get_plugins_of_type\": None,\n    }\n\n    def __init__(self, plugins: list[PluginProtocol]) -> None:\n        self._plugins_by_type = {type(p): p for p in plugins}\n        self._plugins = frozenset(plugins)\n        self.init = tuple(p for p in plugins if isinstance(p, InitPluginProtocol))\n        self.openapi = tuple(p for p in plugins if isinstance(p, OpenAPISchemaPluginProtocol))\n        self.serialization = tuple(p for p in plugins if isinstance(p, SerializationPluginProtocol))\n        self.cli = tuple(p for p in plugins if isinstance(p, CLIPluginProtocol))\n\n    def get(self, type_: type[PluginT]) -> PluginT:\n        \"\"\"Return the registered plugin of ``type_``.\n\n        This should be used with subclasses of the plugin protocols.\n        \"\"\"\n        try:\n            return cast(PluginT, self._plugins_by_type[type_])  # type: ignore[index]\n        except KeyError as e:\n            raise KeyError(f\"No plugin of type {type_.__name__!r} registered\") from e\n\n    def __iter__(self) -> Iterator[PluginProtocol]:\n        return iter(self._plugins)\n\n    def __contains__(self, item: PluginProtocol) -> bool:\n        return item in self._plugins\n", "path": "litestar/plugins/base.py"}], "after_files": [{"content": "from __future__ import annotations\n\nfrom typing import TYPE_CHECKING, Any, Iterator, Protocol, TypeVar, Union, cast, runtime_checkable\n\nif TYPE_CHECKING:\n    from click import Group\n\n    from litestar._openapi.schema_generation import SchemaCreator\n    from litestar.config.app import AppConfig\n    from litestar.dto import AbstractDTO\n    from litestar.openapi.spec import Schema\n    from litestar.typing import FieldDefinition\n\n__all__ = (\n    \"SerializationPluginProtocol\",\n    \"InitPluginProtocol\",\n    \"OpenAPISchemaPluginProtocol\",\n    \"OpenAPISchemaPlugin\",\n    \"PluginProtocol\",\n    \"CLIPluginProtocol\",\n    \"PluginRegistry\",\n)\n\n\n@runtime_checkable\nclass InitPluginProtocol(Protocol):\n    \"\"\"Protocol used to define plugins that affect the application's init process.\"\"\"\n\n    __slots__ = ()\n\n    def on_app_init(self, app_config: AppConfig) -> AppConfig:\n        \"\"\"Receive the :class:`AppConfig<.config.app.AppConfig>` instance after `on_app_init` hooks have been called.\n\n        Examples:\n            .. code-block:: python\n\n                from litestar import Litestar, get\n                from litestar.di import Provide\n                from litestar.plugins import InitPluginProtocol\n\n\n                def get_name() -> str:\n                    return \"world\"\n\n\n                @get(\"/my-path\")\n                def my_route_handler(name: str) -> dict[str, str]:\n                    return {\"hello\": name}\n\n\n                class MyPlugin(InitPluginProtocol):\n                    def on_app_init(self, app_config: AppConfig) -> AppConfig:\n                        app_config.dependencies[\"name\"] = Provide(get_name)\n                        app_config.route_handlers.append(my_route_handler)\n                        return app_config\n\n\n                app = Litestar(plugins=[MyPlugin()])\n\n        Args:\n            app_config: The :class:`AppConfig <litestar.config.app.AppConfig>` instance.\n\n        Returns:\n            The app config object.\n        \"\"\"\n        return app_config  # pragma: no cover\n\n\n@runtime_checkable\nclass CLIPluginProtocol(Protocol):\n    \"\"\"Plugin protocol to extend the CLI.\"\"\"\n\n    def on_cli_init(self, cli: Group) -> None:\n        \"\"\"Called when the CLI is initialized.\n\n        This can be used to extend or override existing commands.\n\n        Args:\n            cli: The root :class:`click.Group` of the Litestar CLI\n\n        Examples:\n            .. code-block:: python\n\n                from litestar import Litestar\n                from litestar.plugins import CLIPluginProtocol\n                from click import Group\n\n\n                class CLIPlugin(CLIPluginProtocol):\n                    def on_cli_init(self, cli: Group) -> None:\n                        @cli.command()\n                        def is_debug_mode(app: Litestar):\n                            print(app.debug)\n\n\n                app = Litestar(plugins=[CLIPlugin()])\n        \"\"\"\n\n\n@runtime_checkable\nclass SerializationPluginProtocol(Protocol):\n    \"\"\"Protocol used to define a serialization plugin for DTOs.\"\"\"\n\n    __slots__ = ()\n\n    def supports_type(self, field_definition: FieldDefinition) -> bool:\n        \"\"\"Given a value of indeterminate type, determine if this value is supported by the plugin.\n\n        Args:\n            field_definition: A parsed type.\n\n        Returns:\n            Whether the type is supported by the plugin.\n        \"\"\"\n        raise NotImplementedError()\n\n    def create_dto_for_type(self, field_definition: FieldDefinition) -> type[AbstractDTO]:\n        \"\"\"Given a parsed type, create a DTO class.\n\n        Args:\n            field_definition: A parsed type.\n\n        Returns:\n            A DTO class.\n        \"\"\"\n        raise NotImplementedError()\n\n\n@runtime_checkable\nclass OpenAPISchemaPluginProtocol(Protocol):\n    \"\"\"Plugin protocol to extend the support of OpenAPI schema generation for non-library types.\"\"\"\n\n    __slots__ = ()\n\n    @staticmethod\n    def is_plugin_supported_type(value: Any) -> bool:\n        \"\"\"Given a value of indeterminate type, determine if this value is supported by the plugin.\n\n        Args:\n            value: An arbitrary value.\n\n        Returns:\n            A typeguard dictating whether the value is supported by the plugin.\n        \"\"\"\n        raise NotImplementedError()\n\n    def to_openapi_schema(self, field_definition: FieldDefinition, schema_creator: SchemaCreator) -> Schema:\n        \"\"\"Given a type annotation, transform it into an OpenAPI schema class.\n\n        Args:\n            field_definition: An :class:`OpenAPI <litestar.openapi.spec.schema.Schema>` instance.\n            schema_creator: An instance of the openapi SchemaCreator.\n\n        Returns:\n            An :class:`OpenAPI <litestar.openapi.spec.schema.Schema>` instance.\n        \"\"\"\n        raise NotImplementedError()\n\n\nclass OpenAPISchemaPlugin(OpenAPISchemaPluginProtocol):\n    \"\"\"Plugin to extend the support of OpenAPI schema generation for non-library types.\"\"\"\n\n    @staticmethod\n    def is_undefined_sentinel(value: Any) -> bool:\n        \"\"\"Return ``True`` if ``value`` should be treated as an undefined field\"\"\"\n        return False\n\n    @staticmethod\n    def is_constrained_field(field_definition: FieldDefinition) -> bool:\n        \"\"\"Return ``True`` if the field should be treated as constrained. If returning\n        ``True``, constraints should be defined in the field's extras\n        \"\"\"\n        return False\n\n\nPluginProtocol = Union[\n    SerializationPluginProtocol,\n    InitPluginProtocol,\n    OpenAPISchemaPluginProtocol,\n    OpenAPISchemaPlugin,\n    CLIPluginProtocol,\n]\n\nPluginT = TypeVar(\"PluginT\", bound=PluginProtocol)\n\n\nclass PluginRegistry:\n    __slots__ = {\n        \"init\": \"Plugins that implement the InitPluginProtocol\",\n        \"openapi\": \"Plugins that implement the OpenAPISchemaPluginProtocol\",\n        \"serialization\": \"Plugins that implement the SerializationPluginProtocol\",\n        \"cli\": \"Plugins that implement the CLIPluginProtocol\",\n        \"_plugins_by_type\": None,\n        \"_plugins\": None,\n        \"_get_plugins_of_type\": None,\n    }\n\n    def __init__(self, plugins: list[PluginProtocol]) -> None:\n        self._plugins_by_type = {type(p): p for p in plugins}\n        self._plugins = frozenset(plugins)\n        self.init = tuple(p for p in plugins if isinstance(p, InitPluginProtocol))\n        self.openapi = tuple(p for p in plugins if isinstance(p, OpenAPISchemaPluginProtocol))\n        self.serialization = tuple(p for p in plugins if isinstance(p, SerializationPluginProtocol))\n        self.cli = tuple(p for p in plugins if isinstance(p, CLIPluginProtocol))\n\n    def get(self, type_: type[PluginT]) -> PluginT:\n        \"\"\"Return the registered plugin of ``type_``.\n\n        This should be used with subclasses of the plugin protocols.\n        \"\"\"\n        try:\n            return cast(PluginT, self._plugins_by_type[type_])  # type: ignore[index]\n        except KeyError as e:\n            raise KeyError(f\"No plugin of type {type_.__name__!r} registered\") from e\n\n    def __iter__(self) -> Iterator[PluginProtocol]:\n        return iter(self._plugins)\n\n    def __contains__(self, item: PluginProtocol) -> bool:\n        return item in self._plugins\n", "path": "litestar/plugins/base.py"}]}