mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-04 12:18:24 +00:00
Add dev option (#4828)
enable running ``` langchain plus start --dev ``` To use the RC iamges instead
This commit is contained in:
parent
720ac49f42
commit
a47c62fcba
@ -1,7 +1,7 @@
|
||||
version: '3'
|
||||
services:
|
||||
langchain-frontend:
|
||||
image: langchain/langchainplus-frontend:latest
|
||||
image: langchain/${_LANGCHAINPLUS_IMAGE_PREFIX-}langchainplus-frontend:latest
|
||||
ports:
|
||||
- 80:80
|
||||
environment:
|
||||
@ -16,7 +16,7 @@ services:
|
||||
context: frontend-react/.
|
||||
dockerfile: Dockerfile
|
||||
langchain-backend:
|
||||
image: langchain/langchainplus-backend:latest
|
||||
image: langchain/${_LANGCHAINPLUS_IMAGE_PREFIX-}langchainplus-backend:latest
|
||||
environment:
|
||||
- PORT=8000
|
||||
- LANGCHAIN_ENV=local_docker
|
||||
|
@ -167,7 +167,13 @@ class PlusCommand:
|
||||
self._open_browser("http://0.0.0.0:4040")
|
||||
self._open_browser("http://localhost")
|
||||
|
||||
def start(self, *, expose: bool = False, auth_token: Optional[str] = None) -> None:
|
||||
def start(
|
||||
self,
|
||||
*,
|
||||
expose: bool = False,
|
||||
auth_token: Optional[str] = None,
|
||||
dev: bool = False,
|
||||
) -> None:
|
||||
"""Run the LangChainPlus server locally.
|
||||
|
||||
Args:
|
||||
@ -175,7 +181,8 @@ class PlusCommand:
|
||||
auth_token: The ngrok authtoken to use (visible in the ngrok dashboard).
|
||||
If not provided, ngrok server session length will be restricted.
|
||||
"""
|
||||
|
||||
if dev:
|
||||
os.environ["_LANGCHAINPLUS_IMAGE_PREFIX"] = "rc-"
|
||||
if expose:
|
||||
self._start_and_expose(auth_token=auth_token)
|
||||
else:
|
||||
@ -225,9 +232,14 @@ def main() -> None:
|
||||
help="The ngrok authtoken to use (visible in the ngrok dashboard)."
|
||||
" If not provided, ngrok server session length will be restricted.",
|
||||
)
|
||||
server_start_parser.add_argument(
|
||||
"--dev",
|
||||
action="store_true",
|
||||
help="Use the development version of the LangChainPlus image.",
|
||||
)
|
||||
server_start_parser.set_defaults(
|
||||
func=lambda args: server_command.start(
|
||||
expose=args.expose, auth_token=args.ngrok_authtoken
|
||||
expose=args.expose, auth_token=args.ngrok_authtoken, dev=args.dev
|
||||
)
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user