Home / Function/ _validate_collection_for_sparse() — langchain Function Reference

_validate_collection_for_sparse() — langchain Function Reference

Architecture documentation for the _validate_collection_for_sparse() function in qdrant.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  e87ed769_c3ef_2130_ccab_7aaf2537dfc9["_validate_collection_for_sparse()"]
  671b47a0_cdd3_a89d_e90f_0631a4bd67d3["QdrantVectorStore"]
  e87ed769_c3ef_2130_ccab_7aaf2537dfc9 -->|defined in| 671b47a0_cdd3_a89d_e90f_0631a4bd67d3
  f3995a8f_51a1_a376_2f6a_8d9f0f7797e6["_validate_collection_config()"]
  f3995a8f_51a1_a376_2f6a_8d9f0f7797e6 -->|calls| e87ed769_c3ef_2130_ccab_7aaf2537dfc9
  style e87ed769_c3ef_2130_ccab_7aaf2537dfc9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/qdrant/langchain_qdrant/qdrant.py lines 1252–1271

    def _validate_collection_for_sparse(
        cls: type[QdrantVectorStore],
        client: QdrantClient,
        collection_name: str,
        sparse_vector_name: str,
    ) -> None:
        collection_info = client.get_collection(collection_name=collection_name)
        sparse_vector_config = collection_info.config.params.sparse_vectors

        if (
            sparse_vector_config is None
            or sparse_vector_name not in sparse_vector_config
        ):
            msg = (
                f"Existing Qdrant collection {collection_name} does not "
                f"contain sparse vectors named {sparse_vector_name}. "
                f"If you want to recreate the collection, set `force_recreate` "
                f"parameter to `True`."
            )
            raise QdrantVectorStoreError(msg)

Domain

Subdomains

Frequently Asked Questions

What does _validate_collection_for_sparse() do?
_validate_collection_for_sparse() is a function in the langchain codebase, defined in libs/partners/qdrant/langchain_qdrant/qdrant.py.
Where is _validate_collection_for_sparse() defined?
_validate_collection_for_sparse() is defined in libs/partners/qdrant/langchain_qdrant/qdrant.py at line 1252.
What calls _validate_collection_for_sparse()?
_validate_collection_for_sparse() is called by 1 function(s): _validate_collection_config.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free