Skip to content

Release Notes - v0.4.2

Latest

Choose a tag to compare

@zhixiangxue zhixiangxue released this 10 Jun 03:43
· 1 commit to main since this release

Anthropic tool_choice passthrough fix

Fixed _build_params in AnthropicCompatibleProvider so that tool_choice is properly converted from OpenAI format to Anthropic format and included in API requests.

Changes

  • anthropic_compat.py: tool_choice is now popped separately from kwargs and converted via _convert_tool_choice() to Anthropic-native format before being added to request params. Previously it was silently dropped because it was not in the _allowed keyword set.
  • _convert_tool_choice(): New method that maps OpenAI-format tool_choice ("required", {"type": "function", ...}) to Anthropic-format ({"type": "any"}, {"type": "tool", "name": "..."}). Already-Anthropic-format values pass through unchanged.
  • minimax.py: No changes needed — MiniMax uses the Anthropic SDK natively, so it benefits automatically from the base class fix.