Skip to content
masterclass Buddy

LangChain · Class

AIMessage

AIMessage represents an AI response in a conversation. It stores content and can include tool calls, metadata, a name, and an identifier.

Last updated

Since
v1.3

Syntax

new AIMessage({ content, name?, id?, additional_kwargs?, response_metadata? })

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • BaseMessage
  • contentBlocks
  • tool_calls
  • usage_metadata
  • response_metadata
  • toDict
  • toJSON

Source: AIMessage | @langchain/core | LangChain Reference. Checked 2026-11-03.