From 75b866fa86b1aae38fa6d5bc1b531b30f685870c Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Wed, 6 Nov 2024 10:21:43 -0800 Subject: [PATCH] feat: add convenience link to open ADE from server launch (#1986) --- letta/server/rest_api/app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/letta/server/rest_api/app.py b/letta/server/rest_api/app.py index a0daff26b2..f8300a9719 100644 --- a/letta/server/rest_api/app.py +++ b/letta/server/rest_api/app.py @@ -8,6 +8,7 @@ from fastapi import FastAPI from starlette.middleware.cors import CORSMiddleware +from letta.__init__ import __version__ from letta.constants import ADMIN_PREFIX, API_PREFIX, OPENAI_API_PREFIX from letta.schemas.letta_response import LettaResponse from letta.server.constants import REST_DEFAULT_PORT @@ -66,6 +67,7 @@ def create_application() -> "FastAPI": """the application start routine""" # global server # server = SyncServer(default_interface_factory=lambda: interface()) + print(f"\n[[ Letta server // v{__version__} ]]") app = FastAPI( swagger_ui_parameters={"docExpansion": "none"}, @@ -78,6 +80,7 @@ def create_application() -> "FastAPI": if "--ade" in sys.argv: settings.cors_origins.append("https://app.letta.com") + print(f"▶ View using ADE at: https://app.letta.com/local-project/agents") app.add_middleware( CORSMiddleware, @@ -179,7 +182,7 @@ def start_server( # Add the handler to the logger server_logger.addHandler(stream_handler) - print(f"Running: uvicorn server:app --host {host or 'localhost'} --port {port or REST_DEFAULT_PORT}") + print(f"▶ Server running at: http://{host or 'localhost'}:{port or REST_DEFAULT_PORT}\n") uvicorn.run( app, host=host or "localhost",