Home / Function/ _stream() — langchain Function Reference

_stream() — langchain Function Reference

Architecture documentation for the _stream() function in test_base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  cd389776_a867_c3a4_8656_f85ca1708f1c["_stream()"]
  5111b6cf_a775_4458_6ca6_9b00e0e84724["ModelWithSyncStream"]
  cd389776_a867_c3a4_8656_f85ca1708f1c -->|defined in| 5111b6cf_a775_4458_6ca6_9b00e0e84724
  55285081_e5e6_6fd1_0b9a_239b90e2ed4d["test_astream_implementation_fallback_to_stream()"]
  55285081_e5e6_6fd1_0b9a_239b90e2ed4d -->|calls| cd389776_a867_c3a4_8656_f85ca1708f1c
  style cd389776_a867_c3a4_8656_f85ca1708f1c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/language_models/llms/test_base.py lines 179–188

        def _stream(
            self,
            prompt: str,
            stop: list[str] | None = None,
            run_manager: CallbackManagerForLLMRun | None = None,
            **kwargs: Any,
        ) -> Iterator[GenerationChunk]:
            """Stream the output of the model."""
            yield GenerationChunk(text="a")
            yield GenerationChunk(text="b")

Domain

Subdomains

Frequently Asked Questions

What does _stream() do?
_stream() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/language_models/llms/test_base.py.
Where is _stream() defined?
_stream() is defined in libs/core/tests/unit_tests/language_models/llms/test_base.py at line 179.
What calls _stream()?
_stream() is called by 1 function(s): test_astream_implementation_fallback_to_stream.

Analyze Your Own Codebase

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

Try Supermodel Free