Home / Function/ test_chroma_with_metadatas_with_vectors() — langchain Function Reference

test_chroma_with_metadatas_with_vectors() — langchain Function Reference

Architecture documentation for the test_chroma_with_metadatas_with_vectors() function in test_vectorstores.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  295a5743_c86f_cb83_9c32_e7e370d0120d["test_chroma_with_metadatas_with_vectors()"]
  289e5a4f_8e2e_ddb6_af2e_804f91dabdb8["test_vectorstores.py"]
  295a5743_c86f_cb83_9c32_e7e370d0120d -->|defined in| 289e5a4f_8e2e_ddb6_af2e_804f91dabdb8
  style 295a5743_c86f_cb83_9c32_e7e370d0120d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/chroma/tests/integration_tests/test_vectorstores.py lines 182–200

def test_chroma_with_metadatas_with_vectors() -> None:
    """Test end to end construction and scored search."""
    texts = ["foo", "bar", "baz"]
    metadatas = [{"page": str(i)} for i in range(len(texts))]
    embeddings = ConsistentFakeEmbeddings()
    docsearch = Chroma.from_texts(
        collection_name="test_collection",
        texts=texts,
        embedding=embeddings,
        metadatas=metadatas,
    )
    vec_1 = embeddings.embed_query(texts[0])
    output = docsearch.similarity_search_with_vectors("foo", k=1)
    docsearch.delete_collection()
    doc = output[0][0]
    assert doc.page_content == "foo"
    assert doc.metadata == {"page": "0"}
    assert doc.id is not None
    assert (output[0][1] == vec_1).all()

Domain

Subdomains

Frequently Asked Questions

What does test_chroma_with_metadatas_with_vectors() do?
test_chroma_with_metadatas_with_vectors() is a function in the langchain codebase, defined in libs/partners/chroma/tests/integration_tests/test_vectorstores.py.
Where is test_chroma_with_metadatas_with_vectors() defined?
test_chroma_with_metadatas_with_vectors() is defined in libs/partners/chroma/tests/integration_tests/test_vectorstores.py at line 182.

Analyze Your Own Codebase

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

Try Supermodel Free