Skip to content

Commit 2c430b0

Browse files
committed
Expose temperature parameter on high-level TTS client
The temperature parameter was added to the raw TTS client via Fern generation but not to the manually-maintained client.py wrapper. This adds it to all 8 synthesize methods.
1 parent b5be3ef commit 2c430b0

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

‎src/hume/tts/client.py‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def synthesize_json(
5252
num_generations: typing.Optional[int] = OMIT,
5353
split_utterances: typing.Optional[bool] = OMIT,
5454
strip_headers: typing.Optional[bool] = OMIT,
55+
temperature: typing.Optional[float] = OMIT,
5556
version: typing.Optional[OctaveVersion] = OMIT,
5657
instant_mode: typing.Optional[bool] = OMIT,
5758
request_options: typing.Optional[RequestOptions] = None,
@@ -94,6 +95,9 @@ def synthesize_json(
9495
strip_headers : typing.Optional[bool]
9596
If enabled, the audio for all the chunks of a generation, once concatenated together, will constitute a single audio file. Otherwise, if disabled, each chunk's audio will be its own audio file, each with its own headers (if applicable).
9697
98+
temperature : typing.Optional[float]
99+
Sampling temperature for the speech generation model. Higher values increase variation; lower values increase consistency.
100+
97101
version : typing.Optional[OctaveVersion]
98102
Selects the Octave model version used to synthesize speech for this request. If you omit this field, Hume automatically routes the request to the most appropriate model. Setting a specific version ensures stable and repeatable behavior across requests.
99103
@@ -146,6 +150,7 @@ def synthesize_json(
146150
num_generations=num_generations,
147151
split_utterances=split_utterances,
148152
strip_headers=strip_headers,
153+
temperature=temperature,
149154
version=version,
150155
instant_mode=instant_mode,
151156
request_options=request_options,
@@ -162,6 +167,7 @@ def synthesize_file(
162167
num_generations: typing.Optional[int] = OMIT,
163168
split_utterances: typing.Optional[bool] = OMIT,
164169
strip_headers: typing.Optional[bool] = OMIT,
170+
temperature: typing.Optional[float] = OMIT,
165171
version: typing.Optional[OctaveVersion] = OMIT,
166172
instant_mode: typing.Optional[bool] = OMIT,
167173
request_options: typing.Optional[RequestOptions] = None,
@@ -204,6 +210,9 @@ def synthesize_file(
204210
strip_headers : typing.Optional[bool]
205211
If enabled, the audio for all the chunks of a generation, once concatenated together, will constitute a single audio file. Otherwise, if disabled, each chunk's audio will be its own audio file, each with its own headers (if applicable).
206212
213+
temperature : typing.Optional[float]
214+
Sampling temperature for the speech generation model. Higher values increase variation; lower values increase consistency.
215+
207216
version : typing.Optional[OctaveVersion]
208217
Selects the Octave model version used to synthesize speech for this request. If you omit this field, Hume automatically routes the request to the most appropriate model. Setting a specific version ensures stable and repeatable behavior across requests.
209218
@@ -251,6 +260,7 @@ def synthesize_file(
251260
num_generations=num_generations,
252261
split_utterances=split_utterances,
253262
strip_headers=strip_headers,
263+
temperature=temperature,
254264
version=version,
255265
instant_mode=instant_mode,
256266
request_options=request_options,
@@ -267,6 +277,7 @@ def synthesize_file_streaming(
267277
num_generations: typing.Optional[int] = OMIT,
268278
split_utterances: typing.Optional[bool] = OMIT,
269279
strip_headers: typing.Optional[bool] = OMIT,
280+
temperature: typing.Optional[float] = OMIT,
270281
version: typing.Optional[OctaveVersion] = OMIT,
271282
instant_mode: typing.Optional[bool] = OMIT,
272283
request_options: typing.Optional[RequestOptions] = None,
@@ -307,6 +318,9 @@ def synthesize_file_streaming(
307318
strip_headers : typing.Optional[bool]
308319
If enabled, the audio for all the chunks of a generation, once concatenated together, will constitute a single audio file. Otherwise, if disabled, each chunk's audio will be its own audio file, each with its own headers (if applicable).
309320
321+
temperature : typing.Optional[float]
322+
Sampling temperature for the speech generation model. Higher values increase variation; lower values increase consistency.
323+
310324
version : typing.Optional[OctaveVersion]
311325
Selects the Octave model version used to synthesize speech for this request. If you omit this field, Hume automatically routes the request to the most appropriate model. Setting a specific version ensures stable and repeatable behavior across requests.
312326
@@ -352,6 +366,7 @@ def synthesize_file_streaming(
352366
num_generations=num_generations,
353367
split_utterances=split_utterances,
354368
strip_headers=strip_headers,
369+
temperature=temperature,
355370
version=version,
356371
instant_mode=instant_mode,
357372
request_options=request_options,
@@ -368,6 +383,7 @@ def synthesize_json_streaming(
368383
num_generations: typing.Optional[int] = OMIT,
369384
split_utterances: typing.Optional[bool] = OMIT,
370385
strip_headers: typing.Optional[bool] = OMIT,
386+
temperature: typing.Optional[float] = OMIT,
371387
version: typing.Optional[OctaveVersion] = OMIT,
372388
instant_mode: typing.Optional[bool] = OMIT,
373389
request_options: typing.Optional[RequestOptions] = None,
@@ -410,6 +426,9 @@ def synthesize_json_streaming(
410426
strip_headers : typing.Optional[bool]
411427
If enabled, the audio for all the chunks of a generation, once concatenated together, will constitute a single audio file. Otherwise, if disabled, each chunk's audio will be its own audio file, each with its own headers (if applicable).
412428
429+
temperature : typing.Optional[float]
430+
Sampling temperature for the speech generation model. Higher values increase variation; lower values increase consistency.
431+
413432
version : typing.Optional[OctaveVersion]
414433
Selects the Octave model version used to synthesize speech for this request. If you omit this field, Hume automatically routes the request to the most appropriate model. Setting a specific version ensures stable and repeatable behavior across requests.
415434
@@ -457,6 +476,7 @@ def synthesize_json_streaming(
457476
num_generations=num_generations,
458477
split_utterances=split_utterances,
459478
strip_headers=strip_headers,
479+
temperature=temperature,
460480
version=version,
461481
instant_mode=instant_mode,
462482
request_options=request_options,
@@ -619,6 +639,7 @@ async def synthesize_json(
619639
num_generations: typing.Optional[int] = OMIT,
620640
split_utterances: typing.Optional[bool] = OMIT,
621641
strip_headers: typing.Optional[bool] = OMIT,
642+
temperature: typing.Optional[float] = OMIT,
622643
version: typing.Optional[OctaveVersion] = OMIT,
623644
instant_mode: typing.Optional[bool] = OMIT,
624645
request_options: typing.Optional[RequestOptions] = None,
@@ -661,6 +682,9 @@ async def synthesize_json(
661682
strip_headers : typing.Optional[bool]
662683
If enabled, the audio for all the chunks of a generation, once concatenated together, will constitute a single audio file. Otherwise, if disabled, each chunk's audio will be its own audio file, each with its own headers (if applicable).
663684
685+
temperature : typing.Optional[float]
686+
Sampling temperature for the speech generation model. Higher values increase variation; lower values increase consistency.
687+
664688
version : typing.Optional[OctaveVersion]
665689
Selects the Octave model version used to synthesize speech for this request. If you omit this field, Hume automatically routes the request to the most appropriate model. Setting a specific version ensures stable and repeatable behavior across requests.
666690
@@ -721,6 +745,7 @@ async def main() -> None:
721745
num_generations=num_generations,
722746
split_utterances=split_utterances,
723747
strip_headers=strip_headers,
748+
temperature=temperature,
724749
version=version,
725750
instant_mode=instant_mode,
726751
request_options=request_options,
@@ -737,6 +762,7 @@ async def synthesize_file(
737762
num_generations: typing.Optional[int] = OMIT,
738763
split_utterances: typing.Optional[bool] = OMIT,
739764
strip_headers: typing.Optional[bool] = OMIT,
765+
temperature: typing.Optional[float] = OMIT,
740766
version: typing.Optional[OctaveVersion] = OMIT,
741767
instant_mode: typing.Optional[bool] = OMIT,
742768
request_options: typing.Optional[RequestOptions] = None,
@@ -779,6 +805,9 @@ async def synthesize_file(
779805
strip_headers : typing.Optional[bool]
780806
If enabled, the audio for all the chunks of a generation, once concatenated together, will constitute a single audio file. Otherwise, if disabled, each chunk's audio will be its own audio file, each with its own headers (if applicable).
781807
808+
temperature : typing.Optional[float]
809+
Sampling temperature for the speech generation model. Higher values increase variation; lower values increase consistency.
810+
782811
version : typing.Optional[OctaveVersion]
783812
Selects the Octave model version used to synthesize speech for this request. If you omit this field, Hume automatically routes the request to the most appropriate model. Setting a specific version ensures stable and repeatable behavior across requests.
784813
@@ -834,6 +863,7 @@ async def main() -> None:
834863
num_generations=num_generations,
835864
split_utterances=split_utterances,
836865
strip_headers=strip_headers,
866+
temperature=temperature,
837867
version=version,
838868
instant_mode=instant_mode,
839869
request_options=request_options,
@@ -851,6 +881,7 @@ async def synthesize_file_streaming(
851881
num_generations: typing.Optional[int] = OMIT,
852882
split_utterances: typing.Optional[bool] = OMIT,
853883
strip_headers: typing.Optional[bool] = OMIT,
884+
temperature: typing.Optional[float] = OMIT,
854885
version: typing.Optional[OctaveVersion] = OMIT,
855886
instant_mode: typing.Optional[bool] = OMIT,
856887
request_options: typing.Optional[RequestOptions] = None,
@@ -891,6 +922,9 @@ async def synthesize_file_streaming(
891922
strip_headers : typing.Optional[bool]
892923
If enabled, the audio for all the chunks of a generation, once concatenated together, will constitute a single audio file. Otherwise, if disabled, each chunk's audio will be its own audio file, each with its own headers (if applicable).
893924
925+
temperature : typing.Optional[float]
926+
Sampling temperature for the speech generation model. Higher values increase variation; lower values increase consistency.
927+
894928
version : typing.Optional[OctaveVersion]
895929
Selects the Octave model version used to synthesize speech for this request. If you omit this field, Hume automatically routes the request to the most appropriate model. Setting a specific version ensures stable and repeatable behavior across requests.
896930
@@ -944,6 +978,7 @@ async def main() -> None:
944978
num_generations=num_generations,
945979
split_utterances=split_utterances,
946980
strip_headers=strip_headers,
981+
temperature=temperature,
947982
version=version,
948983
instant_mode=instant_mode,
949984
request_options=request_options,
@@ -961,6 +996,7 @@ async def synthesize_json_streaming(
961996
num_generations: typing.Optional[int] = OMIT,
962997
split_utterances: typing.Optional[bool] = OMIT,
963998
strip_headers: typing.Optional[bool] = OMIT,
999+
temperature: typing.Optional[float] = OMIT,
9641000
version: typing.Optional[OctaveVersion] = OMIT,
9651001
instant_mode: typing.Optional[bool] = OMIT,
9661002
request_options: typing.Optional[RequestOptions] = None,
@@ -1003,6 +1039,9 @@ async def synthesize_json_streaming(
10031039
strip_headers : typing.Optional[bool]
10041040
If enabled, the audio for all the chunks of a generation, once concatenated together, will constitute a single audio file. Otherwise, if disabled, each chunk's audio will be its own audio file, each with its own headers (if applicable).
10051041
1042+
temperature : typing.Optional[float]
1043+
Sampling temperature for the speech generation model. Higher values increase variation; lower values increase consistency.
1044+
10061045
version : typing.Optional[OctaveVersion]
10071046
Selects the Octave model version used to synthesize speech for this request. If you omit this field, Hume automatically routes the request to the most appropriate model. Setting a specific version ensures stable and repeatable behavior across requests.
10081047
@@ -1058,6 +1097,7 @@ async def main() -> None:
10581097
num_generations=num_generations,
10591098
split_utterances=split_utterances,
10601099
strip_headers=strip_headers,
1100+
temperature=temperature,
10611101
version=version,
10621102
instant_mode=instant_mode,
10631103
request_options=request_options,

0 commit comments

Comments
 (0)