mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-02 03:26:17 +00:00
CLI 0.0.13, Configurable Template Demo (#12796)
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user