Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: anthropic extended thinking not working with extended thinking + "output-128k-2025-02-19" #9020

Open
xingyaoww opened this issue Mar 6, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@xingyaoww
Copy link
Collaborator

What happened?

Got this error AFTER i tried to extend to 128k window with sonnet 3.7

Here's the script for repro (too long to put in log output)
test_llm_think.txt

litellm.exceptions.BadRequestError: litellm.BadRequestError: AnthropicException - {"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.0.type: Expected `thinking` or `redacted_thinking`, but found `text`. When `thinking` is enabled, a final `assistant` message must start with a thinking block (preceeding the lastmost set of `tool_use` and `tool_result` blocks). We recommend you include thinking blocks from previous turns. To avoid this requirement, disable `thinking`. Please consult our documentation at https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking"}}

Relevant log output

See attached script

Are you a ML Ops Team?

No

What LiteLLM version are you on ?

branch = "litellm_dev_03_03_2025_p3" commit = "a1a711abfa120e62944c3639620c6bce96671ba5"

Twitter / LinkedIn details

No response

@xingyaoww xingyaoww added the bug Something isn't working label Mar 6, 2025
@xingyaoww
Copy link
Collaborator Author

OK confirmed this issue still happens with latest main!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant