langchain-postgres 0.0.11__tar.gz → 0.0.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {langchain_postgres-0.0.11 → langchain_postgres-0.0.12}/PKG-INFO +1 -1
- {langchain_postgres-0.0.11 → langchain_postgres-0.0.12}/langchain_postgres/vectorstores.py +10 -10
- {langchain_postgres-0.0.11 → langchain_postgres-0.0.12}/pyproject.toml +1 -1
- {langchain_postgres-0.0.11 → langchain_postgres-0.0.12}/LICENSE +0 -0
- {langchain_postgres-0.0.11 → langchain_postgres-0.0.12}/README.md +0 -0
- {langchain_postgres-0.0.11 → langchain_postgres-0.0.12}/langchain_postgres/__init__.py +0 -0
- {langchain_postgres-0.0.11 → langchain_postgres-0.0.12}/langchain_postgres/_utils.py +0 -0
- {langchain_postgres-0.0.11 → langchain_postgres-0.0.12}/langchain_postgres/chat_message_histories.py +0 -0
- {langchain_postgres-0.0.11 → langchain_postgres-0.0.12}/langchain_postgres/py.typed +0 -0
- {langchain_postgres-0.0.11 → langchain_postgres-0.0.12}/langchain_postgres/translator.py +0 -0
@@ -939,7 +939,7 @@ class PGVector(VectorStore):
|
|
939
939
|
List of Documents most similar to the query.
|
940
940
|
"""
|
941
941
|
assert not self._async_engine, "This method must be called without async_mode"
|
942
|
-
embedding = self.
|
942
|
+
embedding = self.embeddings.embed_query(query)
|
943
943
|
return self.similarity_search_by_vector(
|
944
944
|
embedding=embedding,
|
945
945
|
k=k,
|
@@ -964,7 +964,7 @@ class PGVector(VectorStore):
|
|
964
964
|
List of Documents most similar to the query.
|
965
965
|
"""
|
966
966
|
await self.__apost_init__() # Lazy async init
|
967
|
-
embedding = self.
|
967
|
+
embedding = await self.embeddings.aembed_query(query)
|
968
968
|
return await self.asimilarity_search_by_vector(
|
969
969
|
embedding=embedding,
|
970
970
|
k=k,
|
@@ -988,7 +988,7 @@ class PGVector(VectorStore):
|
|
988
988
|
List of Documents most similar to the query and score for each.
|
989
989
|
"""
|
990
990
|
assert not self._async_engine, "This method must be called without async_mode"
|
991
|
-
embedding = self.
|
991
|
+
embedding = self.embeddings.embed_query(query)
|
992
992
|
docs = self.similarity_search_with_score_by_vector(
|
993
993
|
embedding=embedding, k=k, filter=filter
|
994
994
|
)
|
@@ -1011,7 +1011,7 @@ class PGVector(VectorStore):
|
|
1011
1011
|
List of Documents most similar to the query and score for each.
|
1012
1012
|
"""
|
1013
1013
|
await self.__apost_init__() # Lazy async init
|
1014
|
-
embedding = self.
|
1014
|
+
embedding = await self.embeddings.aembed_query(query)
|
1015
1015
|
docs = await self.asimilarity_search_with_score_by_vector(
|
1016
1016
|
embedding=embedding, k=k, filter=filter
|
1017
1017
|
)
|
@@ -1065,7 +1065,7 @@ class PGVector(VectorStore):
|
|
1065
1065
|
page_content=result.EmbeddingStore.document,
|
1066
1066
|
metadata=result.EmbeddingStore.cmetadata,
|
1067
1067
|
),
|
1068
|
-
result.distance if self.
|
1068
|
+
result.distance if self.embeddings is not None else None,
|
1069
1069
|
)
|
1070
1070
|
for result in results
|
1071
1071
|
]
|
@@ -1569,7 +1569,7 @@ class PGVector(VectorStore):
|
|
1569
1569
|
**kwargs: Any,
|
1570
1570
|
) -> PGVector:
|
1571
1571
|
"""Return VectorStore initialized from documents and embeddings."""
|
1572
|
-
embeddings = embedding.
|
1572
|
+
embeddings = await embedding.aembed_documents(list(texts))
|
1573
1573
|
return await cls.__afrom(
|
1574
1574
|
texts,
|
1575
1575
|
embeddings,
|
@@ -1992,7 +1992,7 @@ class PGVector(VectorStore):
|
|
1992
1992
|
Returns:
|
1993
1993
|
List[Document]: List of Documents selected by maximal marginal relevance.
|
1994
1994
|
"""
|
1995
|
-
embedding = self.
|
1995
|
+
embedding = self.embeddings.embed_query(query)
|
1996
1996
|
return self.max_marginal_relevance_search_by_vector(
|
1997
1997
|
embedding,
|
1998
1998
|
k=k,
|
@@ -2031,7 +2031,7 @@ class PGVector(VectorStore):
|
|
2031
2031
|
List[Document]: List of Documents selected by maximal marginal relevance.
|
2032
2032
|
"""
|
2033
2033
|
await self.__apost_init__() # Lazy async init
|
2034
|
-
embedding = self.
|
2034
|
+
embedding = await self.embeddings.aembed_query(query)
|
2035
2035
|
return await self.amax_marginal_relevance_search_by_vector(
|
2036
2036
|
embedding,
|
2037
2037
|
k=k,
|
@@ -2070,7 +2070,7 @@ class PGVector(VectorStore):
|
|
2070
2070
|
List[Tuple[Document, float]]: List of Documents selected by maximal marginal
|
2071
2071
|
relevance to the query and score for each.
|
2072
2072
|
"""
|
2073
|
-
embedding = self.
|
2073
|
+
embedding = self.embeddings.embed_query(query)
|
2074
2074
|
docs = self.max_marginal_relevance_search_with_score_by_vector(
|
2075
2075
|
embedding=embedding,
|
2076
2076
|
k=k,
|
@@ -2111,7 +2111,7 @@ class PGVector(VectorStore):
|
|
2111
2111
|
relevance to the query and score for each.
|
2112
2112
|
"""
|
2113
2113
|
await self.__apost_init__() # Lazy async init
|
2114
|
-
embedding = self.
|
2114
|
+
embedding = await self.embeddings.aembed_query(query)
|
2115
2115
|
docs = await self.amax_marginal_relevance_search_with_score_by_vector(
|
2116
2116
|
embedding=embedding,
|
2117
2117
|
k=k,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langchain_postgres-0.0.11 → langchain_postgres-0.0.12}/langchain_postgres/chat_message_histories.py
RENAMED
File without changes
|
File without changes
|
File without changes
|