diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OpenAiController.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OpenAiController.java index 9d15231e5..04eba5a70 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OpenAiController.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OpenAiController.java @@ -40,7 +40,7 @@ public class OpenAiController { private static final ObjectMapper MAPPER = new ObjectMapper().setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY); - private Resource sampleQuestionPcm = new ClassPathResource("static/question.pcm"); + private final Resource sampleQuestionPcm = new ClassPathResource("static/question.pcm"); @GetMapping("/chatCompletion") @Nonnull @@ -53,9 +53,9 @@ Object chatCompletion( return response.getContent(); } - @GetMapping(value = "/realtime/smokeTestTextToSpeech", produces = "audio/pcm") + @GetMapping(value = "/realtime/textToSpeech", produces = "audio/pcm") @Nonnull - ResponseEntity smokeTestTextToSpeech() throws TimeoutException { + ResponseEntity textToSpeech() throws TimeoutException { final var respBody = ByteBuffer.allocate(300000); final var lock = new AtomicBoolean(false); final AudioOutputChannel audioOutput = @@ -85,9 +85,9 @@ ResponseEntity smokeTestTextToSpeech() throws TimeoutException { throw new TimeoutException("Timeout waiting for text to speech"); } - @GetMapping(value = "/realtime/smokeTestSpeechToSpeech", produces = "audio/pcm") + @GetMapping(value = "/realtime/speechToSpeech", produces = "audio/pcm") @Nonnull - ResponseEntity smokeTestSpeechToSpeech() throws TimeoutException { + ResponseEntity speechToSpeech() throws TimeoutException { final var respBody = ByteBuffer.allocate(800000); final var lock = new AtomicBoolean(false); final AudioOutputChannel audioOutput = diff --git a/sample-code/spring-app/src/main/resources/static/index.html b/sample-code/spring-app/src/main/resources/static/index.html index 6c1e668f8..e1e45b008 100644 --- a/sample-code/spring-app/src/main/resources/static/index.html +++ b/sample-code/spring-app/src/main/resources/static/index.html @@ -7,28 +7,33 @@