Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ else if (message.getMessageType() == MessageType.TOOL) {
updatedRuntimeOptions = ModelOptionsUtils.copyToTarget(((FunctionCallingOptions) prompt.getOptions()),
FunctionCallingOptions.class, OpenAiChatOptions.class);
}
else if (prompt.getOptions() instanceof OpenAiChatOptions) {
else {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same implementation as all the other model integrations. The problem was only in OpenAI.

updatedRuntimeOptions = ModelOptionsUtils.copyToTarget(prompt.getOptions(), ChatOptions.class,
OpenAiChatOptions.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.junit.jupiter.params.provider.ValueSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ai.chat.prompt.ChatOptionsBuilder;
import reactor.core.publisher.Flux;

import org.springframework.ai.chat.client.ChatClient;
Expand Down Expand Up @@ -441,10 +442,11 @@ void multiModalityInputAudio(String modelName) {
List.of(new Media(MimeTypeUtils.parseMimeType("audio/mp3"), audioResource)));

ChatResponse response = chatModel
.call(new Prompt(List.of(userMessage), OpenAiChatOptions.builder().withModel(modelName).build()));
.call(new Prompt(List.of(userMessage), ChatOptionsBuilder.builder().withModel(modelName).build()));

logger.info(response.getResult().getOutput().getContent());
assertThat(response.getResult().getOutput().getContent()).containsIgnoringCase("hobbits");
assertThat(response.getMetadata().getModel()).containsIgnoringCase(modelName);
}

@ParameterizedTest(name = "{0} : {displayName} ")
Expand Down