Add logs command (#5007)

to the plus server
This commit is contained in:
Zander Chase 2023-05-19 17:06:17 -07:00 committed by GitHub
parent 2aa3754024
commit 27e63b977a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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())