Skip to content

feat(anthropic): support 1.0 sdk - #39938

Merged
ccurme (ccurme) merged 11 commits into
masterfrom
cc/anthropic-1.0-sdk
Aug 27, 2026
Merged

feat(anthropic): support 1.0 sdk#39938
ccurme (ccurme) merged 11 commits into
masterfrom
cc/anthropic-1.0-sdk

Conversation

@ccurme

Copy link
Copy Markdown
Collaborator

Following https://github.com/anthropics/anthropic-sdk-python/blob/main/MIGRATION.md.

Here we support both major versions in langchain-anthropic.

@socket-security

socket-security Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedanthropic@​0.120.0 ⏵ 1.1.087 -4100100100100

View full report

@open-swe open-swe Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Open SWE Review: No issues found

Open SWE reviewed this PR and found no potential bugs to report.

Open in WebView Open SWE trace

@github-actions github-actions Bot added anthropic `langchain-anthropic` package issues & PRs dependencies Pull requests that update a dependency file (e.g. `pyproject.toml` or `uv.lock`) feature For PRs that implement a new feature; NOT A FEATURE REQUEST integration PR made that is related to a provider partner package integration size: M 200-499 LOC labels Aug 26, 2026
return payload

extra_body = payload.get("extra_body")
if extra_body is not None and not isinstance(extra_body, dict):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra_body accepts any Mapping, not only dict. With anthropic==1.0.0, this currently fails through ChatAnthropic.invoke:

llm.invoke("hello", extra_body=MappingProxyType({"foo": "bar"}))

when temperature is set, because this early return leaves it as an unsupported top-level SDK argument:

TypeError: Messages.create() got an unexpected keyword argument 'temperature'

Could we accept any Mapping, copy it to a dict, and merge the relocated sampling parameters? A regression test using MappingProxyType would cover this path.

@ccurme
ccurme (ccurme) merged commit fd2fbd7 into master Aug 27, 2026
70 checks passed
@ccurme
ccurme (ccurme) deleted the cc/anthropic-1.0-sdk branch August 27, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

anthropic `langchain-anthropic` package issues & PRs dependencies Pull requests that update a dependency file (e.g. `pyproject.toml` or `uv.lock`) feature For PRs that implement a new feature; NOT A FEATURE REQUEST integration PR made that is related to a provider partner package integration size: M 200-499 LOC

2 participants