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 @@ -113,8 +113,8 @@ public enum Voice {
@SerializedName("Aiden")
AIDEN("Aiden"),

@SerializedName("Eldric Saga")
ELDRIC_SAGA("Eldric Saga"),
@SerializedName("Eldric Sage")
ELDRIC_SAGE("Eldric Sage"),

@SerializedName("Mia")
MIA("Mia"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ public class QwenTtsRealtimeConfig {
/** text normalization, default is true */
@Builder.Default Boolean enableTn = true;

/** instructions for tts, default is null */
@Builder.Default String instructions = null;

/** instructions will optimize on server side, default is null */

Choose a reason for hiding this comment

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

medium

The Javadoc for optimizeInstructions is grammatically awkward and could be clearer. A better description would help users understand its purpose. For example: 'Instructions that will be optimized on the server side.'

@Builder.Default String optimizeInstructions = null;
Comment on lines +50 to +54

Choose a reason for hiding this comment

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

high

The newly added parameters instructions and optimizeInstructions are not covered by tests. Please add unit tests in TestQwenTtsRealtime.java to verify that these parameters are correctly serialized and included in the request payload. This is crucial for ensuring the feature works as intended and preventing future regressions.


/** The extra parameters. */
@Builder.Default Map<String, Object> parameters = null;

Expand Down Expand Up @@ -84,6 +90,14 @@ public JsonObject getConfig() {
config.put(QwenTtsRealtimeConstants.ENABLE_TN, enableTn);
}

if (instructions != null) {
config.put(QwenTtsRealtimeConstants.INSTRUCTIONS, instructions);
}

if (optimizeInstructions != null) {
config.put(QwenTtsRealtimeConstants.OPTIMIZE_INSTRUCTIONS, optimizeInstructions);
}

if (parameters != null) {
for (Map.Entry<String, Object> entry : parameters.entrySet()) {
config.put(entry.getKey(), entry.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public class QwenTtsRealtimeConstants {
public static final String BIT_RATE = "bit_rate";
public static final String LANGUAGE_TYPE = "language_type";
public static final String ENABLE_TN = "enable_tn";
public static final String INSTRUCTIONS = "instructions";
public static final String OPTIMIZE_INSTRUCTIONS = "optimize_instructions";
public static final String PROTOCOL_EVENT_ID = "event_id";
public static final String PROTOCOL_TYPE = "type";
public static final String PROTOCOL_SESSION = "session";
Expand Down