Home / Function/ aembed_documents() — langchain Function Reference

aembed_documents() — langchain Function Reference

Architecture documentation for the aembed_documents() function in huggingface_endpoint.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  ca4be2a2_8892_c4d4_558c_825b2ba70690["aembed_documents()"]
  3e578245_e691_a97e_a094_2b8fa981436a["HuggingFaceEndpointEmbeddings"]
  ca4be2a2_8892_c4d4_558c_825b2ba70690 -->|defined in| 3e578245_e691_a97e_a094_2b8fa981436a
  7181a716_5760_c945_1c07_6223a3095f9d["aembed_query()"]
  7181a716_5760_c945_1c07_6223a3095f9d -->|calls| ca4be2a2_8892_c4d4_558c_825b2ba70690
  style ca4be2a2_8892_c4d4_558c_825b2ba70690 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/huggingface/langchain_huggingface/embeddings/huggingface_endpoint.py lines 132–148

    async def aembed_documents(self, texts: list[str]) -> list[list[float]]:
        """Async Call to HuggingFaceHub's embedding endpoint for embedding search docs.

        Args:
            texts: The list of texts to embed.

        Returns:
            List of embeddings, one for each text.

        """
        # replace newlines, which can negatively affect performance.
        texts = [text.replace("\n", " ") for text in texts]
        _model_kwargs = self.model_kwargs or {}
        responses = await self.async_client.feature_extraction(
            text=texts, **_model_kwargs
        )
        return responses.tolist()

Domain

Subdomains

Called By

Frequently Asked Questions

What does aembed_documents() do?
aembed_documents() is a function in the langchain codebase, defined in libs/partners/huggingface/langchain_huggingface/embeddings/huggingface_endpoint.py.
Where is aembed_documents() defined?
aembed_documents() is defined in libs/partners/huggingface/langchain_huggingface/embeddings/huggingface_endpoint.py at line 132.
What calls aembed_documents()?
aembed_documents() is called by 1 function(s): aembed_query.

Analyze Your Own Codebase

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

Try Supermodel Free