Skip to content

feat: Anthropic extended thinking #2315

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

Closed

Conversation

apappascs
Copy link
Contributor

@apappascs apappascs commented Feb 25, 2025

  • The thinking option is added to AnthropicChatOptions and ChatCompletionRequest.
  • The AnthropicApi and AnthropicChatModel now handle THINKING and REDACTED_THINKING content blocks in responses. New tests verify parsing of these blocks.
  • Updated method signatures on ChatCompletionRequestBuilder, deprecating old builders with with* prefix in favor of those without.

more details:

Local testing:

./mvnw spring-javaformat:apply
./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true
./mvnw verify -Pintegration-tests -pl models/spring-ai-anthropic

@apappascs apappascs force-pushed the feature/anthropic-thinking branch 4 times, most recently from 7d387cf to 9168278 Compare February 27, 2025 21:15
@apappascs apappascs changed the title feat: Enhance Anthropic integration with Thinking feat: Anthropic extended thinking Feb 27, 2025
@apappascs apappascs force-pushed the feature/anthropic-thinking branch 3 times, most recently from 4eb24fd to 9702cc9 Compare March 2, 2025 20:21
- The `thinking` option is added to `AnthropicChatOptions` and `ChatCompletionRequest`.
- The `AnthropicApi` and `AnthropicChatModel` now handle `THINKING` and `REDACTED_THINKING` content blocks in responses.  New tests verify parsing of these blocks.
- Updated method signatures on ChatCompletionRequestBuilder, deprecating old builders with `with*` prefix in favor of those without.

Signed-off-by: Alexandros Pappas <[email protected]>
Signed-off-by: Alexandros Pappas <[email protected]>
@apappascs apappascs force-pushed the feature/anthropic-thinking branch from 9702cc9 to 0b172cf Compare March 13, 2025 11:13
@dinodanger
Copy link

Any ETA on this?

@markpollack
Copy link
Member

just going through the backlog now, will be part of M7. Thanks, this is a very nice contribution!

@markpollack
Copy link
Member

Bumping to RC :( sorry about that.

@markpollack markpollack modified the milestones: 1.0.0-M7, 1.0.0-RC1 Apr 3, 2025
@tzolov tzolov modified the milestones: 1.0.0-RC1, 1.0.0-M7 Apr 9, 2025
@tzolov
Copy link
Contributor

tzolov commented Apr 9, 2025

Thank you @apappascs
Rebased, squashed and merged at 4f67959

@tzolov tzolov closed this Apr 9, 2025
@dinodanger
Copy link

I'm hitting this error:
#2793

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants