-
Notifications
You must be signed in to change notification settings - Fork 13
feat: [Orchestration] Unit test embeddings and client refactoring #464
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
feat: [Orchestration] Unit test embeddings and client refactoring #464
Conversation
} | ||
|
||
return executeRequest(jsonRequest); | ||
return executor.execute("/completion", request, CompletionPostResponseSynchronous.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.
(Minor)
static constant for /completion
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationClient.java
Show resolved
Hide resolved
OrchestrationHttpExecutor(@Nonnull final Supplier<HttpDestination> destinationSupplier) | ||
throws OrchestrationClientException { | ||
this.destinationSupplier = destinationSupplier; | ||
} |
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.
(Question)
Why no lombok constructor? :)
responseType, OrchestrationError.class, OrchestrationClientException::new) | ||
.objectMapper(JACKSON); | ||
return client.execute(request, handler); | ||
|
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.
.objectMapper(JACKSON); | ||
return client.execute(request, handler); | ||
|
||
} catch (JsonProcessingException e) { |
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.
(Question)
Don't these need final?
@Nonnull | ||
Stream<OrchestrationChatCompletionDelta> stream(@Nonnull final Object payload) { | ||
try { | ||
|
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.
OrchestrationClientException::new) | ||
.objectMapper(JACKSON) | ||
.handleStreamingResponse(client.executeOpen(null, request, null)); | ||
|
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.
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.
Minor comments can be addressed in Charles PR.
Let's merge, we need to get it done. |
e62952d
into
spec-update/orchestration/fix/streaming-response-type
* Update orchestration based on fix/streaming-response-type * WiP * Latest spec with error classes * regenerate * regenerate * DPI * feat: Add embeddings endpoint and refactor orchestration client (#464) Co-authored-by: Roshin Rajan Panackal <[email protected]> * fix: [Orchestration] Spec update - Filtering, Remove "Synchronous" suffix and Embedding property renaming (#469) * Introduce filtering schema changes and update generated class names - synchronous suffix removed - `createConfig` removed from `ContentFilter` - release notes updated for filtering changes * Introduce filtering schema changes and update generated class names - synchronous suffix removed - `createConfig` removed from `ContentFilter` - release notes updated for filtering changes * Release notes and jacoco coverage work around * Lower min required jacoco coverage complexity and branch rating. - Release note paraphrasing * Update e2e for input filters --------- Co-authored-by: Roshin Rajan Panackal <[email protected]> * Make embedding client endpoint non-visible and update javadoc (minor) * merge main * Formatting * 0.81.4 --------- Co-authored-by: SAP Cloud SDK Bot <[email protected]> Co-authored-by: Roshin Rajan Panackal <[email protected]> Co-authored-by: Roshin Rajan Panackal <[email protected]> Co-authored-by: Alexander Dümont <[email protected]>
* Update orchestration based on fix/streaming-response-type * WiP * Latest spec with error classes * regenerate * regenerate * DPI * feat: Add embeddings endpoint and refactor orchestration client (#464) Co-authored-by: Roshin Rajan Panackal <[email protected]> * fix: [Orchestration] Spec update - Filtering, Remove "Synchronous" suffix and Embedding property renaming (#469) * Introduce filtering schema changes and update generated class names - synchronous suffix removed - `createConfig` removed from `ContentFilter` - release notes updated for filtering changes * Introduce filtering schema changes and update generated class names - synchronous suffix removed - `createConfig` removed from `ContentFilter` - release notes updated for filtering changes * Release notes and jacoco coverage work around * Lower min required jacoco coverage complexity and branch rating. - Release note paraphrasing * Update e2e for input filters --------- Co-authored-by: Roshin Rajan Panackal <[email protected]> * Make embedding client endpoint non-visible and update javadoc (minor) * Integrate v2 spec changes - `ConfigToRequestTransformer` (not fixed) * merge main * `ConfigToRequestTransformer` ready and adapt some tests (minimal) * Formatting * Partial migration of payload to v2 * All json updated * refactor (minor) and renaming * jacoco min threshold lowered * Formatting * Fix e2e test issue * Fix merge error * Formatting * update release notes * partial merge fix * Fix tests and add new mixin for filtering response * Include ErrorResponseStreaming * Update unit testing stream completion * better javadoc and getVersion fix -> getModelVersion * Minor syntax improvement * change from abstract class to interface * Fix message * Add comment --------- Co-authored-by: SAP Cloud SDK Bot <[email protected]> Co-authored-by: I538344 <[email protected]> Co-authored-by: Roshin Rajan Panackal <[email protected]> Co-authored-by: Alexander Dümont <[email protected]>
Context
AI/ai-sdk-java-backlog#270.
Prerequisite:
A new endpoint for embedding
/v2/embeddings
is being added with Orchestration release 6a. This PR contains related model classes and refactored client class to minimize code duplication.Note: This PR also contains changes from other spec update.
Feature scope:
OrchestrationHttpExecutor
(non public) introduced to generalize execution of http calls.Definition of Done
Aligned changes with the JavaScript SDK