mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-19 09:16:24 +00:00
Updates after review and added Makefile targets for publishing
This commit is contained in:
@@ -8,10 +8,13 @@ RUFF := .venv/bin/ruff
|
|||||||
PYTEST := .venv/bin/pytest
|
PYTEST := .venv/bin/pytest
|
||||||
MYPY := .venv/bin/mypy
|
MYPY := .venv/bin/mypy
|
||||||
|
|
||||||
|
PACKAGE_NAME=langchain-coherence
|
||||||
|
DIST_DIR=dist
|
||||||
|
|
||||||
install:
|
install:
|
||||||
@echo "🔧 Installing all dependencies..."
|
@echo "🔧 Installing all dependencies..."
|
||||||
uv venv
|
uv venv
|
||||||
uv pip install -e .[lint,typing,test,docs]
|
uv pip install -e .[lint,typing,test,docs,publish]
|
||||||
|
|
||||||
update-dev:
|
update-dev:
|
||||||
@echo "🔄 Updating development dependencies..."
|
@echo "🔄 Updating development dependencies..."
|
||||||
@@ -51,7 +54,17 @@ test:
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo "🧹 Cleaning build/test artifacts..."
|
@echo "🧹 Cleaning build/test artifacts..."
|
||||||
rm -rf .pytest_cache .mypy_cache .ruff_cache .venv .uv __pycache__ *.egg-info dist build
|
rm -rf .pytest_cache .mypy_cache .ruff_cache __pycache__ *.egg-info dist build
|
||||||
|
|
||||||
|
build:
|
||||||
|
@echo "🧱 Building distribution using local virtualenv"
|
||||||
|
$(PYTHON) -m build --no-isolation
|
||||||
|
|
||||||
|
upload-pypi:
|
||||||
|
@echo "🚀 Uploading to PyPI"
|
||||||
|
$(PYTHON) -m twine upload dist/*
|
||||||
|
|
||||||
|
publish: build upload-pypi
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo "🛠 Available Make targets:"
|
@echo "🛠 Available Make targets:"
|
||||||
@@ -63,6 +76,9 @@ help:
|
|||||||
@echo " lint - Run linter and mypy"
|
@echo " lint - Run linter and mypy"
|
||||||
@echo " fix - Autoformat and fix issues"
|
@echo " fix - Autoformat and fix issues"
|
||||||
@echo " test - Run all tests"
|
@echo " test - Run all tests"
|
||||||
|
@echo " build - Building distribution using local virtualenv"
|
||||||
|
@echo " upload-pypi - Uploading to PyPI"
|
||||||
|
@echo " publish - calls build, upload-pypi"
|
||||||
@echo " clean - Remove temp and build files"
|
@echo " clean - Remove temp and build files"
|
||||||
|
|
||||||
|
|
||||||
|
@@ -378,7 +378,7 @@ class CoherenceVectorStore(VectorStore):
|
|||||||
async def asimilarity_search(
|
async def asimilarity_search(
|
||||||
self, query: str, k: int = 4, **kwargs: Any
|
self, query: str, k: int = 4, **kwargs: Any
|
||||||
) -> list[Document]:
|
) -> list[Document]:
|
||||||
"""Async method return docs most similar to query.
|
"""Async method return list of docs most similar to query.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
query: Input text.
|
query: Input text.
|
||||||
@@ -423,7 +423,7 @@ class CoherenceVectorStore(VectorStore):
|
|||||||
async def asimilarity_search_by_vector(
|
async def asimilarity_search_by_vector(
|
||||||
self, embedding: list[float], k: int = 4, **kwargs: Any
|
self, embedding: list[float], k: int = 4, **kwargs: Any
|
||||||
) -> list[Document]:
|
) -> list[Document]:
|
||||||
"""Async method return docs most similar to passed embedding vector.
|
"""Async method return list of docs most similar to passed embedding vector.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
embedding: Input vector.
|
embedding: Input vector.
|
||||||
@@ -466,7 +466,7 @@ class CoherenceVectorStore(VectorStore):
|
|||||||
async def asimilarity_search_with_score(
|
async def asimilarity_search_with_score(
|
||||||
self, query: str, k: int = 4, **kwargs: Any
|
self, query: str, k: int = 4, **kwargs: Any
|
||||||
) -> list[tuple[Document, float]]:
|
) -> list[tuple[Document, float]]:
|
||||||
"""Async method return list tuple(Document, score) most similar to query.
|
"""Async method return list of tuple(Document, score) most similar to query.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
query: Input text.
|
query: Input text.
|
||||||
@@ -529,7 +529,7 @@ class CoherenceVectorStore(VectorStore):
|
|||||||
metadatas: Optional[list[dict[str, Any]]] = None,
|
metadatas: Optional[list[dict[str, Any]]] = None,
|
||||||
**kwargs: Any,
|
**kwargs: Any,
|
||||||
) -> CoherenceVectorStore:
|
) -> CoherenceVectorStore:
|
||||||
"""Asynchronously initialize CoherenceVectorStore from texts and embeddings.
|
"""Asynchronously initialize the CoherenceVectorStore from texts and embeddings.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
texts: List of input text strings.
|
texts: List of input text strings.
|
||||||
@@ -539,7 +539,6 @@ class CoherenceVectorStore(VectorStore):
|
|||||||
- cache: Required Coherence NamedCache[str, Document] instance.
|
- cache: Required Coherence NamedCache[str, Document] instance.
|
||||||
- ids: Optional list of document IDs.
|
- ids: Optional list of document IDs.
|
||||||
|
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
CoherenceVectorStore: An initialized and populated vector store.
|
CoherenceVectorStore: An initialized and populated vector store.
|
||||||
|
|
||||||
|
@@ -32,7 +32,10 @@ docs = [
|
|||||||
"jupytext>=1.16",
|
"jupytext>=1.16",
|
||||||
"nbdoc>=0.0.29",
|
"nbdoc>=0.0.29",
|
||||||
]
|
]
|
||||||
|
publish = [
|
||||||
|
"build",
|
||||||
|
"twine"
|
||||||
|
]
|
||||||
[tool.mypy]
|
[tool.mypy]
|
||||||
strict = "True"
|
strict = "True"
|
||||||
disallow_untyped_defs = "True"
|
disallow_untyped_defs = "True"
|
||||||
|
2
libs/partners/coherence/uv.lock
generated
2
libs/partners/coherence/uv.lock
generated
@@ -1336,7 +1336,7 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "langchain-coherence"
|
name = "langchain-coherence"
|
||||||
version = "0.0.1.dev0"
|
version = "0.0.1"
|
||||||
source = { virtual = "." }
|
source = { virtual = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "coherence-client" },
|
{ name = "coherence-client" },
|
||||||
|
Reference in New Issue
Block a user