Home / Function/ astream() — langchain Function Reference

astream() — langchain Function Reference

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

Function python LangChainCore Runnables calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  89892239_3bd4_deee_84cd_ee93929f64ad["astream()"]
  915f0e72_2130_6a8d_6929_3a7528446033["RunnablePassthrough"]
  89892239_3bd4_deee_84cd_ee93929f64ad -->|defined in| 915f0e72_2130_6a8d_6929_3a7528446033
  29e5a61e_3192_fcb1_8408_ac325ae0e3cd["astream()"]
  29e5a61e_3192_fcb1_8408_ac325ae0e3cd -->|calls| 89892239_3bd4_deee_84cd_ee93929f64ad
  68f322b4_1349_271a_408d_e2eb04ed643e["atransform()"]
  89892239_3bd4_deee_84cd_ee93929f64ad -->|calls| 68f322b4_1349_271a_408d_e2eb04ed643e
  29e5a61e_3192_fcb1_8408_ac325ae0e3cd["astream()"]
  89892239_3bd4_deee_84cd_ee93929f64ad -->|calls| 29e5a61e_3192_fcb1_8408_ac325ae0e3cd
  style 89892239_3bd4_deee_84cd_ee93929f64ad fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/runnables/passthrough.py lines 336–346

    async def astream(
        self,
        input: Other,
        config: RunnableConfig | None = None,
        **kwargs: Any,
    ) -> AsyncIterator[Other]:
        async def input_aiter() -> AsyncIterator[Other]:
            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/passthrough.py.
Where is astream() defined?
astream() is defined in libs/core/langchain_core/runnables/passthrough.py at line 336.
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