cli[patch]: Fix Tuple typing problem when create new langchain app (#19141)

Thank you for contributing to LangChain!

When run command langchain app new my-app, i get this error:

File
"/home/mauricio/.local/lib/python3.8/site-packages/langchain_cli/utils/pyproject.py",
line 15, in <module>
pyproject_toml: Path, local_editable_dependencies: Iterable[tuple[str,
Path]]
TypeError: 'type' object is not subscriptable

This PR fix the error.
This commit is contained in:
Mauricio Cruz 2024-03-25 22:09:51 -03:00 committed by GitHub
parent 6c9b0f96f3
commit fb9ce95184
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,5 @@
from pathlib import Path
from typing import Any, Dict, Iterable
from typing import Any, Dict, Iterable, Tuple
from tomlkit import dump, inline_table, load
from tomlkit.items import InlineTable
@ -12,7 +12,7 @@ def _get_dep_inline_table(path: Path) -> InlineTable:
def add_dependencies_to_pyproject_toml(
pyproject_toml: Path, local_editable_dependencies: Iterable[tuple[str, Path]]
pyproject_toml: Path, local_editable_dependencies: Iterable[Tuple[str, Path]]
) -> None:
"""Add dependencies to pyproject.toml."""
with open(pyproject_toml, encoding="utf-8") as f: