Skip to content

feat: [Anthropic] add anthropic foundation models support and tests - #1116

Open
vladimir-a-sap wants to merge 32 commits into
mainfrom
anthropic-claude-support
Open

vladimir-a-sap wants to merge 32 commits into
mainfrom
anthropic-claude-support

Conversation

@vladimir-a-sap

@vladimir-a-sap vladimir-a-sap commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Context

https://github.com/SAP/ai-sdk-java-backlog/issues/449

Adds Anthropic models support (foundation models) and integration tests

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Relevant E2E tests are green (at least locally)
  • Error handling created / updated & covered by the tests above
  • Aligned changes with the JavaScript SDK (followed their ADR here)
  • Documentation updated
  • Release notes updated

@vladimir-a-sap vladimir-a-sap changed the title add anthropic foundation models support and tests feat: add anthropic foundation models support and tests Oct 13, 2026
@vladimir-a-sap
vladimir-a-sap marked this pull request as ready for review October 13, 2026 15:24
@vladimir-a-sap
vladimir-a-sap marked this pull request as draft October 14, 2026 08:47
@vladimir-a-sap
vladimir-a-sap marked this pull request as ready for review October 15, 2026 13:32
@vladimir-a-sap
vladimir-a-sap marked this pull request as draft October 15, 2026 13:33
@vladimir-a-sap
vladimir-a-sap marked this pull request as ready for review October 26, 2026 16:29
Comment thread sample-code/spring-app/pom.xml Resolved
Comment thread pom.xml Resolved
Comment thread pom.xml Resolved
Comment thread pom.xml Resolved
@vladimir-a-sap
vladimir-a-sap marked this pull request as draft November 2, 2026 12:28
@vladimir-a-sap vladimir-a-sap reopened this Nov 2, 2026
@vladimir-a-sap
vladimir-a-sap marked this pull request as ready for review November 5, 2026 15:39

@CharlesDuboisSAP CharlesDuboisSAP left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to add [Anthropic] to the title of the PR and add it to the PR lint workflow.
Also you should still add a modelAvailabilityTest for this class to the in ScenarioTest


@Override
public void close() {
// Apache HttpClient lifecycle is managed by Cloud SDK's ApacheHttpClient5Cache

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you do a proper implementation.

The feature from Cloud SDK that closes open connections is very dubious at best, and was meant for customers that do not handle connection lifecycle properly. We have had many customers that complain about connections still being open and their application failing to open new ones or being out of memory.

  • Please remove this comment as I don't think the Cloud SDK feature is foolproof, and you haven't proved it in a unit test.
  • We already have streaming unit tests that check that the stream gets closed. You could replace the stream unit test with a test that does not mock httpClient, inspired from existing tests, that checks that the stream gets closed.
  • Remove the warning suppression if possible.


try {
if (isStreaming) {
final var apacheResponse = apacheClient.executeOpen(null, apacheRequest, null);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you call execute with our existing ClientResponseHandler given as a parameter, surely that could reduce code duplication?

Comment on lines +62 to +65
@Nonnull final HttpRequest request, @Nonnull final RequestOptions requestOptions) {
final var apacheClient = ApacheHttpClient5Accessor.getHttpClient(destination);
final var isStreaming = isStreaming(request);
final var apacheRequest = toApacheRequest(request, isStreaming);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surely there is a better way to execute the request that does not involve translating the request field by field and translating back the response field by field.

@Jonas-Isr Jonas-Isr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review only concerns the ADRs. I will review the code later (as discussed) :)

@vladimir-a-sap vladimir-a-sap changed the title feat: add anthropic foundation models support and tests feat: [Anthropic] add anthropic foundation models support and tests Nov 6, 2026

This branch has not been deployed

No deployments
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.

5 participants