mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
feat(platform): Make REST & WS server host configurable (#8143)
This commit is contained in:
@@ -251,7 +251,12 @@ class AgentServer(AppService):
|
||||
|
||||
app.include_router(api_router)
|
||||
|
||||
uvicorn.run(app, host="0.0.0.0", port=Config().agent_api_port, log_config=None)
|
||||
uvicorn.run(
|
||||
app,
|
||||
host=Config().agent_api_host,
|
||||
port=Config().agent_api_port,
|
||||
log_config=None,
|
||||
)
|
||||
|
||||
def set_test_dependency_overrides(self, overrides: dict):
|
||||
self._test_dependency_overrides = overrides
|
||||
|
||||
@@ -174,4 +174,8 @@ async def websocket_router(
|
||||
|
||||
class WebsocketServer(AppProcess):
|
||||
def run(self):
|
||||
uvicorn.run(app, host="0.0.0.0", port=Config().websocket_server_port)
|
||||
uvicorn.run(
|
||||
app,
|
||||
host=Config().websocket_server_host,
|
||||
port=Config().websocket_server_port,
|
||||
)
|
||||
|
||||
@@ -80,6 +80,11 @@ class Config(UpdateTrackingModel["Config"], BaseSettings):
|
||||
extra="allow",
|
||||
)
|
||||
|
||||
websocket_server_host: str = Field(
|
||||
default="0.0.0.0",
|
||||
description="The host for the websocket server to run on",
|
||||
)
|
||||
|
||||
websocket_server_port: int = Field(
|
||||
default=8001,
|
||||
description="The port for the websocket server to run on",
|
||||
@@ -100,6 +105,11 @@ class Config(UpdateTrackingModel["Config"], BaseSettings):
|
||||
description="The port for agent server daemon to run on",
|
||||
)
|
||||
|
||||
agent_api_host: str = Field(
|
||||
default="0.0.0.0",
|
||||
description="The host for agent server API to run on",
|
||||
)
|
||||
|
||||
agent_api_port: int = Field(
|
||||
default=8006,
|
||||
description="The port for agent server API to run on",
|
||||
|
||||
Reference in New Issue
Block a user