|
23 | 23 | from ._common import set_value_by_path as setv |
24 | 24 |
|
25 | 25 |
|
26 | | -def _AudioTranscriptionConfig_to_mldev( |
27 | | - from_object: Union[dict[str, Any], object], |
28 | | - parent_object: Optional[dict[str, Any]] = None, |
29 | | -) -> dict[str, Any]: |
30 | | - to_object: dict[str, Any] = {} |
31 | | - if getv(from_object, ['language_codes']) is not None: |
32 | | - raise ValueError( |
33 | | - 'language_codes parameter is only supported in Gemini Enterprise Agent' |
34 | | - ' Platform mode, not in Gemini Developer API mode.' |
35 | | - ) |
36 | | - |
37 | | - if getv(from_object, ['language_auto']) is not None: |
38 | | - setv(to_object, ['languageAuto'], getv(from_object, ['language_auto'])) |
39 | | - |
40 | | - if getv(from_object, ['language_hints']) is not None: |
41 | | - setv(to_object, ['languageHints'], getv(from_object, ['language_hints'])) |
42 | | - |
43 | | - if getv(from_object, ['custom_vocabulary']) is not None: |
44 | | - setv( |
45 | | - to_object, |
46 | | - ['customVocabulary'], |
47 | | - getv(from_object, ['custom_vocabulary']), |
48 | | - ) |
49 | | - |
50 | | - if getv(from_object, ['adaptation_phrases']) is not None: |
51 | | - setv( |
52 | | - to_object, |
53 | | - ['adaptationPhrases'], |
54 | | - getv(from_object, ['adaptation_phrases']), |
55 | | - ) |
56 | | - |
57 | | - if getv(from_object, ['word_timestamp']) is not None: |
58 | | - setv(to_object, ['wordTimestamp'], getv(from_object, ['word_timestamp'])) |
59 | | - |
60 | | - if getv(from_object, ['diarization']) is not None: |
61 | | - setv(to_object, ['diarization'], getv(from_object, ['diarization'])) |
62 | | - |
63 | | - return to_object |
64 | | - |
65 | | - |
66 | 26 | def _AuthConfig_to_mldev( |
67 | 27 | from_object: Union[dict[str, Any], object], |
68 | 28 | parent_object: Optional[dict[str, Any]] = None, |
@@ -733,18 +693,14 @@ def _LiveClientSetup_to_mldev( |
733 | 693 | setv( |
734 | 694 | to_object, |
735 | 695 | ['inputAudioTranscription'], |
736 | | - _AudioTranscriptionConfig_to_mldev( |
737 | | - getv(from_object, ['input_audio_transcription']), to_object |
738 | | - ), |
| 696 | + getv(from_object, ['input_audio_transcription']), |
739 | 697 | ) |
740 | 698 |
|
741 | 699 | if getv(from_object, ['output_audio_transcription']) is not None: |
742 | 700 | setv( |
743 | 701 | to_object, |
744 | 702 | ['outputAudioTranscription'], |
745 | | - _AudioTranscriptionConfig_to_mldev( |
746 | | - getv(from_object, ['output_audio_transcription']), to_object |
747 | | - ), |
| 703 | + getv(from_object, ['output_audio_transcription']), |
748 | 704 | ) |
749 | 705 |
|
750 | 706 | if getv(from_object, ['proactivity']) is not None: |
@@ -982,18 +938,14 @@ def _LiveConnectConfig_to_mldev( |
982 | 938 | setv( |
983 | 939 | parent_object, |
984 | 940 | ['setup', 'inputAudioTranscription'], |
985 | | - _AudioTranscriptionConfig_to_mldev( |
986 | | - getv(from_object, ['input_audio_transcription']), to_object |
987 | | - ), |
| 941 | + getv(from_object, ['input_audio_transcription']), |
988 | 942 | ) |
989 | 943 |
|
990 | 944 | if getv(from_object, ['output_audio_transcription']) is not None: |
991 | 945 | setv( |
992 | 946 | parent_object, |
993 | 947 | ['setup', 'outputAudioTranscription'], |
994 | | - _AudioTranscriptionConfig_to_mldev( |
995 | | - getv(from_object, ['output_audio_transcription']), to_object |
996 | | - ), |
| 948 | + getv(from_object, ['output_audio_transcription']), |
997 | 949 | ) |
998 | 950 |
|
999 | 951 | if getv(from_object, ['realtime_input_config']) is not None: |
|
0 commit comments