Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add convenience link to open ADE from server launch #1986

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion letta/server/rest_api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"},
Expand All @@ -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,
Expand Down Expand Up @@ -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",
Expand Down
Loading