Skip to content

Malformed XML-like TextBlock response instead of ToolUseBlock with Batch API #936

Open
@gordonhart

Description

@gordonhart

Seeing an issue with tool use in the Batch API this afternoon. When forcing tool use with tool_choice=dict(type="auto") or tool_choice=dict(type="tool", name="my_tool_name"), the API is returning a TextBlock with content like this (tool name and parameter names replaced with placeholders):

="my_tool_name">
<parameter name="example_parameter">lorem ipsum</parameter>
<parameter name="example_parameter_2">lorem ipsum</parameter>
<parameter name="example_parameter_3">[]</parameter>
</invoke>
</function_calls>

The tool name is correct, the parameter names are correct, and the parameter values are correct for the requested tool. However, rather than having this shaped nicely into a ToolUseBlock with name and input set accordingly, it's yielded as a broken XML string. The rest of the MessageBatchIndividualResponse looks correct.

Only seeing this with the Batch API, and only started seeing this in the past hour or so.

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