Skip to content

fix: Support Claude tool responses#3

Draft
alicemaz wants to merge 1 commit into
iron-cage:masterfrom
alicemaz:claude-tool
Draft

fix: Support Claude tool responses#3
alicemaz wants to merge 1 commit into
iron-cage:masterfrom
alicemaz:claude-tool

Conversation

@alicemaz

@alicemaz alicemaz commented Jan 20, 2026

Copy link
Copy Markdown

currently, tool call response content looks like this:

    content: [
        ResponseContent {
            type: "tool_use",
            text: None,
        },
    ],

with this pr, it looks like this (using ToolChoice::tool asking claude his favorite number):

    content: [
        ToolUse {
            id: (redacted),
            name: "favorite_number",
            input: Object {
                "number": Number(42),
                "reasoning": String("42 is my favorite number because it's famously known as \"the Answer to the Ultimate Question of Life, the Universe, and Everything\" from Douglas Adams' The Hitchhiker's Guide to the Galaxy. It's a number that represents curiosity, wonder, and the search for meaning in the universe. Plus, it's a versatile number that appears in many mathematical and scientific contexts!"),
            },
        },
    ],

I added an Unsupported variant as there are several response types we don't support, most importantly type: "thinking". if this pr is accepted, I'll also add thinking block support in a future pr when I need it

if you like the enum approach, I'll fix up tests to match the new definition. if you prefer to keep the struct, I'm happy to change this pr to follow that approach instead

closes #2

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.

claude tool responses are unsupported

1 participant