embed() — langchain Function Reference
Architecture documentation for the embed() function in embeddings.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 5d3fe9cb_b3db_545c_9ac3_c09c238b4690["embed()"] 0646ce15_0ff5_ff53_3e70_3fd27c663144["NomicEmbeddings"] 5d3fe9cb_b3db_545c_9ac3_c09c238b4690 -->|defined in| 0646ce15_0ff5_ff53_3e70_3fd27c663144 99a82c59_97c1_5050_aab0_84a9dd45930a["embed_documents()"] 99a82c59_97c1_5050_aab0_84a9dd45930a -->|calls| 5d3fe9cb_b3db_545c_9ac3_c09c238b4690 aa8e0525_8e6e_1009_4ff7_dc79b4207f63["embed_query()"] aa8e0525_8e6e_1009_4ff7_dc79b4207f63 -->|calls| 5d3fe9cb_b3db_545c_9ac3_c09c238b4690 style 5d3fe9cb_b3db_545c_9ac3_c09c238b4690 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/nomic/langchain_nomic/embeddings.py lines 97–114
def embed(self, texts: list[str], *, task_type: str) -> list[list[float]]:
"""Embed texts.
Args:
texts: List of texts to embed
task_type: The task type to use when embedding. One of `'search_query'`,
`'search_document'`, `'classification'`, `'clustering'`
"""
output = embed.text(
texts=texts,
model=self.model,
task_type=task_type,
dimensionality=self.dimensionality,
inference_mode=self.inference_mode,
device=self.device,
)
return output["embeddings"]
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does embed() do?
embed() is a function in the langchain codebase, defined in libs/partners/nomic/langchain_nomic/embeddings.py.
Where is embed() defined?
embed() is defined in libs/partners/nomic/langchain_nomic/embeddings.py at line 97.
What calls embed()?
embed() is called by 2 function(s): embed_documents, embed_query.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free