3434import org .springframework .ai .chat .prompt .Prompt ;
3535import org .springframework .ai .document .MetadataMode ;
3636import org .springframework .ai .image .ImageMessage ;
37+ import org .springframework .ai .image .ImageOptionsBuilder ;
3738import org .springframework .ai .image .ImagePrompt ;
3839import org .springframework .ai .openai .OpenAiAudioTranscriptionModel ;
3940import org .springframework .ai .openai .OpenAiAudioTranscriptionOptions ;
@@ -250,7 +251,8 @@ public void openAiImageTransientError() {
250251 .willThrow (new TransientAiException ("Transient Error 2" ))
251252 .willReturn (ResponseEntity .of (Optional .of (expectedResponse )));
252253
253- var result = this .imageModel .call (new ImagePrompt (List .of (new ImageMessage ("Image Message" ))));
254+ var result = this .imageModel
255+ .call (new ImagePrompt (List .of (new ImageMessage ("Image Message" )), ImageOptionsBuilder .builder ().build ()));
254256
255257 assertThat (result ).isNotNull ();
256258 assertThat (result .getResult ().getOutput ().getUrl ()).isEqualTo ("url678" );
@@ -262,8 +264,8 @@ public void openAiImageTransientError() {
262264 public void openAiImageNonTransientError () {
263265 given (this .openAiImageApi .createImage (isA (OpenAiImageRequest .class )))
264266 .willThrow (new RuntimeException ("Transient Error 1" ));
265- assertThrows (RuntimeException .class ,
266- () -> this . imageModel . call (new ImagePrompt (List .of (new ImageMessage ("Image Message" )))));
267+ assertThrows (RuntimeException .class , () -> this . imageModel
268+ . call (new ImagePrompt (List .of (new ImageMessage ("Image Message" )), ImageOptionsBuilder . builder (). build ( ))));
267269 }
268270
269271 private static class TestRetryListener implements RetryListener {
0 commit comments