Skip to content

Commit 8420294

Browse files
committed
Replace combine_pipelines
1 parent e83fc9d commit 8420294

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

libs/langchain-mongodb/langchain_mongodb/pipelines.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
from typing import Any, Dict, List, Optional, Union
1111

12+
from pymongo_search_utils import combine_pipelines # noqa: F401
13+
1214

1315
def text_search_stage(
1416
query: str,
@@ -91,16 +93,6 @@ def vector_search_stage(
9193
return {"$vectorSearch": stage}
9294

9395

94-
def combine_pipelines(
95-
pipeline: List[Any], stage: List[Dict[str, Any]], collection_name: str
96-
) -> None:
97-
"""Combines two aggregations into a single result set in-place."""
98-
if pipeline:
99-
pipeline.append({"$unionWith": {"coll": collection_name, "pipeline": stage}})
100-
else:
101-
pipeline.extend(stage)
102-
103-
10496
def reciprocal_rank_stage(
10597
score_field: str, penalty: float = 0, weight: float = 1, **kwargs: Any
10698
) -> List[Dict[str, Any]]:

0 commit comments

Comments
 (0)