Home / File/ fixtures.py — langchain Source File

fixtures.py — langchain Source File

Architecture documentation for fixtures.py, a python file in the langchain codebase. 4 imports, 0 dependents.

File python CoreAbstractions Serialization 4 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  aa1219e1_341b_da02_141c_6c2a3447a455["fixtures.py"]
  2a7f66a7_8738_3d47_375b_70fcaa6ac169["logging"]
  aa1219e1_341b_da02_141c_6c2a3447a455 --> 2a7f66a7_8738_3d47_375b_70fcaa6ac169
  9e98f0a7_ec6e_708f_4f1b_e9428b316e1c["os"]
  aa1219e1_341b_da02_141c_6c2a3447a455 --> 9e98f0a7_ec6e_708f_4f1b_e9428b316e1c
  69f1b364_4f43_76af_9887_ecab38a966d8["langchain_qdrant.qdrant"]
  aa1219e1_341b_da02_141c_6c2a3447a455 --> 69f1b364_4f43_76af_9887_ecab38a966d8
  a50ef027_f19e_86a8_94ef_895b4566f94e["tests.integration_tests.common"]
  aa1219e1_341b_da02_141c_6c2a3447a455 --> a50ef027_f19e_86a8_94ef_895b4566f94e
  style aa1219e1_341b_da02_141c_6c2a3447a455 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import logging
import os

from langchain_qdrant.qdrant import RetrievalMode
from tests.integration_tests.common import qdrant_running_locally

logger = logging.getLogger(__name__)


def qdrant_locations(use_in_memory: bool = True) -> list[str]:  # noqa: FBT001, FBT002
    locations = []

    if use_in_memory:
        logger.info("Running Qdrant tests with in-memory mode.")
        locations.append(":memory:")

    if qdrant_running_locally():
        logger.info("Running Qdrant tests with local Qdrant instance.")
        locations.append("http://localhost:6333")

    if qdrant_url := os.getenv("QDRANT_URL"):
        logger.info("Running Qdrant tests with Qdrant instance at %s.", qdrant_url)
        locations.append(qdrant_url)

    return locations


def retrieval_modes(
    *, dense: bool = True, sparse: bool = True, hybrid: bool = True
) -> list[RetrievalMode]:
    modes = []

    if dense:
        modes.append(RetrievalMode.DENSE)

    if sparse:
        modes.append(RetrievalMode.SPARSE)

    if hybrid:
        modes.append(RetrievalMode.HYBRID)

    return modes

Subdomains

Dependencies

  • langchain_qdrant.qdrant
  • logging
  • os
  • tests.integration_tests.common

Frequently Asked Questions

What does fixtures.py do?
fixtures.py is a source file in the langchain codebase, written in python. It belongs to the CoreAbstractions domain, Serialization subdomain.
What functions are defined in fixtures.py?
fixtures.py defines 2 function(s): qdrant_locations, retrieval_modes.
What does fixtures.py depend on?
fixtures.py imports 4 module(s): langchain_qdrant.qdrant, logging, os, tests.integration_tests.common.
Where is fixtures.py in the architecture?
fixtures.py is located at libs/partners/qdrant/tests/integration_tests/fixtures.py (domain: CoreAbstractions, subdomain: Serialization, 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