Home / Function/ test_chroma_with_metadatas_with_scores_using_vector() — langchain Function Reference

test_chroma_with_metadatas_with_scores_using_vector() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/partners/chroma/tests/integration_tests/test_vectorstores.py lines 203–225

def test_chroma_with_metadatas_with_scores_using_vector() -> None:
    """Test end to end construction and scored search, using embedding vector."""
    texts = ["foo", "bar", "baz"]
    metadatas = [{"page": str(i)} for i in range(len(texts))]
    ids = [f"id_{i}" for i in range(len(texts))]
    embeddings = FakeEmbeddings()

    docsearch = Chroma.from_texts(
        collection_name="test_collection",
        texts=texts,
        embedding=embeddings,
        metadatas=metadatas,
        ids=ids,
    )
    embedded_query = embeddings.embed_query("foo")
    output = docsearch.similarity_search_by_vector_with_relevance_scores(
        embedding=embedded_query,
        k=1,
    )
    docsearch.delete_collection()
    assert output == [
        (Document(page_content="foo", metadata={"page": "0"}, id="id_0"), 0.0),
    ]

Domain

Subdomains

Frequently Asked Questions

What does test_chroma_with_metadatas_with_scores_using_vector() do?
test_chroma_with_metadatas_with_scores_using_vector() 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_scores_using_vector() defined?
test_chroma_with_metadatas_with_scores_using_vector() is defined in libs/partners/chroma/tests/integration_tests/test_vectorstores.py at line 203.

Analyze Your Own Codebase

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

Try Supermodel Free