Skip to content

Conversation

rpanackal
Copy link
Member

@rpanackal rpanackal commented Jun 13, 2025

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:

  • embedding model generation
  • unit test serialization/deserialization
  • OrchestrationHttpExecutor (non public) introduced to generalize execution of http calls.

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Aligned changes with the JavaScript SDK
  • Documentation updated
  • Release notes updated

@rpanackal rpanackal self-assigned this Jun 13, 2025
@rpanackal rpanackal changed the title [Orchestration] Unit test embeddings and client refactoring feat: [Orchestration] Unit test embeddings and client refactoring Jun 13, 2025
@rpanackal rpanackal changed the base branch from main to spec-update/orchestration/fix/streaming-response-type June 13, 2025 15:47
}

return executeRequest(jsonRequest);
return executor.execute("/completion", request, CompletionPostResponseSynchronous.class);
Copy link
Contributor

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

Comment on lines +31 to +34
OrchestrationHttpExecutor(@Nonnull final Supplier<HttpDestination> destinationSupplier)
throws OrchestrationClientException {
this.destinationSupplier = destinationSupplier;
}
Copy link
Contributor

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);

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

.objectMapper(JACKSON);
return client.execute(request, handler);

} catch (JsonProcessingException e) {
Copy link
Contributor

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 {

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

OrchestrationClientException::new)
.objectMapper(JACKSON)
.handleStreamingResponse(client.executeOpen(null, request, null));

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Copy link
Contributor

@newtork newtork left a 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.

@newtork
Copy link
Contributor

newtork commented Jun 18, 2025

Let's merge, we need to get it done.

@newtork newtork merged commit e62952d into spec-update/orchestration/fix/streaming-response-type Jun 18, 2025
8 of 9 checks passed
@newtork newtork deleted the spec-update/orchestration/feat/embed-6a branch June 18, 2025 12:37
newtork added a commit that referenced this pull request Jul 9, 2025
* 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]>
newtork added a commit that referenced this pull request Aug 7, 2025
* 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]>
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.

2 participants