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
    Pythonlanggraphgraphuidelete_ui_message
    Function●Since v0.3

    delete_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.

    Copy
    delete_ui_message(
      id: str,
      *,
      state_key: str = 'ui'
    ) -> RemoveUIMessage

    Example:

    delete_ui_message("message-123")

    Parameters

    NameTypeDescription
    id*str

    Unique identifier of the UI component to remove.

    state_keystr
    Default:'ui'

    Key in the graph state where the UI messages are stored. Defaults to "ui".

    View source on GitHub