Skip to content

Commit

Permalink
langchain-cli: release 0.0.31 (#26533)
Browse files Browse the repository at this point in the history
langchain-cli 0.0.31 release
  • Loading branch information
eyurtsev authored Sep 16, 2024
1 parent 88bc15d commit 8889147
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 19 additions & 1 deletion libs/cli/langchain_cli/namespaces/migrate/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import rich
import typer
from gritql import run
from typer import Option


def get_gritdir_path() -> Path:
Expand All @@ -15,6 +16,17 @@ def get_gritdir_path() -> Path:

def migrate(
ctx: typer.Context,
# Using diff instead of dry-run for backwards compatibility with the old CLI
diff: bool = Option(
False,
"--diff",
help="Show the changes that would be made without applying them.",
),
interactive: bool = Option(
False,
"--interactive",
help="Prompt for confirmation before making each change",
),
) -> None:
"""Migrate langchain to the most recent version.
Expand Down Expand Up @@ -47,9 +59,15 @@ def migrate(
rich.print("-" * 10)
rich.print()

args = list(ctx.args)
if interactive:
args.append("--interactive")
if diff:
args.append("--dry-run")

final_code = run.apply_pattern(
"langchain_all_migrations()",
ctx.args,
args,
grit_dir=get_gritdir_path(),
)

Expand Down
2 changes: 1 addition & 1 deletion libs/cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langchain-cli"
version = "0.0.30"
version = "0.0.31"
description = "CLI for interacting with LangChain"
authors = ["Erick Friis <erick@langchain.dev>"]
readme = "README.md"
Expand Down

0 comments on commit 8889147

Please sign in to comment.