Home / Class/ RunState Class — langchain Architecture

RunState Class — langchain Architecture

Architecture documentation for the RunState class in log_stream.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  7cc8cb81_f80b_3323_6928_c00cc709dca1["RunState"]
  bd3b753a_7a64_0c77_8d7a_afcce4658003["log_stream.py"]
  7cc8cb81_f80b_3323_6928_c00cc709dca1 -->|defined in| bd3b753a_7a64_0c77_8d7a_afcce4658003

Relationship Graph

Source Code

libs/core/langchain_core/tracers/log_stream.py lines 83–112

class RunState(TypedDict):
    """State of the run."""

    id: str
    """ID of the run."""

    streamed_output: list[Any]
    """List of output chunks streamed by `Runnable.stream()`"""

    final_output: Any | None
    """Final output of the run, usually the result of aggregating (`+`) streamed_output.

    Updated throughout the run when supported by the `Runnable`.
    """

    name: str
    """Name of the object being run."""

    type: str
    """Type of the object being run, e.g. prompt, chain, llm, etc."""

    # Do we want tags/metadata on the root run? Client kinda knows it in most situations
    # tags: list[str]

    logs: dict[str, LogEntry]
    """Map of run names to sub-runs.

    If filters were supplied, this list will contain only the runs that matched the
    filters.
    """

Frequently Asked Questions

What is the RunState class?
RunState is a class in the langchain codebase, defined in libs/core/langchain_core/tracers/log_stream.py.
Where is RunState defined?
RunState is defined in libs/core/langchain_core/tracers/log_stream.py at line 83.

Analyze Your Own Codebase

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

Try Supermodel Free