stream() — langchain Function Reference
Architecture documentation for the stream() function in agent.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD fff15887_2a1c_dee2_d5a0_3a5aa4536868["stream()"] 493d4ce4_2303_08e0_2337_2bee34fe2662["AgentExecutor"] fff15887_2a1c_dee2_d5a0_3a5aa4536868 -->|defined in| 493d4ce4_2303_08e0_2337_2bee34fe2662 f3744a6a_d6e6_3de9_26d0_166fe46f3862["plan()"] f3744a6a_d6e6_3de9_26d0_166fe46f3862 -->|calls| fff15887_2a1c_dee2_d5a0_3a5aa4536868 dd36f14f_cc3c_6f86_0cda_844be39584a3["plan()"] dd36f14f_cc3c_6f86_0cda_844be39584a3 -->|calls| fff15887_2a1c_dee2_d5a0_3a5aa4536868 style fff15887_2a1c_dee2_d5a0_3a5aa4536868 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/agents/agent.py lines 1732–1760
def stream(
self,
input: dict[str, Any] | Any,
config: RunnableConfig | None = None,
**kwargs: Any,
) -> Iterator[AddableDict]:
"""Enables streaming over steps taken to reach final output.
Args:
input: Input to the agent.
config: Config to use.
kwargs: Additional arguments.
Yields:
Addable dictionary.
"""
config = ensure_config(config)
iterator = AgentExecutorIterator(
self,
input,
config.get("callbacks"),
tags=config.get("tags"),
metadata=config.get("metadata"),
run_name=config.get("run_name"),
run_id=config.get("run_id"),
yield_actions=True,
**kwargs,
)
yield from iterator
Domain
Subdomains
Source
Frequently Asked Questions
What does stream() do?
stream() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/agents/agent.py.
Where is stream() defined?
stream() is defined in libs/langchain/langchain_classic/agents/agent.py at line 1732.
What calls stream()?
stream() is called by 2 function(s): plan, plan.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free