Fix OpenAI audio options merging order

Resolves #601
This commit is contained in:
Christian Tzolov
2024-04-19 18:43:42 +02:00
parent 0eaf7d05c9
commit df92dff36a
2 changed files with 2 additions and 2 deletions

View File

@@ -133,7 +133,7 @@ public class OpenAiAudioSpeechClient implements SpeechClient, StreamingSpeechCli
if (request.getOptions() != null) {
if (request.getOptions() instanceof OpenAiAudioSpeechOptions runtimeOptions) {
options = this.merge(options, runtimeOptions);
options = this.merge(runtimeOptions, options);
}
else {
throw new IllegalArgumentException("Prompt options are not of type SpeechOptions: "

View File

@@ -178,7 +178,7 @@ public class OpenAiAudioTranscriptionClient
if (request.getOptions() != null) {
if (request.getOptions() instanceof OpenAiAudioTranscriptionOptions runtimeOptions) {
options = this.merge(options, runtimeOptions);
options = this.merge(runtimeOptions, options);
}
else {
throw new IllegalArgumentException("Prompt options are not of type TranscriptionOptions: "