LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    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

    LangGraph Checkpoint
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph-sdk_asyncthreadsThreadsClientupdate
    Methodā—Since v0.3

    update

    Copy
    update(
      self,
      thread_id: str,
      *,
      metadata: Mapping[str, Any],
    View source on GitHub
    ttl
    :
    int
    |
    Mapping
    [
    str
    ,
    Any
    ]
    |
    None
    =
    None
    ,
    headers
    :
    Mapping
    [
    str
    ,
    str
    ]
    |
    None
    =
    None
    ,
    params
    :
    QueryParamTypes
    |
    None
    =
    None
    )
    ->
    Thread

    Parameters

    NameTypeDescription
    thread_id*str

    ID of thread to update.

    metadata*Mapping[str, Any]

    Metadata to merge with existing thread metadata.

    ttlint | Mapping[str, Any] | None
    Default:None
    headersMapping[str, str] | None
    Default:None
    paramsQueryParamTypes | None
    Default:None

    Update a thread.

    client = get_client(url="http://localhost:2024")
    thread = await client.threads.update(
        thread_id="my-thread-id",
        metadata={"number":1},
        ttl=43_200,
    )

    Optional time-to-live in minutes for the thread. You can pass an integer (minutes) or a mapping with keys ttl and optional strategy (defaults to "delete").

    Optional custom headers to include with the request.

    Optional query parameters to include with the request.