From 27e63b977aa07cb4ccb25b006c9af17310a9f530 Mon Sep 17 00:00:00 2001 From: Zander Chase <130414180+vowelparrot@users.noreply.github.com> Date: Fri, 19 May 2023 17:06:17 -0700 Subject: [PATCH] Add logs command (#5007) to the plus server --- langchain/cli/main.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/langchain/cli/main.py b/langchain/cli/main.py index 1ad7cf70..9a3b0262 100644 --- a/langchain/cli/main.py +++ b/langchain/cli/main.py @@ -201,6 +201,19 @@ class PlusCommand: ] ) + def logs(self) -> None: + """Print the logs from the LangChainPlus server.""" + subprocess.run( + [ + *self.docker_compose_command, + "-f", + str(self.docker_compose_file), + "-f", + str(self.ngrok_path), + "logs", + ] + ) + def env() -> None: """Print the runtime environment information.""" @@ -248,6 +261,11 @@ def main() -> None: ) server_stop_parser.set_defaults(func=lambda args: server_command.stop()) + server_logs_parser = server_subparsers.add_parser( + "logs", description="Show the LangChainPlus server logs." + ) + server_logs_parser.set_defaults(func=lambda args: server_command.logs()) + env_parser = subparsers.add_parser("env") env_parser.set_defaults(func=lambda args: env())