LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Graphs
    • Functional API
    • Pregel
    • Checkpointing
    • Storage
    • Caching
    • Types
    • Runtime
    • Config
    • Errors
    • Constants
    • Channels
    • Agents
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewGraphsFunctional APIPregelCheckpointingStorageCachingTypesRuntimeConfigErrorsConstantsChannelsAgents
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraphgraphui
    Module●Since v0.3

    ui

    Attributes

    attribute
    CONF

    Functions

    Classes

    Type Aliases

    View source on GitHub
    function
    get_config
    function
    get_stream_writer
    function
    push_ui_message
    function
    delete_ui_message
    function
    ui_message_reducer
    class
    UIMessage
    class
    RemoveUIMessage
    typeAlias
    AnyUIMessage

    Access LangGraph StreamWriter from inside a graph node or entrypoint task at runtime.

    Can be called from inside any StateGraph node or functional API task.

    Async with Python < 3.11

    If you are using Python < 3.11 and are running LangGraph asynchronously, get_stream_writer() won't work since it uses contextvar propagation (only available in Python >= 3.11).

    Push a new UI message to update the UI state.

    This function creates and sends a UI message that will be rendered in the UI. It also updates the graph state with the new UI message.

    Delete a UI message by ID from the UI state.

    This function creates and sends a message to remove a UI component from the current state. It also updates the graph state to remove the UI message.

    Merge two lists of UI messages, supporting removing UI messages.

    This function combines two lists of UI messages, handling both regular UI messages and remove-ui messages. When a remove-ui message is encountered, it removes any UI message with the matching ID from the current state.

    A message type for UI updates in LangGraph.

    This TypedDict represents a UI message that can be sent to update the UI state. It contains information about the UI component to render and its properties.

    A message type for removing UI components in LangGraph.

    This TypedDict represents a message that can be sent to remove a UI component from the current state.