Langchain Messages Api
# LangChain Messages API
* * *
## All Message Types
| Type | role | type | Key Attributes | Description |
| --- | --- | --- | --- | --- |
| HumanMessage | user | human | content | User message |
| AIMessage | assistant | ai | content, tool_calls, usage_metadata | AI response |
| AIMessageChunk | assistant | ai | content (incremental) | Streaming token chunks |
| SystemMessage | system | system | content | System instruction |
| ToolMessage | tool | tool | content, tool_call_id, name | Tool execution result |
| RemoveMessage | - | remove | id | Delete specified message |
* * *
## ContentBlock Types (Multimodal Content)
| Type | Description | Use Case |
| --- | --- | --- |
| PlainTextContentBlock | Plain text | Regular text |
| ImageContentBlock | Image (base64 or URL) | Image input for multimodal models |
| AudioContentBlock | Audio | Voice input |
| VideoContentBlock | Video | Video input |
| FileContentBlock | File | Document input |
| ToolCall | Tool call request | Model requests to call a tool |
| ServerToolCall | Server-side tool call | Server-side tool invocation |
YouTip