Home / Class/ EventData Class — langchain Architecture

EventData Class — langchain Architecture

Architecture documentation for the EventData class in schema.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  0acc391e_5599_6112_82b4_fa8ad8efbe71["EventData"]
  8fc54027_af2e_acf9_1479_472ebaa69eb5["schema.py"]
  0acc391e_5599_6112_82b4_fa8ad8efbe71 -->|defined in| 8fc54027_af2e_acf9_1479_472ebaa69eb5

Relationship Graph

Source Code

libs/core/langchain_core/runnables/schema.py lines 13–53

class EventData(TypedDict, total=False):
    """Data associated with a streaming event."""

    input: Any
    """The input passed to the `Runnable` that generated the event.

    Inputs will sometimes be available at the *START* of the `Runnable`, and
    sometimes at the *END* of the `Runnable`.

    If a `Runnable` is able to stream its inputs, then its input by definition
    won't be known until the *END* of the `Runnable` when it has finished streaming
    its inputs.
    """
    error: NotRequired[BaseException]
    """The error that occurred during the execution of the `Runnable`.

    This field is only available if the `Runnable` raised an exception.

    !!! version-added "Added in `langchain-core` 1.0.0"
    """
    output: Any
    """The output of the `Runnable` that generated the event.

    Outputs will only be available at the *END* of the `Runnable`.

    For most `Runnable` objects, this field can be inferred from the `chunk` field,
    though there might be some exceptions for special a cased `Runnable` (e.g., like
    chat models), which may return more information.
    """
    chunk: Any
    """A streaming chunk from the output that generated the event.

    chunks support addition in general, and adding them up should result
    in the output of the `Runnable` that generated the event.
    """
    tool_call_id: NotRequired[str | None]
    """The tool call ID associated with the tool execution.

    This field is available for the `on_tool_error` event and can be used to
    link errors to specific tool calls in stateless agent implementations.
    """

Frequently Asked Questions

What is the EventData class?
EventData is a class in the langchain codebase, defined in libs/core/langchain_core/runnables/schema.py.
Where is EventData defined?
EventData is defined in libs/core/langchain_core/runnables/schema.py at line 13.

Analyze Your Own Codebase

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

Try Supermodel Free