Home / Function/ test_relevance_search_with_threshold() — langchain Function Reference

test_relevance_search_with_threshold() — langchain Function Reference

Architecture documentation for the test_relevance_search_with_threshold() function in test_search.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  4b57f813_838c_cf7d_1e53_0ce24da6684e["test_relevance_search_with_threshold()"]
  7105a1c4_0f67_8c01_efc7_d00363a3ed66["test_search.py"]
  4b57f813_838c_cf7d_1e53_0ce24da6684e -->|defined in| 7105a1c4_0f67_8c01_efc7_d00363a3ed66
  style 4b57f813_838c_cf7d_1e53_0ce24da6684e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/qdrant/tests/integration_tests/qdrant_vector_store/test_search.py lines 178–200

def test_relevance_search_with_threshold(
    location: str,
    vector_name: str,
) -> None:
    """Test end to end construction and search."""
    texts = ["foo", "bar", "baz"]
    metadatas = [
        {"page": i, "metadata": {"page": i + 1, "pages": [i + 2, -1]}}
        for i in range(len(texts))
    ]
    docsearch = QdrantVectorStore.from_texts(
        texts,
        ConsistentFakeEmbeddings(),
        metadatas=metadatas,
        location=location,
        vector_name=vector_name,
    )

    score_threshold = 0.99
    kwargs = {"score_threshold": score_threshold}
    output = docsearch.similarity_search_with_relevance_scores("foo", k=3, **kwargs)
    assert len(output) == 1
    assert all(score >= score_threshold for _, score in output)

Domain

Subdomains

Frequently Asked Questions

What does test_relevance_search_with_threshold() do?
test_relevance_search_with_threshold() is a function in the langchain codebase, defined in libs/partners/qdrant/tests/integration_tests/qdrant_vector_store/test_search.py.
Where is test_relevance_search_with_threshold() defined?
test_relevance_search_with_threshold() is defined in libs/partners/qdrant/tests/integration_tests/qdrant_vector_store/test_search.py at line 178.

Analyze Your Own Codebase

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

Try Supermodel Free