Home / Function/ astream() — langchain Function Reference

astream() — langchain Function Reference

Architecture documentation for the astream() function in base.py from the langchain codebase.

Function python LangChainCore Runnables calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  dea85c11_55cc_7027_52b2_ae175ec1a0cc["astream()"]
  c6a370e4_a02a_c56a_38eb_7ca734dcbfea["RunnableLambda"]
  dea85c11_55cc_7027_52b2_ae175ec1a0cc -->|defined in| c6a370e4_a02a_c56a_38eb_7ca734dcbfea
  1cbe8031_cce3_0270_34d7_1b83f106f5f2["astream()"]
  1cbe8031_cce3_0270_34d7_1b83f106f5f2 -->|calls| dea85c11_55cc_7027_52b2_ae175ec1a0cc
  dac5e541_1204_9fcb_a2a6_e9b9b5845c0c["atransform()"]
  dea85c11_55cc_7027_52b2_ae175ec1a0cc -->|calls| dac5e541_1204_9fcb_a2a6_e9b9b5845c0c
  1cbe8031_cce3_0270_34d7_1b83f106f5f2["astream()"]
  dea85c11_55cc_7027_52b2_ae175ec1a0cc -->|calls| 1cbe8031_cce3_0270_34d7_1b83f106f5f2
  style dea85c11_55cc_7027_52b2_ae175ec1a0cc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/runnables/base.py lines 5259–5269

    async def astream(
        self,
        input: Input,
        config: RunnableConfig | None = None,
        **kwargs: Any | None,
    ) -> AsyncIterator[Output]:
        async def input_aiter() -> AsyncIterator[Input]:
            yield input

        async for chunk in self.atransform(input_aiter(), config, **kwargs):
            yield chunk

Domain

Subdomains

Called By

Frequently Asked Questions

What does astream() do?
astream() is a function in the langchain codebase, defined in libs/core/langchain_core/runnables/base.py.
Where is astream() defined?
astream() is defined in libs/core/langchain_core/runnables/base.py at line 5259.
What does astream() call?
astream() calls 2 function(s): astream, atransform.
What calls astream()?
astream() is called by 1 function(s): astream.

Analyze Your Own Codebase

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

Try Supermodel Free