mirror of
https://github.com/hwchase17/langchain
synced 2024-11-13 19:10:52 +00:00
Improvement[Partner] Improve qdrant vector store (#27251)
- Add static method decorator - Add args for api doc - Fix word spelling Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
parent
81f7daa458
commit
c2072d909a
@ -960,8 +960,8 @@ class QdrantVectorStore(VectorStore):
|
|||||||
|
|
||||||
yield batch_ids, points
|
yield batch_ids, points
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
def _build_payloads(
|
def _build_payloads(
|
||||||
self,
|
|
||||||
texts: Iterable[str],
|
texts: Iterable[str],
|
||||||
metadatas: Optional[List[dict]],
|
metadatas: Optional[List[dict]],
|
||||||
content_payload_key: str,
|
content_payload_key: str,
|
||||||
|
@ -57,7 +57,7 @@ def sync_call_fallback(method: Callable) -> Callable:
|
|||||||
except NotImplementedError:
|
except NotImplementedError:
|
||||||
# If the async method is not implemented, call the synchronous method
|
# If the async method is not implemented, call the synchronous method
|
||||||
# by removing the first letter from the method name. For example,
|
# by removing the first letter from the method name. For example,
|
||||||
# if the async method is called ``aaad_texts``, the synchronous method
|
# if the async method is called ``aadd_texts``, the synchronous method
|
||||||
# will be called ``aad_texts``.
|
# will be called ``aad_texts``.
|
||||||
return await run_in_executor(
|
return await run_in_executor(
|
||||||
None, getattr(self, method.__name__[1:]), *args, **kwargs
|
None, getattr(self, method.__name__[1:]), *args, **kwargs
|
||||||
@ -921,7 +921,7 @@ class Qdrant(VectorStore):
|
|||||||
Maximal marginal relevance optimizes for similarity to query AND diversity
|
Maximal marginal relevance optimizes for similarity to query AND diversity
|
||||||
among selected documents.
|
among selected documents.
|
||||||
Args:
|
Args:
|
||||||
query: Text to look up documents similar to.
|
embedding: Embedding vector to look up documents similar to.
|
||||||
k: Number of Documents to return. Defaults to 4.
|
k: Number of Documents to return. Defaults to 4.
|
||||||
fetch_k: Number of Documents to fetch to pass to MMR algorithm.
|
fetch_k: Number of Documents to fetch to pass to MMR algorithm.
|
||||||
Defaults to 20.
|
Defaults to 20.
|
||||||
@ -984,7 +984,7 @@ class Qdrant(VectorStore):
|
|||||||
Maximal marginal relevance optimizes for similarity to query AND diversity
|
Maximal marginal relevance optimizes for similarity to query AND diversity
|
||||||
among selected documents.
|
among selected documents.
|
||||||
Args:
|
Args:
|
||||||
query: Text to look up documents similar to.
|
embedding: Embedding vector to look up documents similar to.
|
||||||
k: Number of Documents to return. Defaults to 4.
|
k: Number of Documents to return. Defaults to 4.
|
||||||
fetch_k: Number of Documents to fetch to pass to MMR algorithm.
|
fetch_k: Number of Documents to fetch to pass to MMR algorithm.
|
||||||
Defaults to 20.
|
Defaults to 20.
|
||||||
@ -1072,7 +1072,7 @@ class Qdrant(VectorStore):
|
|||||||
Maximal marginal relevance optimizes for similarity to query AND diversity
|
Maximal marginal relevance optimizes for similarity to query AND diversity
|
||||||
among selected documents.
|
among selected documents.
|
||||||
Args:
|
Args:
|
||||||
query: Text to look up documents similar to.
|
embedding: Embedding vector to look up documents similar to.
|
||||||
k: Number of Documents to return. Defaults to 4.
|
k: Number of Documents to return. Defaults to 4.
|
||||||
fetch_k: Number of Documents to fetch to pass to MMR algorithm.
|
fetch_k: Number of Documents to fetch to pass to MMR algorithm.
|
||||||
Defaults to 20.
|
Defaults to 20.
|
||||||
|
Loading…
Reference in New Issue
Block a user