CLI 0.0.13, Configurable Template Demo (#12796)

This commit is contained in:
Erick Friis
2023-11-02 11:42:57 -07:00
committed by GitHub
parent d1c6ad7769
commit 49e283a0cd
4 changed files with 31 additions and 5 deletions

View File

@@ -90,6 +90,13 @@ def serve(
host: Annotated[
Optional[str], typer.Option(help="The host to run the server on")
] = None,
configurable: Annotated[
bool,
typer.Option(
"--configurable/--no-configurable",
help="Whether to include a configurable route",
),
] = True,
) -> None:
"""
Starts a demo app for this template.
@@ -104,10 +111,16 @@ def serve(
port_str = str(port) if port is not None else "8000"
host_str = host if host is not None else "127.0.0.1"
script = (
"langchain_cli.dev_scripts:create_demo_server"
if not configurable
else "langchain_cli.dev_scripts:create_demo_server_configurable"
)
command = [
"uvicorn",
"--factory",
"langchain_cli.dev_scripts:create_demo_server",
script,
"--reload",
"--port",
port_str,