LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServer
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/langgraph-sdkuiWithClassMessages
Type●Since v1.8

WithClassMessages

Maps a stream interface to use @langchain/core BaseMessage class instances instead of plain SDK Message objects.

Specifically:

  • messages becomes BaseMessage[]
  • getMessagesMetadata accepts a BaseMessage
  • toolCalls uses ClassToolCallWithResult
  • getToolCalls accepts CoreAIMessage and returns class-based tool call results
  • submit accepts BaseMessage via AcceptBaseMessages
  • history is remapped via HistoryWithBaseMessages
  • Subagent properties use ClassSubagentStreamInterface

React, Angular, and Svelte use this type directly. Vue applies additional Ref/ComputedRef wrapping on top of the shared helper types.

Copy
WithClassMessages: Omit<
  T,
  "messages" | "history" | "getMessagesMetadata" | "toolCalls" | "getToolCalls" | "submit" | "subagents" | "activeSubagents" | "getSubagent" | "getSubagentsByType" | "getSubagentsByMessage"
>  __type  "history" extends keyof T  __type : unknown  "submit" extends keyof T  __type : unknown  "toolCalls" extends keyof T  __type : unknown  "getToolCalls" extends keyof T  __type : unknown  "subagents" extends keyof T  __type : unknown
View source on GitHub