Repository navigation
feat: [Anthropic] add anthropic foundation models support and tests - #1116
vladimir-a-sap wants to merge 32 commits into
Conversation
Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com>
CharlesDuboisSAP
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Why don't you call execute with our existing ClientResponseHandler given as a parameter, surely that could reduce code duplication?
| @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); |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
This review only concerns the ADRs. I will review the code later (as discussed) :)
Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com>
Co-authored-by: Jonas-Isr <jonas.israel@sap.com>
… into anthropic-claude-support
Context
https://github.com/SAP/ai-sdk-java-backlog/issues/449
Adds Anthropic models support (foundation models) and integration tests
Definition of Done