Home / File/ test_embeddings.py — langchain Source File

test_embeddings.py — langchain Source File

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

File python LangChainCore MessageInterface 1 imports 3 functions

Entity Profile

Dependency Diagram

graph LR
  c5d945f8_6d76_8e14_e49c_bc2468bd9898["test_embeddings.py"]
  95b17754_18ed_02af_f78c_c5cec5a66ee6["langchain_nomic.embeddings"]
  c5d945f8_6d76_8e14_e49c_bc2468bd9898 --> 95b17754_18ed_02af_f78c_c5cec5a66ee6
  style c5d945f8_6d76_8e14_e49c_bc2468bd9898 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"""Test Nomic embeddings."""

from langchain_nomic.embeddings import NomicEmbeddings


def test_langchain_nomic_embedding_documents() -> None:
    """Test nomic embeddings."""
    documents = ["foo bar"]
    embedding = NomicEmbeddings(model="nomic-embed-text-v1")
    output = embedding.embed_documents(documents)
    assert len(output) == 1
    assert len(output[0]) > 0


def test_langchain_nomic_embedding_query() -> None:
    """Test nomic embeddings."""
    document = "foo bar"
    embedding = NomicEmbeddings(model="nomic-embed-text-v1")
    output = embedding.embed_query(document)
    assert len(output) > 0


def test_langchain_nomic_embedding_dimensionality() -> None:
    """Test nomic embeddings."""
    documents = ["foo bar"]
    embedding = NomicEmbeddings(model="nomic-embed-text-v1.5", dimensionality=256)
    output = embedding.embed_documents(documents)
    assert len(output) == 1
    assert len(output[0]) == 256

Domain

Subdomains

Dependencies

  • langchain_nomic.embeddings

Frequently Asked Questions

What does test_embeddings.py do?
test_embeddings.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_embeddings.py?
test_embeddings.py defines 3 function(s): test_langchain_nomic_embedding_dimensionality, test_langchain_nomic_embedding_documents, test_langchain_nomic_embedding_query.
What does test_embeddings.py depend on?
test_embeddings.py imports 1 module(s): langchain_nomic.embeddings.
Where is test_embeddings.py in the architecture?
test_embeddings.py is located at libs/partners/nomic/tests/integration_tests/test_embeddings.py (domain: LangChainCore, subdomain: MessageInterface, directory: libs/partners/nomic/tests/integration_tests).

Analyze Your Own Codebase

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

Try Supermodel Free