Submission checklist
Package (Required)
Related Issues / PRs
No response
Reproduction Steps / Example Code (Python)
# The two docstring examples on `RunnableWithMessageHistory` in
# `langchain_core.runnables.history` (lines 138 and 191 of `history.py`)
# instantiate the chat model as:
from langchain_anthropic import ChatAnthropic
ChatAnthropic(model="claude-2")
# Anthropic retired the `claude-2` model family in 2025, so anyone
# copy-pasting these examples gets a model-not-found error from the API.
Error Message and Stack Trace (if applicable)
anthropic.NotFoundError: Error code: 404 — {"type":"error","error":{"type":"not_found_error","message":"model: claude-2"}}
Description
The two illustrative examples in the RunnableWithMessageHistory class
docstring (in langchain_core.runnables.history) build a chain with
ChatAnthropic(model="claude-2"). Anthropic retired the claude-2 model
family in 2025, so users copy-pasting the docstring example hit a
not-found error from the Anthropic API.
Expected: the docstring example uses a currently-GA Anthropic model, so
copy-pasting it works.
Actual: the example references a retired model.
Proposed fix: replace both occurrences with claude-sonnet-4-6,
matching the convention already used in langchain_core.runnables.fallbacks
(see the with_fallbacks example). Documentation-only change; no public
API or runtime behavior is affected.
I have a one-file diff ready locally and would like to be assigned this
issue so I can open the PR.
System Info
System Information
OS: Linux
OS Version: #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025
Python Version: 3.12.3 (main, Mar 23 2026, 19:04:32) [GCC 13.3.0]
Package Information
langchain_core: 1.3.2
langsmith: 0.7.31
langchain_protocol: 0.0.10
langchain_tests: 1.1.7
langchain_text_splitters: 1.1.2
Submission checklist
Package (Required)
Related Issues / PRs
No response
Reproduction Steps / Example Code (Python)
Error Message and Stack Trace (if applicable)
anthropic.NotFoundError: Error code: 404 — {"type":"error","error":{"type":"not_found_error","message":"model: claude-2"}}Description
The two illustrative examples in the
RunnableWithMessageHistoryclassdocstring (in
langchain_core.runnables.history) build a chain withChatAnthropic(model="claude-2"). Anthropic retired theclaude-2modelfamily in 2025, so users copy-pasting the docstring example hit a
not-found error from the Anthropic API.
Expected: the docstring example uses a currently-GA Anthropic model, so
copy-pasting it works.
Actual: the example references a retired model.
Proposed fix: replace both occurrences with
claude-sonnet-4-6,matching the convention already used in
langchain_core.runnables.fallbacks(see the
with_fallbacksexample). Documentation-only change; no publicAPI or runtime behavior is affected.
I have a one-file diff ready locally and would like to be assigned this
issue so I can open the PR.
System Info
System Information
Package Information