Home / File/ _streaming.py — langchain Source File

_streaming.py — langchain Source File

Architecture documentation for _streaming.py, a python file in the langchain codebase. 3 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  8ff14ae1_3f61_2011_e32b_c63015f486ab["_streaming.py"]
  8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3["typing"]
  8ff14ae1_3f61_2011_e32b_c63015f486ab --> 8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3
  cfe2bde5_180e_e3b0_df2b_55b3ebaca8e7["collections.abc"]
  8ff14ae1_3f61_2011_e32b_c63015f486ab --> cfe2bde5_180e_e3b0_df2b_55b3ebaca8e7
  8dfa0cac_d802_3ccd_f710_43a5e70da3a5["uuid"]
  8ff14ae1_3f61_2011_e32b_c63015f486ab --> 8dfa0cac_d802_3ccd_f710_43a5e70da3a5
  style 8ff14ae1_3f61_2011_e32b_c63015f486ab fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"""Internal tracers used for `stream_log` and `astream` events implementations."""

import typing
from collections.abc import AsyncIterator, Iterator
from uuid import UUID

T = typing.TypeVar("T")


# THIS IS USED IN LANGGRAPH.
@typing.runtime_checkable
class _StreamingCallbackHandler(typing.Protocol[T]):
    """Types for streaming callback handlers.

    This is a common mixin that the callback handlers for both astream events and
    astream log inherit from.

    The `tap_output_aiter` method is invoked in some contexts to produce callbacks for
    intermediate results.
    """

    def tap_output_aiter(
        self, run_id: UUID, output: AsyncIterator[T]
    ) -> AsyncIterator[T]:
        """Used for internal astream_log and astream events implementations."""

    def tap_output_iter(self, run_id: UUID, output: Iterator[T]) -> Iterator[T]:
        """Used for internal astream_log and astream events implementations."""


__all__ = [
    "_StreamingCallbackHandler",
]

Subdomains

Dependencies

  • collections.abc
  • typing
  • uuid

Frequently Asked Questions

What does _streaming.py do?
_streaming.py is a source file in the langchain codebase, written in python. It belongs to the CoreAbstractions domain, Serialization subdomain.
What does _streaming.py depend on?
_streaming.py imports 3 module(s): collections.abc, typing, uuid.
Where is _streaming.py in the architecture?
_streaming.py is located at libs/core/langchain_core/tracers/_streaming.py (domain: CoreAbstractions, subdomain: Serialization, directory: libs/core/langchain_core/tracers).

Analyze Your Own Codebase

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

Try Supermodel Free