Skip to content

The agent engineering platform.

cli: model name substitution fix, release 0.0.23 (#22089)

Erick Friis95c3e5f85f8e
diff --git a/libs/cli/langchain_cli/integration_template/integration_template/chat_models.py b/libs/cli/langchain_cli/integration_template/integration_template/chat_models.py
index df19152454..8835b4dde4 100644
--- a/libs/cli/langchain_cli/integration_template/integration_template/chat_models.py
+++ b/libs/cli/langchain_cli/integration_template/integration_template/chat_models.py
@@ -1,4 +1,5 @@
"""__ModuleName__ chat models."""
+
from typing import Any, AsyncIterator, Iterator, List, Optional
from langchain_core.callbacks import (
@@ -29,6 +30,7 @@ class Chat__ModuleName__(BaseChatModel):
"""Return type of chat model."""
return "chat-__package_name_short__"
+ # TODO: This method must be implemented to generate chat responses.
def _generate(
self,
messages: List[BaseMessage],
@@ -38,7 +40,7 @@ class Chat__ModuleName__(BaseChatModel):
) -> ChatResult:
raise NotImplementedError
- # TODO: Implement if __model_name__ supports streaming. Otherwise delete method.
+ # TODO: Implement if Chat__ModuleName__ supports streaming. Otherwise delete method.
def _stream(
self,
messages: List[BaseMessage],
@@ -48,7 +50,7 @@ class Chat__ModuleName__(BaseChatModel):
) -> Iterator[ChatGenerationChunk]:
raise NotImplementedError
- # TODO: Implement if __model_name__ supports async streaming. Otherwise delete
+ # TODO: Implement if Chat__ModuleName__ supports async streaming. Otherwise delete
# method.
async def _astream(
self,
@@ -59,7 +61,7 @@ class Chat__ModuleName__(BaseChatModel):
) -> AsyncIterator[ChatGenerationChunk]:
raise NotImplementedError
- # TODO: Implement if __model_name__ supports async generation. Otherwise delete
+ # TODO: Implement if Chat__ModuleName__ supports async generation. Otherwise delete
# method.
async def _agenerate(
self,
diff --git a/libs/cli/langchain_cli/integration_template/integration_template/llms.py b/libs/cli/langchain_cli/integration_template/integration_template/llms.py
index 562fc0f400..675e95f158 100644
--- a/libs/cli/langchain_cli/integration_template/integration_template/llms.py
+++ b/libs/cli/langchain_cli/integration_template/integration_template/llms.py
@@ -1,4 +1,5 @@
"""__ModuleName__ large language models."""
+
from typing import (
Any,
AsyncIterator,
@@ -32,6 +33,7 @@ class __ModuleName__LLM(BaseLLM):
"""Return type of LLM."""
return "__package_name_short__-llm"
+ # TODO: This method must be implemented to generate text completions.
def _generate(
self,
prompts: List[str],
@@ -41,7 +43,7 @@ class __ModuleName__LLM(BaseLLM):
) -> LLMResult:
raise NotImplementedError
- # TODO: Implement if __model_name__ supports async generation. Otherwise
+ # TODO: Implement if __ModuleName__LLM supports async generation. Otherwise
# delete method.
async def _agenerate(
self,
@@ -52,7 +54,7 @@ class __ModuleName__LLM(BaseLLM):
) -> LLMResult:
raise NotImplementedError
- # TODO: Implement if __model_name__ supports streaming. Otherwise delete method.
+ # TODO: Implement if __ModuleName__LLM supports streaming. Otherwise delete method.
def _stream(
self,
prompt: str,
@@ -62,7 +64,7 @@ class __ModuleName__LLM(BaseLLM):
) -> Iterator[GenerationChunk]:
raise NotImplementedError
- # TODO: Implement if __model_name__ supports async streaming. Otherwise delete
+ # TODO: Implement if __ModuleName__LLM supports async streaming. Otherwise delete
# method.
async def _astream(
self,
diff --git a/libs/cli/langchain_cli/integration_template/pyproject.toml b/libs/cli/langchain_cli/integration_template/pyproject.toml
index 4b13497987..d7752864b0 100644
--- a/libs/cli/langchain_cli/integration_template/pyproject.toml
+++ b/libs/cli/langchain_cli/integration_template/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "__package_name__"
-version = "0.0.1"
+version = "0.1.0"
description = "An integration package connecting __ModuleName__ and LangChain"
authors = []
readme = "README.md"
@@ -12,7 +12,7 @@ license = "MIT"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
-langchain-core = ">=0.1,<0.3"
+langchain-core = "^0.2.0"
[tool.poetry.group.test]
optional = true
@@ -21,7 +21,7 @@ optional = true
pytest = "^7.4.3"
pytest-asyncio = "^0.23.2"
pytest-socket = "^0.7.0"
-langchain-core = {path = "../../core", develop = true}
+langchain-core = { path = "../../core", develop = true }
[tool.poetry.group.codespell]
optional = true
@@ -42,19 +42,19 @@ ruff = "^0.1.8"
[tool.poetry.group.typing.dependencies]
mypy = "^1.7.1"
-langchain-core = {path = "../../core", develop = true}
+langchain-core = { path = "../../core", develop = true }
[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
-langchain-core = {path = "../../core", develop = true}
+langchain-core = { path = "../../core", develop = true }
[tool.ruff.lint]
select = [
- "E", # pycodestyle
- "F", # pyflakes
- "I", # isort
+ "E", # pycodestyle
+ "F", # pyflakes
+ "I", # isort
"T201", # print
]
@@ -62,9 +62,7 @@ select = [
disallow_untyped_defs = "True"
[tool.coverage.run]
-omit = [
- "tests/*",
-]
+omit = ["tests/*"]
[build-system]
requires = ["poetry-core>=1.0.0"]
diff --git a/libs/cli/langchain_cli/namespaces/app.py b/libs/cli/langchain_cli/namespaces/app.py
index 03e8245c88..9bf007652b 100644
--- a/libs/cli/langchain_cli/namespaces/app.py
+++ b/libs/cli/langchain_cli/namespaces/app.py
@@ -123,7 +123,9 @@ def new(
typer.echo(f" cd ./{app_name}\n")
typer.echo("Then add templates with commands like:\n")
typer.echo(" langchain app add extraction-openai-functions")
- typer.echo(" langchain app add git+ssh://[email protected]/efriis/simple-pirate.git\n\n")
+ typer.echo(
+ " langchain app add git+ssh://[email protected]/efriis/simple-pirate.git\n\n"
+ )
@app_cli.command()
diff --git a/libs/cli/pyproject.toml b/libs/cli/pyproject.toml
index 079f84dce5..03b1bda1fe 100644
--- a/libs/cli/pyproject.toml
+++ b/libs/cli/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langchain-cli"
-version = "0.0.22"
+version = "0.0.23"
description = "CLI for interacting with LangChain"
authors = ["Erick Friis <[email protected]>"]
readme = "README.md"