|
8 | 8 | from ..types.pronunciation_dictionary_version_locator import PronunciationDictionaryVersionLocator
|
9 | 9 | from ..core.request_options import RequestOptions
|
10 | 10 | from ..core.jsonable_encoder import jsonable_encoder
|
| 11 | +from ..core.serialization import convert_and_respect_annotation_metadata |
11 | 12 | from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
12 | 13 | from ..types.http_validation_error import HttpValidationError
|
13 | 14 | from ..core.unchecked_base_model import construct_type
|
@@ -130,8 +131,14 @@ def convert(
|
130 | 131 | "text": text,
|
131 | 132 | "model_id": model_id,
|
132 | 133 | "language_code": language_code,
|
133 |
| - "voice_settings": voice_settings, |
134 |
| - "pronunciation_dictionary_locators": pronunciation_dictionary_locators, |
| 134 | + "voice_settings": convert_and_respect_annotation_metadata( |
| 135 | + object_=voice_settings, annotation=VoiceSettings, direction="write" |
| 136 | + ), |
| 137 | + "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( |
| 138 | + object_=pronunciation_dictionary_locators, |
| 139 | + annotation=typing.Sequence[PronunciationDictionaryVersionLocator], |
| 140 | + direction="write", |
| 141 | + ), |
135 | 142 | "seed": seed,
|
136 | 143 | "previous_text": previous_text,
|
137 | 144 | "next_text": next_text,
|
@@ -262,8 +269,14 @@ def convert_with_timestamps(
|
262 | 269 | "text": text,
|
263 | 270 | "model_id": model_id,
|
264 | 271 | "language_code": language_code,
|
265 |
| - "voice_settings": voice_settings, |
266 |
| - "pronunciation_dictionary_locators": pronunciation_dictionary_locators, |
| 272 | + "voice_settings": convert_and_respect_annotation_metadata( |
| 273 | + object_=voice_settings, annotation=VoiceSettings, direction="write" |
| 274 | + ), |
| 275 | + "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( |
| 276 | + object_=pronunciation_dictionary_locators, |
| 277 | + annotation=typing.Sequence[PronunciationDictionaryVersionLocator], |
| 278 | + direction="write", |
| 279 | + ), |
267 | 280 | "seed": seed,
|
268 | 281 | "previous_text": previous_text,
|
269 | 282 | "next_text": next_text,
|
@@ -404,8 +417,14 @@ def convert_as_stream(
|
404 | 417 | "text": text,
|
405 | 418 | "model_id": model_id,
|
406 | 419 | "language_code": language_code,
|
407 |
| - "voice_settings": voice_settings, |
408 |
| - "pronunciation_dictionary_locators": pronunciation_dictionary_locators, |
| 420 | + "voice_settings": convert_and_respect_annotation_metadata( |
| 421 | + object_=voice_settings, annotation=VoiceSettings, direction="write" |
| 422 | + ), |
| 423 | + "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( |
| 424 | + object_=pronunciation_dictionary_locators, |
| 425 | + annotation=typing.Sequence[PronunciationDictionaryVersionLocator], |
| 426 | + direction="write", |
| 427 | + ), |
409 | 428 | "seed": seed,
|
410 | 429 | "previous_text": previous_text,
|
411 | 430 | "next_text": next_text,
|
@@ -535,8 +554,14 @@ def stream_with_timestamps(
|
535 | 554 | "text": text,
|
536 | 555 | "model_id": model_id,
|
537 | 556 | "language_code": language_code,
|
538 |
| - "voice_settings": voice_settings, |
539 |
| - "pronunciation_dictionary_locators": pronunciation_dictionary_locators, |
| 557 | + "voice_settings": convert_and_respect_annotation_metadata( |
| 558 | + object_=voice_settings, annotation=VoiceSettings, direction="write" |
| 559 | + ), |
| 560 | + "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( |
| 561 | + object_=pronunciation_dictionary_locators, |
| 562 | + annotation=typing.Sequence[PronunciationDictionaryVersionLocator], |
| 563 | + direction="write", |
| 564 | + ), |
540 | 565 | "seed": seed,
|
541 | 566 | "previous_text": previous_text,
|
542 | 567 | "next_text": next_text,
|
@@ -684,8 +709,14 @@ async def main() -> None:
|
684 | 709 | "text": text,
|
685 | 710 | "model_id": model_id,
|
686 | 711 | "language_code": language_code,
|
687 |
| - "voice_settings": voice_settings, |
688 |
| - "pronunciation_dictionary_locators": pronunciation_dictionary_locators, |
| 712 | + "voice_settings": convert_and_respect_annotation_metadata( |
| 713 | + object_=voice_settings, annotation=VoiceSettings, direction="write" |
| 714 | + ), |
| 715 | + "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( |
| 716 | + object_=pronunciation_dictionary_locators, |
| 717 | + annotation=typing.Sequence[PronunciationDictionaryVersionLocator], |
| 718 | + direction="write", |
| 719 | + ), |
689 | 720 | "seed": seed,
|
690 | 721 | "previous_text": previous_text,
|
691 | 722 | "next_text": next_text,
|
@@ -824,8 +855,14 @@ async def main() -> None:
|
824 | 855 | "text": text,
|
825 | 856 | "model_id": model_id,
|
826 | 857 | "language_code": language_code,
|
827 |
| - "voice_settings": voice_settings, |
828 |
| - "pronunciation_dictionary_locators": pronunciation_dictionary_locators, |
| 858 | + "voice_settings": convert_and_respect_annotation_metadata( |
| 859 | + object_=voice_settings, annotation=VoiceSettings, direction="write" |
| 860 | + ), |
| 861 | + "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( |
| 862 | + object_=pronunciation_dictionary_locators, |
| 863 | + annotation=typing.Sequence[PronunciationDictionaryVersionLocator], |
| 864 | + direction="write", |
| 865 | + ), |
829 | 866 | "seed": seed,
|
830 | 867 | "previous_text": previous_text,
|
831 | 868 | "next_text": next_text,
|
@@ -974,8 +1011,14 @@ async def main() -> None:
|
974 | 1011 | "text": text,
|
975 | 1012 | "model_id": model_id,
|
976 | 1013 | "language_code": language_code,
|
977 |
| - "voice_settings": voice_settings, |
978 |
| - "pronunciation_dictionary_locators": pronunciation_dictionary_locators, |
| 1014 | + "voice_settings": convert_and_respect_annotation_metadata( |
| 1015 | + object_=voice_settings, annotation=VoiceSettings, direction="write" |
| 1016 | + ), |
| 1017 | + "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( |
| 1018 | + object_=pronunciation_dictionary_locators, |
| 1019 | + annotation=typing.Sequence[PronunciationDictionaryVersionLocator], |
| 1020 | + direction="write", |
| 1021 | + ), |
979 | 1022 | "seed": seed,
|
980 | 1023 | "previous_text": previous_text,
|
981 | 1024 | "next_text": next_text,
|
@@ -1113,8 +1156,14 @@ async def main() -> None:
|
1113 | 1156 | "text": text,
|
1114 | 1157 | "model_id": model_id,
|
1115 | 1158 | "language_code": language_code,
|
1116 |
| - "voice_settings": voice_settings, |
1117 |
| - "pronunciation_dictionary_locators": pronunciation_dictionary_locators, |
| 1159 | + "voice_settings": convert_and_respect_annotation_metadata( |
| 1160 | + object_=voice_settings, annotation=VoiceSettings, direction="write" |
| 1161 | + ), |
| 1162 | + "pronunciation_dictionary_locators": convert_and_respect_annotation_metadata( |
| 1163 | + object_=pronunciation_dictionary_locators, |
| 1164 | + annotation=typing.Sequence[PronunciationDictionaryVersionLocator], |
| 1165 | + direction="write", |
| 1166 | + ), |
1118 | 1167 | "seed": seed,
|
1119 | 1168 | "previous_text": previous_text,
|
1120 | 1169 | "next_text": next_text,
|
|
0 commit comments