Skip to content

Commit

Permalink
mongo[patch]: release 0.2.0.dev1 (#26289)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccurme authored Sep 10, 2024
1 parent aa9f247 commit 89c6cb6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
12 changes: 10 additions & 2 deletions libs/partners/mongodb/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions libs/partners/mongodb/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "langchain-mongodb"
version = "0.1.9"
version = "0.2.0.dev1"
description = "An integration package connecting MongoDB and LangChain"
authors = []
readme = "README.md"
Expand All @@ -21,8 +21,7 @@ disallow_untyped_defs = "True"
[tool.poetry.dependencies]
python = ">=3.9,<4.0"
pymongo = ">=4.6.1,<5.0"
langchain-core = { version = "^0.3.0.dev", allow-prereleases = true }
pydantic = ">=2,<3"
langchain-core = { version = "^0.3.0.dev4", allow-prereleases = true }

[[tool.poetry.dependencies.numpy]]
version = "^1"
Expand Down
13 changes: 6 additions & 7 deletions libs/partners/mongodb/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
BaseMessage,
)
from langchain_core.outputs import ChatGeneration, ChatResult
from pydantic import validator
from pydantic import model_validator
from pymongo.collection import Collection
from pymongo.results import DeleteResult, InsertManyResult

Expand Down Expand Up @@ -134,15 +134,14 @@ class FakeLLM(LLM):
sequential_responses: Optional[bool] = False
response_index: int = 0

@validator("queries", always=True)
def check_queries_required(
cls, queries: Optional[Mapping], values: Mapping[str, Any]
) -> Optional[Mapping]:
if values.get("sequential_response") and not queries:
@model_validator(mode="before")
@classmethod
def check_queries_required(cls, values: dict) -> dict:
if values.get("sequential_response") and not values.get("queries"):
raise ValueError(
"queries is required when sequential_response is set to True"
)
return queries
return values

def get_num_tokens(self, text: str) -> int:
"""Return number of tokens."""
Expand Down

0 comments on commit 89c6cb6

Please sign in to comment.