File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
models/spring-ai-openai/src
main/java/org/springframework/ai/openai
test/java/org/springframework/ai/openai/chat Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -473,7 +473,7 @@ else if (message.getMessageType() == MessageType.TOOL) {
473473 updatedRuntimeOptions = ModelOptionsUtils .copyToTarget (((FunctionCallingOptions ) prompt .getOptions ()),
474474 FunctionCallingOptions .class , OpenAiChatOptions .class );
475475 }
476- else if ( prompt . getOptions () instanceof OpenAiChatOptions ) {
476+ else {
477477 updatedRuntimeOptions = ModelOptionsUtils .copyToTarget (prompt .getOptions (), ChatOptions .class ,
478478 OpenAiChatOptions .class );
479479 }
Original file line number Diff line number Diff line change 3333import org .junit .jupiter .params .provider .ValueSource ;
3434import org .slf4j .Logger ;
3535import org .slf4j .LoggerFactory ;
36+ import org .springframework .ai .chat .prompt .ChatOptionsBuilder ;
3637import reactor .core .publisher .Flux ;
3738
3839import org .springframework .ai .chat .client .ChatClient ;
@@ -441,10 +442,11 @@ void multiModalityInputAudio(String modelName) {
441442 List .of (new Media (MimeTypeUtils .parseMimeType ("audio/mp3" ), audioResource )));
442443
443444 ChatResponse response = chatModel
444- .call (new Prompt (List .of (userMessage ), OpenAiChatOptions .builder ().withModel (modelName ).build ()));
445+ .call (new Prompt (List .of (userMessage ), ChatOptionsBuilder .builder ().withModel (modelName ).build ()));
445446
446447 logger .info (response .getResult ().getOutput ().getContent ());
447448 assertThat (response .getResult ().getOutput ().getContent ()).containsIgnoringCase ("hobbits" );
449+ assertThat (response .getMetadata ().getModel ()).containsIgnoringCase (modelName );
448450 }
449451
450452 @ ParameterizedTest (name = "{0} : {displayName} " )
You can’t perform that action at this time.
0 commit comments