Skip to content

Conversation

michaelnchin
Copy link
Collaborator

Couple of updates to ChatBedrock/ChatBedrockConverse for Haiku 4.5 support:

  • Allowlisted Haiku 4.5 to use CountTokens API for get_num_tokens_from_messages().
  • Disabled forced tool use + thinking with bind_tools() and with_structured_output(), as Haiku (and Sonnet) 4.5 still do not support this.
  • Updated related unit/integration tests.
    • NOTE: The test_structured_output_tool_choice_not_supported Converse integration test has not been updated to include Haiku 4.5, which appears to behave very inconsistently with a structured output schema compared to previous Claude thinking models. Sonnet 4.5 and older models produce a tool call 100% of the time if the query is directly applicable to the schema. However, on Haiku 4.5, the chance of this happening was observed to be <5%.

Copy link
Collaborator

@3coins 3coins left a comment

Choose a reason for hiding this comment

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

Looks good!

@michaelnchin michaelnchin merged commit da653c3 into langchain-ai:main Oct 22, 2025
10 checks passed
@michaelnchin michaelnchin deleted the fix/haiku-4-5-updates branch October 22, 2025 03:59
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