mirror of
https://github.com/hwchase17/langchain.git
synced 2026-03-18 19:18:48 +00:00
Add client methods to read / list runs and sessions. Update walkthrough to: - Let the user create a dataset from the runs without going to the UI - Use the new CLI command to start the server Improve the error message when `docker` isn't found
19 lines
533 B
Python
19 lines
533 B
Python
"""Script to run langchain-server locally using docker-compose."""
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
from langchain.cli.main import get_docker_compose_command
|
|
|
|
|
|
def main() -> None:
|
|
"""Run the langchain server locally."""
|
|
p = Path(__file__).absolute().parent / "docker-compose.yaml"
|
|
|
|
docker_compose_command = get_docker_compose_command()
|
|
subprocess.run([*docker_compose_command, "-f", str(p), "pull"])
|
|
subprocess.run([*docker_compose_command, "-f", str(p), "up"])
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|