Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comment in OpenAiAudioSpeechModel and remove duplicated comment in OpenAiAudioSpeechOptions #932

Closed
Closed
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 @@ -41,23 +41,37 @@
* OpenAI audio speech client implementation for backed by {@link OpenAiAudioApi}.
*
* @author Ahmed Yousri
* @author Hyunjoon Choi
* @see OpenAiAudioApi
* @since 1.0.0-M1
*/
public class OpenAiAudioSpeechModel implements SpeechModel, StreamingSpeechModel {

private final Logger logger = LoggerFactory.getLogger(getClass());

/**
* The default options used for the audio completion requests.
*/
private final OpenAiAudioSpeechOptions defaultOptions;

/**
* The speed of the default voice synthesis.
* @see OpenAiAudioSpeechOptions
*/
private static final Float SPEED = 1.0f;

/**
* The retry template used to retry the OpenAI Audio API calls.
*/
public final RetryTemplate retryTemplate = RetryTemplate.builder()
.maxAttempts(10)
.retryOn(OpenAiApiException.class)
.exponentialBackoff(Duration.ofMillis(2000), 5, Duration.ofMillis(3 * 60000))
.build();

/**
* Low-level access to the OpenAI Audio API.
*/
private final OpenAiAudioApi audioApi;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* Options for OpenAI text to audio - speech synthesis.
*
* @author Ahmed Yousri
* @author Hyunjoon Choi
* @since 1.0.0-M1
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
Expand Down Expand Up @@ -53,7 +54,7 @@ public class OpenAiAudioSpeechOptions implements ModelOptions {

/**
* The format of the audio output. Supported formats are mp3, opus, aac, and flac.
* Defaults to mp3. Defaults to mp3
* Defaults to mp3.
*/
@JsonProperty("response_format")
private AudioResponseFormat responseFormat;
Expand Down