Home / Function/ test_inmemory_call_embeddings_async() — langchain Function Reference

test_inmemory_call_embeddings_async() — langchain Function Reference

Architecture documentation for the test_inmemory_call_embeddings_async() function in test_in_memory.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  ab71cabf_3f6d_1d03_d89f_89da4e291a49["test_inmemory_call_embeddings_async()"]
  a974d690_d5fa_ba65_671d_ce8278eefe7d["test_in_memory.py"]
  ab71cabf_3f6d_1d03_d89f_89da4e291a49 -->|defined in| a974d690_d5fa_ba65_671d_ce8278eefe7d
  style ab71cabf_3f6d_1d03_d89f_89da4e291a49 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/vectorstores/test_in_memory.py lines 209–222

async def test_inmemory_call_embeddings_async() -> None:
    embeddings_mock = Mock(
        wraps=DeterministicFakeEmbedding(size=3),
        aembed_documents=AsyncMock(),
        aembed_query=AsyncMock(),
    )
    store = InMemoryVectorStore(embedding=embeddings_mock)

    await store.aadd_texts("foo")
    await store.asimilarity_search("foo", k=1)

    # Ensure the async embedding function is called
    assert embeddings_mock.aembed_documents.await_count == 1
    assert embeddings_mock.aembed_query.await_count == 1

Domain

Subdomains

Frequently Asked Questions

What does test_inmemory_call_embeddings_async() do?
test_inmemory_call_embeddings_async() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/vectorstores/test_in_memory.py.
Where is test_inmemory_call_embeddings_async() defined?
test_inmemory_call_embeddings_async() is defined in libs/core/tests/unit_tests/vectorstores/test_in_memory.py at line 209.

Analyze Your Own Codebase

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

Try Supermodel Free