feat(cli): add debugger host CLI flag to specify default base URL (#900)

This commit is contained in:
David Duong
2024-07-08 20:47:50 -04:00
committed by GitHub
parent bb6785bbef
commit 293bc2c11f
3 changed files with 51 additions and 16 deletions
+28 -13
View File
@@ -32,18 +32,6 @@ DB = """
"""
DEBUGGER = """
langgraph-debugger:
image: langchain/langgraph-debugger
restart: on-failure
ports:
- "{debugger_port}:3968"
depends_on:
langgraph-postgres:
condition: service_healthy
"""
class Version(NamedTuple):
major: int
minor: int
@@ -117,11 +105,38 @@ def check_capabilities(runner) -> DockerCapabilities:
)
def debugger_compose(
*, port: Optional[int] = None, base_url: Optional[str] = None
) -> str:
if port is None:
return ""
compose_str = """
langgraph-debugger:
image: langchain/langgraph-debugger
restart: on-failure
depends_on:
langgraph-postgres:
condition: service_healthy
ports:
- "{port}:3968"
"""
if base_url:
compose_str += """
environment:
VITE_STUDIO_LOCAL_GRAPH_URL: {base_url}
"""
return compose_str.format(port=port, base_url=base_url)
def compose(
capabilities: DockerCapabilities,
*,
port: int,
debugger_port: Optional[int] = None,
debugger_base_url: Optional[str] = None,
# postgres://user:password@host:port/database?option=value
postgres_uri: Optional[str] = None,
) -> str:
@@ -151,7 +166,7 @@ def compose(
compose_str = f"""{volumes}services:
{db}
{DEBUGGER.format(debugger_port=debugger_port) if debugger_port else ""}
{debugger_compose(port=debugger_port, base_url=debugger_base_url)}
langgraph-api:
ports:
- "{port}:8000\""""