File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
main/java/com/sap/ai/sdk/orchestration/model
test/java/com/sap/ai/sdk/orchestration Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1414
1515import com .fasterxml .jackson .annotation .JsonSubTypes ;
1616import com .fasterxml .jackson .annotation .JsonTypeInfo ;
17+ import com .google .common .annotations .Beta ;
1718
1819/** ChatMessagesInner */
1920@ JsonTypeInfo (use = JsonTypeInfo .Id .DEDUCTION )
2021@ JsonSubTypes ({
2122 @ JsonSubTypes .Type (value = ChatMessage .class ),
2223 @ JsonSubTypes .Type (value = MultiChatMessage .class ),
2324})
25+ @ Beta
2426public interface ChatMessagesInner {}
Original file line number Diff line number Diff line change 1414
1515import com .fasterxml .jackson .annotation .JsonSubTypes ;
1616import com .fasterxml .jackson .annotation .JsonTypeInfo ;
17+ import com .google .common .annotations .Beta ;
1718
1819/** MultiChatMessageContent */
1920@ JsonTypeInfo (use = JsonTypeInfo .Id .DEDUCTION )
2021@ JsonSubTypes ({
2122 @ JsonSubTypes .Type (value = ImageContent .class ),
2223 @ JsonSubTypes .Type (value = TextContent .class ),
2324})
25+ @ Beta
2426public interface MultiChatMessageContent {}
Original file line number Diff line number Diff line change @@ -646,8 +646,11 @@ void streamChatCompletionDeltas() throws IOException {
646646 @ Test
647647 void testRequestWithMultiChatMessage () throws IOException {
648648
649+ var expectedJsonRequest =
650+ new String (fileLoader .apply ("multiChatMessageRequest.json" ).readAllBytes ());
649651 stubFor (
650652 post ("/completion" )
653+ .withRequestBody (equalToJson (expectedJsonRequest , true , false ))
651654 .willReturn (
652655 aResponse ().withStatus (SC_OK ).withBodyFile ("multiChatMessageResponse.json" )));
653656
@@ -739,12 +742,7 @@ void testRequestWithMultiChatMessage() throws IOException {
739742 assertThat (orchestrationResult .getUsage ().getPromptTokens ()).isEqualTo (928 );
740743 assertThat (orchestrationResult .getUsage ().getTotalTokens ()).isEqualTo (959 );
741744
742- try (var requestInputStream = fileLoader .apply ("multiChatMessageRequest.json" )) {
743- final String requestBody = new String (requestInputStream .readAllBytes ());
744- verify (
745- postRequestedFor (urlPathEqualTo ("/completion" ))
746- .withRequestBody (equalToJson (requestBody )));
747- }
745+ verify (postRequestedFor (urlPathEqualTo ("/completion" )));
748746 }
749747
750748 @ SneakyThrows
You can’t perform that action at this time.
0 commit comments