diff --git a/libs/cli/langchain_cli/namespaces/template.py b/libs/cli/langchain_cli/namespaces/template.py index d9dc9e76f5958..03ca7e7f04c02 100644 --- a/libs/cli/langchain_cli/namespaces/template.py +++ b/libs/cli/langchain_cli/namespaces/template.py @@ -67,6 +67,11 @@ def new( package_dir = destination_dir / module_name shutil.move(destination_dir / "package_template", package_dir) + # update init + init = package_dir / "__init__.py" + init_contents = init.read_text() + init.write_text(init_contents.replace("__module_name__", module_name)) + # replace readme readme = destination_dir / "README.md" readme_contents = readme.read_text() diff --git a/libs/cli/langchain_cli/package_template/package_template/__init__.py b/libs/cli/langchain_cli/package_template/package_template/__init__.py index b941ff9ff11b2..ee137d673a00d 100644 --- a/libs/cli/langchain_cli/package_template/package_template/__init__.py +++ b/libs/cli/langchain_cli/package_template/package_template/__init__.py @@ -1,3 +1,3 @@ -from chain import chain +from __module_name__.chain import chain __all__ = ["chain"]