Skip to content

ToolUseBlock and ToolUseBlockParam type conflict for caller nullability #1454

Description

@rusiaaman
  • Anthropic sdk version 0.97.0
  • ToolUseBlock has caller: Optional[Caller] = None which is in conflict with ToolUseBlockParam which has caller: Caller (total=False). This means if you convert ToolUseBlock to ToolUseBlockParam using .to_dict() method the caller field errors.
  • Symptom for me: in Bedrock client after a tool is used sending back response gives Error code: 400 - {'message': 'messages.13.content.1.tool_use.caller: Input should be a valid dictionary or object to extract fields from'}. Doesn't happen with vertex/anthropic clients. Possibly in bedrock client 'caller' field is being set, and thus not excluded in to_dict() method. Explicit .to_dict(exclude_none=True) works

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions