File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
examples/src/main/java/com/google/genai/examples
src/main/java/com/google/genai Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,7 @@ public static void main(String[] args) throws LineUnavailableException {
154154 .prebuiltVoiceConfig (
155155 PrebuiltVoiceConfig .builder ().voiceName (voiceName ).build ())
156156 .build ())
157+ .languageCode ("en-US" )
157158 .build ())
158159 .build ();
159160
Original file line number Diff line number Diff line change @@ -534,6 +534,13 @@ ObjectNode SpeechConfigToMldev(
534534 toObject ));
535535 }
536536
537+ if (Common .getValueByPath (fromObject , new String [] {"languageCode" }) != null ) {
538+ Common .setValueByPath (
539+ toObject ,
540+ new String [] {"languageCode" },
541+ Common .getValueByPath (fromObject , new String [] {"languageCode" }));
542+ }
543+
537544 return toObject ;
538545 }
539546
@@ -1666,6 +1673,13 @@ ObjectNode SpeechConfigToVertex(
16661673 toObject ));
16671674 }
16681675
1676+ if (Common .getValueByPath (fromObject , new String [] {"languageCode" }) != null ) {
1677+ Common .setValueByPath (
1678+ toObject ,
1679+ new String [] {"languageCode" },
1680+ Common .getValueByPath (fromObject , new String [] {"languageCode" }));
1681+ }
1682+
16691683 return toObject ;
16701684 }
16711685
Original file line number Diff line number Diff line change @@ -33,6 +33,12 @@ public abstract class SpeechConfig extends JsonSerializable {
3333 @ JsonProperty ("voiceConfig" )
3434 public abstract Optional <VoiceConfig > voiceConfig ();
3535
36+ /**
37+ * Language code (ISO 639. e.g. en-US) for the speech synthesization. Only available for Live API.
38+ */
39+ @ JsonProperty ("languageCode" )
40+ public abstract Optional <String > languageCode ();
41+
3642 /** Instantiates a builder for SpeechConfig. */
3743 public static Builder builder () {
3844 return new AutoValue_SpeechConfig .Builder ();
@@ -53,6 +59,9 @@ private static Builder create() {
5359 @ JsonProperty ("voiceConfig" )
5460 public abstract Builder voiceConfig (VoiceConfig voiceConfig );
5561
62+ @ JsonProperty ("languageCode" )
63+ public abstract Builder languageCode (String languageCode );
64+
5665 public abstract SpeechConfig build ();
5766 }
5867
You can’t perform that action at this time.
0 commit comments