Home / Function/ embed_documents() — langchain Function Reference

embed_documents() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  05b784d6_9929_b505_8950_cd1c3c4296a3["embed_documents()"]
  0c74773d_9131_7802_d6df_f19bff9e4247["OllamaEmbeddings"]
  05b784d6_9929_b505_8950_cd1c3c4296a3 -->|defined in| 0c74773d_9131_7802_d6df_f19bff9e4247
  28d29cd2_4f8f_d548_96c7_0edf8c40fb71["embed_query()"]
  28d29cd2_4f8f_d548_96c7_0edf8c40fb71 -->|calls| 05b784d6_9929_b505_8950_cd1c3c4296a3
  style 05b784d6_9929_b505_8950_cd1c3c4296a3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/ollama/langchain_ollama/embeddings.py lines 297–307

    def embed_documents(self, texts: list[str]) -> list[list[float]]:
        """Embed search docs."""
        if not self._client:
            msg = (
                "Ollama client is not initialized. "
                "Please ensure Ollama is running and the model is loaded."
            )
            raise ValueError(msg)
        return self._client.embed(
            self.model, texts, options=self._default_params, keep_alive=self.keep_alive
        )["embeddings"]

Domain

Subdomains

Called By

Frequently Asked Questions

What does embed_documents() do?
embed_documents() is a function in the langchain codebase, defined in libs/partners/ollama/langchain_ollama/embeddings.py.
Where is embed_documents() defined?
embed_documents() is defined in libs/partners/ollama/langchain_ollama/embeddings.py at line 297.
What calls embed_documents()?
embed_documents() is called by 1 function(s): embed_query.

Analyze Your Own Codebase

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

Try Supermodel Free