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

This commit is contained in:
Erick Friis 2024-05-23 13:09:38 -07:00 committed by GitHub
parent 18b8c8628a
commit 95c3e5f85f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 23 additions and 19 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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"]

View File

@ -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://git@github.com/efriis/simple-pirate.git\n\n")
typer.echo(
" langchain app add git+ssh://git@github.com/efriis/simple-pirate.git\n\n"
)
@app_cli.command()

View File

@ -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 <erick@langchain.dev>"]
readme = "README.md"