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 2

Entity Profile

Dependency Diagram

graph TD
  c72cfdff_e918_26c0_491d_f2427709f589["astream()"]
  8e601be2_5eac_8426_f30d_f1ed37138bd8["RunnableGenerator"]
  c72cfdff_e918_26c0_491d_f2427709f589 -->|defined in| 8e601be2_5eac_8426_f30d_f1ed37138bd8
  27ffa14e_5475_949d_a848_9ac381a3d592["ainvoke()"]
  27ffa14e_5475_949d_a848_9ac381a3d592 -->|calls| c72cfdff_e918_26c0_491d_f2427709f589
  521ad83e_0c69_b97d_0d8e_466b6e030ed2["astream()"]
  521ad83e_0c69_b97d_0d8e_466b6e030ed2 -->|calls| c72cfdff_e918_26c0_491d_f2427709f589
  9c31698a_2e43_9df9_b618_11fd9b0d1d60["atransform()"]
  c72cfdff_e918_26c0_491d_f2427709f589 -->|calls| 9c31698a_2e43_9df9_b618_11fd9b0d1d60
  521ad83e_0c69_b97d_0d8e_466b6e030ed2["astream()"]
  c72cfdff_e918_26c0_491d_f2427709f589 -->|calls| 521ad83e_0c69_b97d_0d8e_466b6e030ed2
  style c72cfdff_e918_26c0_491d_f2427709f589 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/runnables/base.py lines 4378–4387

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

        return self.atransform(input_aiter(), config, **kwargs)

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 4378.
What does astream() call?
astream() calls 2 function(s): astream, atransform.
What calls astream()?
astream() is called by 2 function(s): ainvoke, astream.

Analyze Your Own Codebase

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

Try Supermodel Free