Run the server using SSE transport.
( # pragma: no cover
self,
*,
host: str = "127.0.0.1",
port: int = 8000,
sse_path: str = "/sse",
message_path: str = "/messages/",
transport_security: TransportSecuritySettings | None = None,
)
| 842 | ) |
| 843 | |
| 844 | async def run_sse_async( # pragma: no cover |
| 845 | self, |
| 846 | *, |
| 847 | host: str = "127.0.0.1", |
| 848 | port: int = 8000, |
| 849 | sse_path: str = "/sse", |
| 850 | message_path: str = "/messages/", |
| 851 | transport_security: TransportSecuritySettings | None = None, |
| 852 | ) -> None: |
| 853 | """Run the server using SSE transport.""" |
| 854 | import uvicorn |
| 855 | |
| 856 | starlette_app = self.sse_app( |
| 857 | sse_path=sse_path, |
| 858 | message_path=message_path, |
| 859 | transport_security=transport_security, |
| 860 | host=host, |
| 861 | ) |
| 862 | |
| 863 | config = uvicorn.Config( |
| 864 | starlette_app, |
| 865 | host=host, |
| 866 | port=port, |
| 867 | log_level=self.settings.log_level.lower(), |
| 868 | ) |
| 869 | server = uvicorn.Server(config) |
| 870 | await server.serve() |
| 871 | |
| 872 | async def run_streamable_http_async( # pragma: no cover |
| 873 | self, |