From 88891477ebb6c26efc0a35b6f097ed8adc588595 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Mon, 16 Sep 2024 12:57:24 -0400 Subject: [PATCH] langchain-cli: release 0.0.31 (#26533) langchain-cli 0.0.31 release --- .../langchain_cli/namespaces/migrate/main.py | 20 ++++++++++++++++++- libs/cli/pyproject.toml | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/libs/cli/langchain_cli/namespaces/migrate/main.py b/libs/cli/langchain_cli/namespaces/migrate/main.py index 019366878c6..483fa9f6ea6 100644 --- a/libs/cli/langchain_cli/namespaces/migrate/main.py +++ b/libs/cli/langchain_cli/namespaces/migrate/main.py @@ -5,6 +5,7 @@ from pathlib import Path import rich import typer from gritql import run +from typer import Option def get_gritdir_path() -> Path: @@ -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. @@ -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(), ) diff --git a/libs/cli/pyproject.toml b/libs/cli/pyproject.toml index ed24ba7bc97..0a5804351d8 100644 --- a/libs/cli/pyproject.toml +++ b/libs/cli/pyproject.toml @@ -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 "] readme = "README.md"