Skip to content

Commit 0ec7aac

Browse files
iceAndFireisFailedyuhongxiao
andauthored
feat: add encode_format to request of audio speech (#54)
Co-authored-by: yuhongxiao <[email protected]>
1 parent f422602 commit 0ec7aac

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

core/src/main/java/ai/z/openapi/service/audio/AudioSpeechRequest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ public class AudioSpeechRequest extends CommonRequest implements ClientRequest<A
3838
@JsonProperty("response_format")
3939
private String responseFormat;
4040

41+
/**
42+
* Encode format of the generated speech file
43+
*/
44+
@JsonProperty("encode_format")
45+
private String encodeFormat;
46+
4147
/**
4248
* Sensitive word detection control
4349
*/
@@ -50,6 +56,11 @@ public class AudioSpeechRequest extends CommonRequest implements ClientRequest<A
5056
@JsonProperty("watermark_enabled")
5157
private Boolean watermarkEnabled;
5258

59+
/**
60+
* Is streaming response
61+
*/
62+
private Boolean stream;
63+
5364
/**
5465
* Voice speed for speech generation
5566
*/

core/src/test/java/ai/z/openapi/service/audio/AudioServiceTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ void shouldGenerateSpeechFromTextSuccessfully() throws JsonProcessingException {
6565
.model(Constants.ModelTTS)
6666
.input("Hello, this is a test for text-to-speech functionality.")
6767
.voice("tongtong")
68+
.encodeFormat("base64")
6869
.requestId(requestId)
6970
.build();
7071

0 commit comments

Comments
 (0)