-
Notifications
You must be signed in to change notification settings - Fork 8
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
Reduce duplication of ResponseHandlers #244
Conversation
# Conflicts: # docs/guides/ORCHESTRATION_CHAT_COMPLETION.md
# Conflicts: # sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OrchestrationController.java
<coverage.instruction>68%</coverage.instruction> | ||
<coverage.branch>52%</coverage.branch> | ||
<coverage.method>73%</coverage.method> | ||
<coverage.class>87%</coverage.class> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
orchestration tests don't count towards core coverage, therefore I separated the values into individual modules so these bad limits on the core module don't impact the other modules
|
||
static { | ||
HANDLER.JACKSON = JACKSON; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Streaming handlers will be ported in the core module in a later PR if possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The utility class currently has four public API accessors.
I'm feeling a little hesitant to merge this before code reduction is completed.
Let's make sure to address this before releasing 1.1.0
.
core/src/main/java/com/sap/ai/sdk/core/commons/ClientError.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/sap/ai/sdk/core/commons/ClientException.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/sap/ai/sdk/core/commons/ClientResponseHandler.java
Show resolved
Hide resolved
core/src/main/java/com/sap/ai/sdk/core/commons/ClientResponseHandler.java
Outdated
Show resolved
Hide resolved
@Slf4j | ||
@RequiredArgsConstructor | ||
class OrchestrationResponseHandler<T> implements HttpClientResponseHandler<T> { | ||
public class ClientResponseHandler<T, E extends ClientException> | ||
implements HttpClientResponseHandler<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm marking this class as Beta, to discourage externals from using this class.
Maybe we can find a way to make this class not 100% dependent on Apache HTTP Client 5 API(?)
Context
AI/ai-sdk-java-backlog#111.
Feature scope:
OrchestrationResponseHandler
andOpenAiResponseHandler
into a genericClientResponseHandler
Definition of Done
Aligned changes with the JavaScript SDKDocumentation updatedRelease notes updated