langgraph-cli 0.1.3__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langgraph-cli
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary:
5
5
  Author: Nuno Campos
6
6
  Author-email: nuno@langchain.dev
@@ -109,6 +109,14 @@ OPT_C = click.option(
109
109
  OPT_PORT = click.option(
110
110
  "--port", "-p", type=int, default=8123, show_default=True, help="Port to expose"
111
111
  )
112
+ OPT_DEBUGGER_PORT = click.option(
113
+ "--debugger-port",
114
+ "-dp",
115
+ type=int,
116
+ default=8124,
117
+ show_default=True,
118
+ help="Port to expose debug UI on",
119
+ )
112
120
 
113
121
 
114
122
  @click.group()
@@ -125,6 +133,7 @@ def cli():
125
133
  @click.option(
126
134
  "--pull/--no-pull", default=True, show_default=True, help="Pull latest images"
127
135
  )
136
+ @OPT_DEBUGGER_PORT
128
137
  @OPT_PORT
129
138
  @OPT_O
130
139
  @OPT_C
@@ -135,6 +144,7 @@ def up(
135
144
  port: int,
136
145
  recreate: bool,
137
146
  pull: bool,
147
+ debugger_port: Optional[int],
138
148
  ):
139
149
  with asyncio.Runner() as runner:
140
150
  # check docker available
@@ -148,7 +158,7 @@ def up(
148
158
  if pull:
149
159
  runner.run(exec("docker", "pull", "langchain/langserve"))
150
160
  # prepare args
151
- stdin = langgraph_cli.docker.compose(port=port)
161
+ stdin = langgraph_cli.docker.compose(port=port, debugger_port=debugger_port)
152
162
  args = [
153
163
  "--project-directory",
154
164
  config.parent,
@@ -83,10 +83,7 @@ def config_to_compose(config_path: pathlib.Path, config: Config):
83
83
  f"ADD {relpath} /tmp/{fullpath.name}/{fullpath.name}\n RUN touch /tmp/{fullpath.name}/pyproject.toml"
84
84
  for fullpath, relpath in faux_pkgs.items()
85
85
  )
86
- local_pkgs_str = "\n".join(
87
- f"ADD {relpath} /tmp/{fullpath.name}"
88
- for fullpath, relpath in local_pkgs.items()
89
- )
86
+ local_pkgs_str = f"ADD {' '.join(local_pkgs.values())} /tmp/" if local_pkgs else ""
90
87
  env_vars_str = (
91
88
  "\n".join(f" {k}: {v}" for k, v in config["env"].items())
92
89
  if isinstance(config["env"], dict)
@@ -26,12 +26,26 @@ DB = f"""
26
26
  - {ROOT}/initdb:/docker-entrypoint-initdb.d
27
27
  """
28
28
 
29
+ DEBUGGER = """
30
+ debugger:
31
+ image: langchain/langserve-debugger
32
+ restart: on-failure:3
33
+ ports:
34
+ - "{debugger_port}:5173"
35
+ depends_on:
36
+ langserve:
37
+ condition: service_healthy
38
+ environment:
39
+ VITE_API_BASE_URL: http://localhost:{port}
40
+ """
41
+
29
42
 
30
43
  def compose(
31
44
  *,
32
45
  # postgres://user:password@host:port/database?option=value
33
46
  postgres_uri: Optional[str] = None,
34
47
  port: int,
48
+ debugger_port: Optional[int] = None,
35
49
  ) -> str:
36
50
  if postgres_uri is None:
37
51
  include_db = True
@@ -42,6 +56,7 @@ def compose(
42
56
  return f"""
43
57
  services:
44
58
  {DB if include_db else ""}
59
+ {DEBUGGER.format(port=port, debugger_port=debugger_port) if debugger_port else ""}
45
60
  migrate:
46
61
  image: langchain/langserve-migrate
47
62
  pull_policy: always
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "langgraph-cli"
3
- version = "0.1.3"
3
+ version = "0.1.4"
4
4
  description = ""
5
5
  authors = ["Nuno Campos <nuno@langchain.dev>"]
6
6
  readme = "README.md"
File without changes