Skip to content

Commit 6abcd59

Browse files
committed
Formatting
1 parent bc899a1 commit 6abcd59

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

orchestration/src/test/java/com/sap/ai/sdk/orchestration/OrchestrationUnitTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,12 @@ void streamChatCompletionDeltas() throws IOException {
463463
assertThat(deltaList.get(1).getDeltaContent()).isEqualTo("Sure");
464464
assertThat(deltaList.get(2).getDeltaContent()).isEqualTo("!");
465465

466-
assertThat(deltaList.get(0).getRequestId()).isEqualTo("5bd87b41-6368-4c18-aaae-47ab82e9475b");
467-
assertThat(deltaList.get(1).getRequestId()).isEqualTo("5bd87b41-6368-4c18-aaae-47ab82e9475b");
468-
assertThat(deltaList.get(2).getRequestId()).isEqualTo("5bd87b41-6368-4c18-aaae-47ab82e9475b");
466+
assertThat(deltaList.get(0).getRequestId())
467+
.isEqualTo("5bd87b41-6368-4c18-aaae-47ab82e9475b");
468+
assertThat(deltaList.get(1).getRequestId())
469+
.isEqualTo("5bd87b41-6368-4c18-aaae-47ab82e9475b");
470+
assertThat(deltaList.get(2).getRequestId())
471+
.isEqualTo("5bd87b41-6368-4c18-aaae-47ab82e9475b");
469472

470473
// should be of type LLMModuleResultStreaming, will be fixed with a discriminator
471474
var result0 = (LLMModuleResultSynchronous) deltaList.get(0).getOrchestrationResult();
@@ -489,7 +492,8 @@ void streamChatCompletionDeltas() throws IOException {
489492
List<ChatMessage> templating = deltaList.get(0).getModuleResults().getTemplating();
490493
assertThat(templating).hasSize(1);
491494
assertThat(templating.get(0).getRole()).isEqualTo("user");
492-
assertThat(templating.get(0).getContent()).isEqualTo("Hello world! Why is this phrase so famous?");
495+
assertThat(templating.get(0).getContent())
496+
.isEqualTo("Hello world! Why is this phrase so famous?");
493497

494498
assertThat(result1.getSystemFingerprint()).isEqualTo("fp_808245b034");
495499
assertThat(result1.getId()).isEqualTo("chatcmpl-AYZSQQwWv7ajJsyDBpMG4X01BBJxq");

sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OpenAiController.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ ResponseEntity<ResponseBodyEmitter> streamChatCompletion() {
123123
return ResponseEntity.ok().contentType(MediaType.TEXT_EVENT_STREAM).body(emitter);
124124
}
125125

126-
static void send(
127-
@Nonnull final ResponseBodyEmitter emitter, @Nonnull final String chunk) {
126+
static void send(@Nonnull final ResponseBodyEmitter emitter, @Nonnull final String chunk) {
128127
try {
129128
emitter.send(chunk);
130129
} catch (final IOException e) {

sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ void testStreamChatCompletion() {
4343
stream
4444
// foreach consumes all elements, closing the stream at the end
4545
.forEach(
46-
delta -> {
47-
final String deltaContent = delta.getDeltaContent();
48-
log.info("delta: {}", delta);
49-
if (!deltaContent.isEmpty()) {
50-
filledDeltaCount.incrementAndGet();
51-
}
52-
});
46+
delta -> {
47+
final String deltaContent = delta.getDeltaContent();
48+
log.info("delta: {}", delta);
49+
if (!deltaContent.isEmpty()) {
50+
filledDeltaCount.incrementAndGet();
51+
}
52+
});
5353

5454
// the first two and the last delta don't have any content
5555
// see OpenAiChatCompletionDelta#getDeltaContent
56-
assertThat(filledDeltaCount.get()).isGreaterThan(0);
56+
assertThat(filledDeltaCount.get()).isGreaterThan(0);
5757
}
5858

5959
@Test

0 commit comments

Comments
 (0)