Add dev option (#4828)

enable running
```
langchain plus start --dev
```

To use the RC iamges instead
dynamic_agent_tools
Zander Chase 1 year ago committed by GitHub
parent 720ac49f42
commit a47c62fcba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,7 +1,7 @@
version: '3' version: '3'
services: services:
langchain-frontend: langchain-frontend:
image: langchain/langchainplus-frontend:latest image: langchain/${_LANGCHAINPLUS_IMAGE_PREFIX-}langchainplus-frontend:latest
ports: ports:
- 80:80 - 80:80
environment: environment:
@ -16,7 +16,7 @@ services:
context: frontend-react/. context: frontend-react/.
dockerfile: Dockerfile dockerfile: Dockerfile
langchain-backend: langchain-backend:
image: langchain/langchainplus-backend:latest image: langchain/${_LANGCHAINPLUS_IMAGE_PREFIX-}langchainplus-backend:latest
environment: environment:
- PORT=8000 - PORT=8000
- LANGCHAIN_ENV=local_docker - LANGCHAIN_ENV=local_docker

@ -167,7 +167,13 @@ class PlusCommand:
self._open_browser("http://0.0.0.0:4040") self._open_browser("http://0.0.0.0:4040")
self._open_browser("http://localhost") 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. """Run the LangChainPlus server locally.
Args: Args:
@ -175,7 +181,8 @@ class PlusCommand:
auth_token: The ngrok authtoken to use (visible in the ngrok dashboard). auth_token: The ngrok authtoken to use (visible in the ngrok dashboard).
If not provided, ngrok server session length will be restricted. If not provided, ngrok server session length will be restricted.
""" """
if dev:
os.environ["_LANGCHAINPLUS_IMAGE_PREFIX"] = "rc-"
if expose: if expose:
self._start_and_expose(auth_token=auth_token) self._start_and_expose(auth_token=auth_token)
else: else:
@ -225,9 +232,14 @@ def main() -> None:
help="The ngrok authtoken to use (visible in the ngrok dashboard)." help="The ngrok authtoken to use (visible in the ngrok dashboard)."
" If not provided, ngrok server session length will be restricted.", " 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( server_start_parser.set_defaults(
func=lambda args: server_command.start( 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…
Cancel
Save