Skip to content

Commit f483544

Browse files
committed
style(core,langchain,qdrant): fix some docstrings for refs
1 parent 01573c1 commit f483544

File tree

3 files changed

+39
-24
lines changed

3 files changed

+39
-24
lines changed

libs/core/langchain_core/vectorstores/base.py

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,9 @@ def search(self, query: str, search_type: str, **kwargs: Any) -> list[Document]:
294294
295295
Args:
296296
query: Input text.
297-
search_type: Type of search to perform. Can be `'similarity'`, `'mmr'`, or
298-
`'similarity_score_threshold'`.
297+
search_type: Type of search to perform.
298+
299+
Can be `'similarity'`, `'mmr'`, or `'similarity_score_threshold'`.
299300
**kwargs: Arguments to pass to the search method.
300301
301302
Returns:
@@ -328,8 +329,9 @@ async def asearch(
328329
329330
Args:
330331
query: Input text.
331-
search_type: Type of search to perform. Can be `'similarity'`, `'mmr'`, or
332-
`'similarity_score_threshold'`.
332+
search_type: Type of search to perform.
333+
334+
Can be `'similarity'`, `'mmr'`, or `'similarity_score_threshold'`.
333335
**kwargs: Arguments to pass to the search method.
334336
335337
Returns:
@@ -460,9 +462,10 @@ def _similarity_search_with_relevance_scores(
460462
Args:
461463
query: Input text.
462464
k: Number of `Document` objects to return.
463-
**kwargs: kwargs to be passed to similarity search. Should include
464-
`score_threshold`, An optional floating point value between `0` to `1`
465-
to filter the resulting set of retrieved docs
465+
**kwargs: Kwargs to be passed to similarity search.
466+
467+
Should include `score_threshold`, an optional floating point value
468+
between `0` to `1` to filter the resulting set of retrieved docs.
466469
467470
Returns:
468471
List of tuples of `(doc, similarity_score)`
@@ -487,9 +490,10 @@ async def _asimilarity_search_with_relevance_scores(
487490
Args:
488491
query: Input text.
489492
k: Number of `Document` objects to return.
490-
**kwargs: kwargs to be passed to similarity search. Should include
491-
`score_threshold`, An optional floating point value between `0` to `1`
492-
to filter the resulting set of retrieved docs
493+
**kwargs: Kwargs to be passed to similarity search.
494+
495+
Should include `score_threshold`, an optional floating point value
496+
between `0` to `1` to filter the resulting set of retrieved docs.
493497
494498
Returns:
495499
List of tuples of `(doc, similarity_score)`
@@ -511,9 +515,10 @@ def similarity_search_with_relevance_scores(
511515
Args:
512516
query: Input text.
513517
k: Number of `Document` objects to return.
514-
**kwargs: kwargs to be passed to similarity search. Should include
515-
`score_threshold`, An optional floating point value between `0` to `1`
516-
to filter the resulting set of retrieved docs
518+
**kwargs: Kwargs to be passed to similarity search.
519+
520+
Should include `score_threshold`, an optional floating point value
521+
between `0` to `1` to filter the resulting set of retrieved docs.
517522
518523
Returns:
519524
List of tuples of `(doc, similarity_score)`.
@@ -560,9 +565,10 @@ async def asimilarity_search_with_relevance_scores(
560565
Args:
561566
query: Input text.
562567
k: Number of `Document` objects to return.
563-
**kwargs: kwargs to be passed to similarity search. Should include
564-
`score_threshold`, An optional floating point value between `0` to `1`
565-
to filter the resulting set of retrieved docs
568+
**kwargs: Kwargs to be passed to similarity search.
569+
570+
Should include `score_threshold`, an optional floating point value
571+
between `0` to `1` to filter the resulting set of retrieved docs.
566572
567573
Returns:
568574
List of tuples of `(doc, similarity_score)`
@@ -900,13 +906,15 @@ def as_retriever(self, **kwargs: Any) -> VectorStoreRetriever:
900906
901907
Args:
902908
**kwargs: Keyword arguments to pass to the search function.
909+
903910
Can include:
904911
905912
* `search_type`: Defines the type of search that the Retriever should
906913
perform. Can be `'similarity'` (default), `'mmr'`, or
907914
`'similarity_score_threshold'`.
908-
* `search_kwargs`: Keyword arguments to pass to the search function. Can
909-
include things like:
915+
* `search_kwargs`: Keyword arguments to pass to the search function.
916+
917+
Can include things like:
910918
911919
* `k`: Amount of documents to return (Default: `4`)
912920
* `score_threshold`: Minimum relevance threshold

libs/langchain/langchain_classic/retrievers/multi_vector.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,18 @@ class MultiVectorRetriever(BaseRetriever):
3232
vectorstore: VectorStore
3333
"""The underlying `VectorStore` to use to store small chunks
3434
and their embedding vectors"""
35+
3536
byte_store: ByteStore | None = None
3637
"""The lower-level backing storage layer for the parent documents"""
38+
3739
docstore: BaseStore[str, Document]
3840
"""The storage interface for the parent documents"""
41+
3942
id_key: str = "doc_id"
43+
4044
search_kwargs: dict = Field(default_factory=dict)
4145
"""Keyword arguments to pass to the search function."""
46+
4247
search_type: SearchType = SearchType.similarity
4348
"""Type of search to perform (similarity / mmr)"""
4449

libs/partners/qdrant/langchain_qdrant/vectorstores.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,9 +1980,10 @@ def _similarity_search_with_relevance_scores(
19801980
Args:
19811981
query: input text
19821982
k: Number of Documents to return.
1983-
**kwargs: kwargs to be passed to similarity search. Should include
1984-
`score_threshold`, An optional floating point value between `0` to `1`
1985-
to filter the resulting set of retrieved docs
1983+
**kwargs: Kwargs to be passed to similarity search.
1984+
1985+
Should include `score_threshold`, an optional floating point value
1986+
between `0` to `1` to filter the resulting set of retrieved docs.
19861987
19871988
Returns:
19881989
List of tuples of `(doc, similarity_score)`
@@ -2004,9 +2005,10 @@ async def _asimilarity_search_with_relevance_scores(
20042005
Args:
20052006
query: input text
20062007
k: Number of Documents to return.
2007-
**kwargs: kwargs to be passed to similarity search. Should include
2008-
`score_threshold`, An optional floating point value between `0` to `1`
2009-
to filter the resulting set of retrieved docs
2008+
**kwargs: Kwargs to be passed to similarity search.
2009+
2010+
Should include `score_threshold`, an optional floating point value
2011+
between `0` to `1` to filter the resulting set of retrieved docs.
20102012
20112013
Returns:
20122014
List of tuples of `(doc, similarity_score)`

0 commit comments

Comments
 (0)