Skip to content

support thinking tokens from chat_claude() #396

@simonpcouch

Description

@simonpcouch

On main, I see:

library(ellmer)

chat_claude(
  model = "claude-3-7-sonnet-latest",
  api_args = list(thinking = list(type = "enabled", budget_tokens = 2000))
)$chat("hey!")
#> ! Unknown delta type "thinking_delta".
#> ! Unknown delta type "thinking_delta".
#> ! Unknown delta type "thinking_delta".
#> ! Unknown delta type "signature_delta".
#> Hi there! How can I help you today? Feel free to ask me any questions or let me
#> know what you'd like to chat
#> Error in `FUN()`:
#> ! Unknown content type "thinking".
#> ℹ This is an internal error that was detected in the ellmer package.
#>   Please report it at <https://github.com/tidyverse/ellmer/issues> with a
#>   reprex (<https://tidyverse.org/help/>) and the full backtrace.

Created on 2025-04-01 with reprex v2.1.1
The above seems to enable thinking just fine, though we just don't yet know how to handle that content type. Mentioned in #394.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions