_get_seed() — langchain Function Reference
Architecture documentation for the _get_seed() function in fake.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD fed78138_7ddc_0056_2420_f229d76e0ee5["_get_seed()"] d30bfa96_ab70_01c0_d5a5_2d42fb9ab6c3["DeterministicFakeEmbedding"] fed78138_7ddc_0056_2420_f229d76e0ee5 -->|defined in| d30bfa96_ab70_01c0_d5a5_2d42fb9ab6c3 8980d8c8_f5cb_1025_0ebb_1036673a833b["embed_documents()"] 8980d8c8_f5cb_1025_0ebb_1036673a833b -->|calls| fed78138_7ddc_0056_2420_f229d76e0ee5 045776a6_9542_a139_96e6_106ad5347fbf["embed_query()"] 045776a6_9542_a139_96e6_106ad5347fbf -->|calls| fed78138_7ddc_0056_2420_f229d76e0ee5 style fed78138_7ddc_0056_2420_f229d76e0ee5 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/embeddings/fake.py lines 119–121
def _get_seed(text: str) -> int:
"""Get a seed for the random generator, using the hash of the text."""
return int(hashlib.sha256(text.encode("utf-8")).hexdigest(), 16) % 10**8
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does _get_seed() do?
_get_seed() is a function in the langchain codebase, defined in libs/core/langchain_core/embeddings/fake.py.
Where is _get_seed() defined?
_get_seed() is defined in libs/core/langchain_core/embeddings/fake.py at line 119.
What calls _get_seed()?
_get_seed() 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