test_embedding_interface.py — langchain Source File
Architecture documentation for test_embedding_interface.py, a python file in the langchain codebase. 8 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 281aead3_087b_5581_6993_3520ab727404["test_embedding_interface.py"] 02f66451_d2a9_e7c3_9765_c3a7594721ad["uuid"] 281aead3_087b_5581_6993_3520ab727404 --> 02f66451_d2a9_e7c3_9765_c3a7594721ad 2bf6d401_816d_d011_3b05_a6114f55ff58["collections.abc"] 281aead3_087b_5581_6993_3520ab727404 --> 2bf6d401_816d_d011_3b05_a6114f55ff58 feec1ec4_6917_867b_d228_b134d0ff8099["typing"] 281aead3_087b_5581_6993_3520ab727404 --> feec1ec4_6917_867b_d228_b134d0ff8099 f69d6389_263d_68a4_7fbf_f14c0602a9ba["pytest"] 281aead3_087b_5581_6993_3520ab727404 --> f69d6389_263d_68a4_7fbf_f14c0602a9ba 67883832_8f96_6ce0_6b88_0267f86654f8["langchain_qdrant"] 281aead3_087b_5581_6993_3520ab727404 --> 67883832_8f96_6ce0_6b88_0267f86654f8 b499c7a8_2fb9_cfc0_4cf2_8686096d49bc["tests.integration_tests.common"] 281aead3_087b_5581_6993_3520ab727404 --> b499c7a8_2fb9_cfc0_4cf2_8686096d49bc 918b8514_ba55_6df2_7254_4598ec160e33["langchain_core.embeddings"] 281aead3_087b_5581_6993_3520ab727404 --> 918b8514_ba55_6df2_7254_4598ec160e33 a2826e40_d594_f57c_31ca_7071620aefc6["qdrant_client"] 281aead3_087b_5581_6993_3520ab727404 --> a2826e40_d594_f57c_31ca_7071620aefc6 style 281aead3_087b_5581_6993_3520ab727404 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
from __future__ import annotations
import uuid
from collections.abc import Callable
from typing import TYPE_CHECKING
import pytest # type: ignore[import-not-found]
from langchain_qdrant import Qdrant
from tests.integration_tests.common import ConsistentFakeEmbeddings
if TYPE_CHECKING:
from langchain_core.embeddings import Embeddings
@pytest.mark.parametrize(
("embeddings", "embedding_function"),
[
(ConsistentFakeEmbeddings(), None),
(ConsistentFakeEmbeddings().embed_query, None),
(None, ConsistentFakeEmbeddings().embed_query),
],
)
def test_qdrant_embedding_interface(
embeddings: Embeddings | None, embedding_function: Callable | None
) -> None:
"""Test Qdrant may accept different types for embeddings."""
from qdrant_client import QdrantClient
client = QdrantClient(":memory:")
collection_name = uuid.uuid4().hex
Qdrant(
client,
collection_name,
embeddings=embeddings,
embedding_function=embedding_function,
)
@pytest.mark.parametrize(
("embeddings", "embedding_function"),
[
(ConsistentFakeEmbeddings(), ConsistentFakeEmbeddings().embed_query),
(None, None),
],
)
def test_qdrant_embedding_interface_raises_value_error(
embeddings: Embeddings | None, embedding_function: Callable | None
) -> None:
"""Test Qdrant requires only one method for embeddings."""
from qdrant_client import QdrantClient
client = QdrantClient(":memory:")
collection_name = uuid.uuid4().hex
with pytest.raises(ValueError):
Qdrant(
client,
collection_name,
embeddings=embeddings,
embedding_function=embedding_function,
)
Domain
Subdomains
Functions
Dependencies
- collections.abc
- langchain_core.embeddings
- langchain_qdrant
- pytest
- qdrant_client
- tests.integration_tests.common
- typing
- uuid
Source
Frequently Asked Questions
What does test_embedding_interface.py do?
test_embedding_interface.py is a source file in the langchain codebase, written in python. It belongs to the LangChainCore domain, MessageInterface subdomain.
What functions are defined in test_embedding_interface.py?
test_embedding_interface.py defines 3 function(s): langchain_core, test_qdrant_embedding_interface, test_qdrant_embedding_interface_raises_value_error.
What does test_embedding_interface.py depend on?
test_embedding_interface.py imports 8 module(s): collections.abc, langchain_core.embeddings, langchain_qdrant, pytest, qdrant_client, tests.integration_tests.common, typing, uuid.
Where is test_embedding_interface.py in the architecture?
test_embedding_interface.py is located at libs/partners/qdrant/tests/integration_tests/test_embedding_interface.py (domain: LangChainCore, subdomain: MessageInterface, directory: libs/partners/qdrant/tests/integration_tests).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free