Home / Function/ test_aembed_documents() — langchain Function Reference

test_aembed_documents() — langchain Function Reference

Architecture documentation for the test_aembed_documents() function in embeddings.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  07f65a12_7e42_40fc_948c_955646a9e215["test_aembed_documents()"]
  62dd6083_6171_c59e_a7f4_2ef6b850810c["EmbeddingsIntegrationTests"]
  07f65a12_7e42_40fc_948c_955646a9e215 -->|defined in| 62dd6083_6171_c59e_a7f4_2ef6b850810c
  style 07f65a12_7e42_40fc_948c_955646a9e215 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/standard-tests/langchain_tests/integration_tests/embeddings.py lines 101–119

    async def test_aembed_documents(self, model: Embeddings) -> None:
        """Test embedding a list of strings async.

        ??? note "Troubleshooting"

            If this test fails, check that:

            1. The model will generate a list of lists of floats when calling
                `aembed_documents` on a list of strings.
            2. The length of each list is the same.
        """
        documents = ["foo", "bar", "baz"]
        embeddings = await model.aembed_documents(documents)

        assert len(embeddings) == len(documents)
        assert all(isinstance(embedding, list) for embedding in embeddings)
        assert all(isinstance(embedding[0], float) for embedding in embeddings)
        assert len(embeddings[0]) > 0
        assert all(len(embedding) == len(embeddings[0]) for embedding in embeddings)

Domain

Subdomains

Frequently Asked Questions

What does test_aembed_documents() do?
test_aembed_documents() is a function in the langchain codebase, defined in libs/standard-tests/langchain_tests/integration_tests/embeddings.py.
Where is test_aembed_documents() defined?
test_aembed_documents() is defined in libs/standard-tests/langchain_tests/integration_tests/embeddings.py at line 101.

Analyze Your Own Codebase

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

Try Supermodel Free