Skip to content

fix: DeepSeek-V3.x tool calling on ChatBedrockConverse - #688

Merged
Michael Chin (michaelnchin) merged 2 commits into
langchain-ai:mainfrom
michaelnchin:fix/converse-deepseek-tools
Oct 11, 2025
Merged

fix: DeepSeek-V3.x tool calling on ChatBedrockConverse#688
Michael Chin (michaelnchin) merged 2 commits into
langchain-ai:mainfrom
michaelnchin:fix/converse-deepseek-tools

Conversation

@michaelnchin

@michaelnchin Michael Chin (michaelnchin) commented Oct 10, 2025

Copy link
Copy Markdown
Collaborator

The upstream DeepSeek models have the following tool calling restrictions:

  1. DeepSeek-R1 does not support tools. (already handled)
  2. DeepSeek-V3.1 does not work with the auto and named tool choice values. While these options will not be rejected on Converse API side, only any will produce a valid tool call output.
  3. DeepSeek-V3.2-Exp supports tool choice in addition to any, but auto is still not supported.

Accordingly, the PR updates the following:

  • Sets the correct default supports_tool_choice values for DeepSeek V3.x models
  • In bind_tools, overrides the Converse API side default auto tool choice with any for DeepSeek V3.x models.

@3coins Piyush Jain (3coins) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@michaelnchin
Michael Chin (michaelnchin) merged commit 24f6027 into langchain-ai:main Oct 11, 2025
11 checks passed
@michaelnchin
Michael Chin (michaelnchin) deleted the fix/converse-deepseek-tools branch October 11, 2025 00:46
Murilo Moreira Simão (murilosimao) pushed a commit to murilosimao/langchain-aws that referenced this pull request Oct 29, 2025
)

The upstream DeepSeek models have the following tool calling
restrictions:
1) DeepSeek-R1 does not support tools. (already handled)
2) DeepSeek-V3.1 does not work with the `auto` and named `tool` choice
values. While these options will not be rejected on Converse API side,
only `any` will produce a valid tool call output.
3) DeepSeek-V3.2-Exp supports `tool` choice in addition to `any`, but
`auto` is still not supported.

Accordingly, the PR updates the following:
- Sets the correct default `supports_tool_choice` values for DeepSeek
V3.x models
- In `bind_tools`, overrides the Converse API side default `auto` tool
choice with `any` for DeepSeek V3.x models.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants