Home / Function/ test_qdrant_from_texts_raises_error_on_different_distance() — langchain Function Reference

test_qdrant_from_texts_raises_error_on_different_distance() — langchain Function Reference

Architecture documentation for the test_qdrant_from_texts_raises_error_on_different_distance() function in test_from_texts.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  0991c15c_c3d6_0cf6_da7a_1484c829217e["test_qdrant_from_texts_raises_error_on_different_distance()"]
  7804b385_c130_47e1_2a48_71d688ae0935["test_from_texts.py"]
  0991c15c_c3d6_0cf6_da7a_1484c829217e -->|defined in| 7804b385_c130_47e1_2a48_71d688ae0935
  style 0991c15c_c3d6_0cf6_da7a_1484c829217e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/qdrant/tests/integration_tests/async_api/test_from_texts.py lines 183–204

async def test_qdrant_from_texts_raises_error_on_different_distance(
    location: str,
) -> None:
    """Test if Qdrant.afrom_texts raises an exception if distance does not match."""
    collection_name = uuid.uuid4().hex

    await Qdrant.afrom_texts(
        ["lorem", "ipsum", "dolor", "sit", "amet"],
        ConsistentFakeEmbeddings(dimensionality=10),
        collection_name=collection_name,
        distance_func="Cosine",
        location=location,
    )

    with pytest.raises(QdrantException):
        await Qdrant.afrom_texts(
            ["foo", "bar"],
            ConsistentFakeEmbeddings(dimensionality=5),
            collection_name=collection_name,
            distance_func="Euclid",
            location=location,
        )

Domain

Subdomains

Frequently Asked Questions

What does test_qdrant_from_texts_raises_error_on_different_distance() do?
test_qdrant_from_texts_raises_error_on_different_distance() is a function in the langchain codebase, defined in libs/partners/qdrant/tests/integration_tests/async_api/test_from_texts.py.
Where is test_qdrant_from_texts_raises_error_on_different_distance() defined?
test_qdrant_from_texts_raises_error_on_different_distance() is defined in libs/partners/qdrant/tests/integration_tests/async_api/test_from_texts.py at line 183.

Analyze Your Own Codebase

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

Try Supermodel Free