Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongo[patch]: release 0.2.0.dev1 #26289

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading