Skip to content

Commit 449d7a1

Browse files
committed
re-expose hybrid search configs from init
1 parent d898171 commit 449d7a1

File tree

5 files changed

+14
-25
lines changed

5 files changed

+14
-25
lines changed

src/langchain_google_alloydb_pg/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
# limitations under the License.
1414

1515
from langchain_postgres import Column
16+
from langchain_postgres.v2.hybrid_search_config import (
17+
HybridSearchConfig,
18+
reciprocal_rank_fusion,
19+
weighted_sum_ranking,
20+
)
1621

1722
from .chat_message_history import AlloyDBChatMessageHistory
1823
from .checkpoint import AlloyDBSaver
@@ -34,5 +39,8 @@
3439
"AlloyDBModelManager",
3540
"AlloyDBModel",
3641
"AlloyDBSaver",
42+
"HybridSearchConfig",
43+
"reciprocal_rank_fusion",
44+
"weighted_sum_ranking",
3745
"__version__",
3846
]

src/langchain_google_alloydb_pg/hybrid_search_config.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/langchain_google_alloydb_pg/vectorstore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from langchain_core.embeddings import Embeddings
2222
from langchain_postgres import PGVectorStore
2323

24-
from langchain_google_alloydb_pg.hybrid_search_config import HybridSearchConfig
24+
from langchain_google_alloydb_pg import HybridSearchConfig
2525
from langchain_google_alloydb_pg.indexes import (
2626
DEFAULT_DISTANCE_STRATEGY,
2727
DistanceStrategy,

tests/test_async_vectorstore_index.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@
2323
from langchain_core.embeddings import DeterministicFakeEmbedding
2424
from sqlalchemy import text
2525

26-
from langchain_google_alloydb_pg import AlloyDBEngine
26+
from langchain_google_alloydb_pg import AlloyDBEngine, HybridSearchConfig
2727
from langchain_google_alloydb_pg.async_vectorstore import AsyncAlloyDBVectorStore
28-
from langchain_google_alloydb_pg.hybrid_search_config import HybridSearchConfig
2928
from langchain_google_alloydb_pg.indexes import (
3029
DEFAULT_INDEX_NAME_SUFFIX,
3130
DistanceStrategy,

tests/test_async_vectorstore_search.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@
2323
from PIL import Image
2424
from sqlalchemy import text
2525

26-
from langchain_google_alloydb_pg import AlloyDBEngine, Column
27-
from langchain_google_alloydb_pg.async_vectorstore import AsyncAlloyDBVectorStore
28-
from langchain_google_alloydb_pg.hybrid_search_config import (
26+
from langchain_google_alloydb_pg import (
27+
AlloyDBEngine,
28+
Column,
2929
HybridSearchConfig,
3030
reciprocal_rank_fusion,
3131
weighted_sum_ranking,
3232
)
33+
from langchain_google_alloydb_pg.async_vectorstore import AsyncAlloyDBVectorStore
3334
from langchain_google_alloydb_pg.indexes import (
3435
DistanceStrategy,
3536
HNSWQueryOptions,

0 commit comments

Comments
 (0)