sarvamai 0.1.8rc4__tar.gz → 0.1.8rc6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/PKG-INFO +1 -1
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/pyproject.toml +1 -1
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/__init__.py +4 -6
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/core/client_wrapper.py +2 -2
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/__init__.py +2 -2
- sarvamai-0.1.8rc6/src/sarvamai/requests/flush_signal.py +14 -0
- sarvamai-0.1.8rc6/src/sarvamai/requests/initialize_connection.py +18 -0
- sarvamai-0.1.8rc6/src/sarvamai/requests/initialize_connection_data.py +83 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/ping_signal.py +5 -0
- sarvamai-0.1.8rc6/src/sarvamai/text_to_speech_streaming/__init__.py +4 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/text_to_speech_streaming/client.py +4 -5
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/text_to_speech_streaming/raw_client.py +4 -5
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/text_to_speech_streaming/socket_client.py +57 -3
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/__init__.py +2 -2
- sarvamai-0.1.8rc4/src/sarvamai/types/close_connection.py → sarvamai-0.1.8rc6/src/sarvamai/types/flush_signal.py +6 -1
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/initialize_connection.py +7 -0
- sarvamai-0.1.8rc6/src/sarvamai/types/initialize_connection_data.py +93 -0
- sarvamai-0.1.8rc6/src/sarvamai/types/initialize_connection_data_speaker.py +7 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/ping_signal.py +5 -0
- sarvamai-0.1.8rc4/src/sarvamai/requests/close_connection.py +0 -9
- sarvamai-0.1.8rc4/src/sarvamai/requests/initialize_connection.py +0 -11
- sarvamai-0.1.8rc4/src/sarvamai/requests/initialize_connection_data.py +0 -22
- sarvamai-0.1.8rc4/src/sarvamai/text_to_speech_streaming/__init__.py +0 -7
- sarvamai-0.1.8rc4/src/sarvamai/text_to_speech_streaming/types/__init__.py +0 -7
- sarvamai-0.1.8rc4/src/sarvamai/text_to_speech_streaming/types/text_to_speech_streaming_model.py +0 -5
- sarvamai-0.1.8rc4/src/sarvamai/types/initialize_connection_data.py +0 -32
- sarvamai-0.1.8rc4/src/sarvamai/types/initialize_connection_data_speaker.py +0 -28
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/README.md +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/chat/__init__.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/chat/client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/chat/raw_client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/core/__init__.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/core/api_error.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/core/datetime_utils.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/core/events.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/core/file.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/core/force_multipart.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/core/http_client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/core/http_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/core/jsonable_encoder.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/core/pydantic_utilities.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/core/query_encoder.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/core/remove_none_from_dict.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/core/request_options.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/core/serialization.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/environment.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/errors/__init__.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/errors/bad_request_error.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/errors/forbidden_error.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/errors/internal_server_error.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/errors/service_unavailable_error.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/errors/too_many_requests_error.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/errors/unprocessable_entity_error.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/play.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/py.typed +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/audio_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/audio_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/audio_output.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/audio_output_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/chat_completion_request_assistant_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/chat_completion_request_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/chat_completion_request_system_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/chat_completion_request_user_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/chat_completion_response_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/choice.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/completion_usage.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/config_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/create_chat_completion_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/diarized_entry.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/diarized_transcript.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/error_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/error_details.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/error_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/error_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/error_response_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/events_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/language_identification_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/send_text.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/send_text_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/speech_to_text_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/speech_to_text_response_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/speech_to_text_streaming_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/speech_to_text_transcription_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/speech_to_text_translate_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/speech_to_text_translate_response_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/speech_to_text_translate_streaming_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/speech_to_text_translate_transcription_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/stop_configuration.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/text_to_speech_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/timestamps_model.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/transcription_metrics.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/translation_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/requests/transliteration_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text/__init__.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text/client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text/raw_client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_streaming/__init__.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_streaming/client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_streaming/raw_client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_streaming/socket_client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_streaming/types/__init__.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_high_vad_sensitivity.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_language_code.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_model.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_vad_signals.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_translate_streaming/__init__.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_translate_streaming/client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_translate_streaming/raw_client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_translate_streaming/socket_client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_translate_streaming/types/__init__.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_high_vad_sensitivity.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_model.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_vad_signals.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/text/__init__.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/text/client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/text/raw_client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/text_to_speech/__init__.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/text_to_speech/client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/text_to_speech/raw_client.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/audio_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/audio_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/audio_output.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/audio_output_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/chat_completion_request_assistant_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/chat_completion_request_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/chat_completion_request_system_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/chat_completion_request_user_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/chat_completion_response_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/choice.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/completion_usage.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/config_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/create_chat_completion_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/diarized_entry.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/diarized_transcript.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/error_code.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/error_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/error_details.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/error_message.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/error_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/error_response_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/events_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/finish_reason.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/format.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/initialize_connection_data_output_audio_bitrate.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/initialize_connection_data_target_language_code.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/language_identification_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/numerals_format.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/reasoning_effort.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/response_type.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/role.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/sarvam_model_ids.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/send_text.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/send_text_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/speech_sample_rate.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/speech_to_text_language.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/speech_to_text_model.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/speech_to_text_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/speech_to_text_response_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/speech_to_text_streaming_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/speech_to_text_transcription_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/speech_to_text_translate_language.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/speech_to_text_translate_model.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/speech_to_text_translate_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/speech_to_text_translate_response_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/speech_to_text_translate_streaming_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/speech_to_text_translate_transcription_data.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/spoken_form_numerals_format.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/stop_configuration.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/text_to_speech_language.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/text_to_speech_model.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/text_to_speech_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/text_to_speech_speaker.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/timestamps_model.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/transcription_metrics.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/translate_mode.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/translate_model.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/translate_source_language.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/translate_speaker_gender.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/translate_target_language.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/translation_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/translatiterate_target_language.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/transliterate_mode.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/transliterate_source_language.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/types/transliteration_response.py +0 -0
- {sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/version.py +0 -0
|
@@ -16,7 +16,6 @@ from .types import (
|
|
|
16
16
|
ChatCompletionRequestUserMessage,
|
|
17
17
|
ChatCompletionResponseMessage,
|
|
18
18
|
Choice,
|
|
19
|
-
CloseConnection,
|
|
20
19
|
CompletionUsage,
|
|
21
20
|
ConfigMessage,
|
|
22
21
|
CreateChatCompletionResponse,
|
|
@@ -30,6 +29,7 @@ from .types import (
|
|
|
30
29
|
ErrorResponseData,
|
|
31
30
|
EventsData,
|
|
32
31
|
FinishReason,
|
|
32
|
+
FlushSignal,
|
|
33
33
|
Format,
|
|
34
34
|
InitializeConnection,
|
|
35
35
|
InitializeConnectionData,
|
|
@@ -110,7 +110,6 @@ from .requests import (
|
|
|
110
110
|
ChatCompletionRequestUserMessageParams,
|
|
111
111
|
ChatCompletionResponseMessageParams,
|
|
112
112
|
ChoiceParams,
|
|
113
|
-
CloseConnectionParams,
|
|
114
113
|
CompletionUsageParams,
|
|
115
114
|
ConfigMessageParams,
|
|
116
115
|
CreateChatCompletionResponseParams,
|
|
@@ -122,6 +121,7 @@ from .requests import (
|
|
|
122
121
|
ErrorResponseDataParams,
|
|
123
122
|
ErrorResponseParams,
|
|
124
123
|
EventsDataParams,
|
|
124
|
+
FlushSignalParams,
|
|
125
125
|
InitializeConnectionDataParams,
|
|
126
126
|
InitializeConnectionParams,
|
|
127
127
|
LanguageIdentificationResponseParams,
|
|
@@ -154,7 +154,6 @@ from .speech_to_text_translate_streaming import (
|
|
|
154
154
|
SpeechToTextTranslateStreamingModel,
|
|
155
155
|
SpeechToTextTranslateStreamingVadSignals,
|
|
156
156
|
)
|
|
157
|
-
from .text_to_speech_streaming import TextToSpeechStreamingModel
|
|
158
157
|
from .version import __version__
|
|
159
158
|
|
|
160
159
|
__all__ = [
|
|
@@ -186,8 +185,6 @@ __all__ = [
|
|
|
186
185
|
"ChatCompletionResponseMessageParams",
|
|
187
186
|
"Choice",
|
|
188
187
|
"ChoiceParams",
|
|
189
|
-
"CloseConnection",
|
|
190
|
-
"CloseConnectionParams",
|
|
191
188
|
"CompletionUsage",
|
|
192
189
|
"CompletionUsageParams",
|
|
193
190
|
"ConfigMessage",
|
|
@@ -212,6 +209,8 @@ __all__ = [
|
|
|
212
209
|
"EventsData",
|
|
213
210
|
"EventsDataParams",
|
|
214
211
|
"FinishReason",
|
|
212
|
+
"FlushSignal",
|
|
213
|
+
"FlushSignalParams",
|
|
215
214
|
"ForbiddenError",
|
|
216
215
|
"Format",
|
|
217
216
|
"InitializeConnection",
|
|
@@ -274,7 +273,6 @@ __all__ = [
|
|
|
274
273
|
"TextToSpeechResponse",
|
|
275
274
|
"TextToSpeechResponseParams",
|
|
276
275
|
"TextToSpeechSpeaker",
|
|
277
|
-
"TextToSpeechStreamingModel",
|
|
278
276
|
"TimestampsModel",
|
|
279
277
|
"TimestampsModelParams",
|
|
280
278
|
"TooManyRequestsError",
|
|
@@ -17,10 +17,10 @@ class BaseClientWrapper:
|
|
|
17
17
|
|
|
18
18
|
def get_headers(self) -> typing.Dict[str, str]:
|
|
19
19
|
headers: typing.Dict[str, str] = {
|
|
20
|
-
"User-Agent": "sarvamai/0.1.
|
|
20
|
+
"User-Agent": "sarvamai/0.1.8rc6",
|
|
21
21
|
"X-Fern-Language": "Python",
|
|
22
22
|
"X-Fern-SDK-Name": "sarvamai",
|
|
23
|
-
"X-Fern-SDK-Version": "0.1.
|
|
23
|
+
"X-Fern-SDK-Version": "0.1.8rc6",
|
|
24
24
|
}
|
|
25
25
|
headers["api-subscription-key"] = self.api_subscription_key
|
|
26
26
|
return headers
|
|
@@ -17,7 +17,6 @@ from .chat_completion_request_system_message import ChatCompletionRequestSystemM
|
|
|
17
17
|
from .chat_completion_request_user_message import ChatCompletionRequestUserMessageParams
|
|
18
18
|
from .chat_completion_response_message import ChatCompletionResponseMessageParams
|
|
19
19
|
from .choice import ChoiceParams
|
|
20
|
-
from .close_connection import CloseConnectionParams
|
|
21
20
|
from .completion_usage import CompletionUsageParams
|
|
22
21
|
from .config_message import ConfigMessageParams
|
|
23
22
|
from .create_chat_completion_response import CreateChatCompletionResponseParams
|
|
@@ -29,6 +28,7 @@ from .error_message import ErrorMessageParams
|
|
|
29
28
|
from .error_response import ErrorResponseParams
|
|
30
29
|
from .error_response_data import ErrorResponseDataParams
|
|
31
30
|
from .events_data import EventsDataParams
|
|
31
|
+
from .flush_signal import FlushSignalParams
|
|
32
32
|
from .initialize_connection import InitializeConnectionParams
|
|
33
33
|
from .initialize_connection_data import InitializeConnectionDataParams
|
|
34
34
|
from .language_identification_response import LanguageIdentificationResponseParams
|
|
@@ -64,7 +64,6 @@ __all__ = [
|
|
|
64
64
|
"ChatCompletionRequestUserMessageParams",
|
|
65
65
|
"ChatCompletionResponseMessageParams",
|
|
66
66
|
"ChoiceParams",
|
|
67
|
-
"CloseConnectionParams",
|
|
68
67
|
"CompletionUsageParams",
|
|
69
68
|
"ConfigMessageParams",
|
|
70
69
|
"CreateChatCompletionResponseParams",
|
|
@@ -76,6 +75,7 @@ __all__ = [
|
|
|
76
75
|
"ErrorResponseDataParams",
|
|
77
76
|
"ErrorResponseParams",
|
|
78
77
|
"EventsDataParams",
|
|
78
|
+
"FlushSignalParams",
|
|
79
79
|
"InitializeConnectionDataParams",
|
|
80
80
|
"InitializeConnectionParams",
|
|
81
81
|
"LanguageIdentificationResponseParams",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class FlushSignalParams(typing_extensions.TypedDict):
|
|
9
|
+
"""
|
|
10
|
+
Forces the text buffer to process immediately, regardless of the min_buffer_size threshold.
|
|
11
|
+
Use this when you need to process remaining text that hasn't reached the minimum buffer size.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
type: typing.Literal["flush"]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from .initialize_connection_data import InitializeConnectionDataParams
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class InitializeConnectionParams(typing_extensions.TypedDict):
|
|
10
|
+
"""
|
|
11
|
+
Configuration message required as the first message after establishing the WebSocket connection.
|
|
12
|
+
This initializes TTS parameters and can be updated at any time during the WebSocket lifecycle
|
|
13
|
+
by sending a new config message. When a config update is sent, any text currently in the buffer
|
|
14
|
+
will be automatically flushed and processed before applying the new configuration.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
type: typing.Literal["config"]
|
|
18
|
+
data: InitializeConnectionDataParams
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from ..types.initialize_connection_data_output_audio_bitrate import InitializeConnectionDataOutputAudioBitrate
|
|
7
|
+
from ..types.initialize_connection_data_speaker import InitializeConnectionDataSpeaker
|
|
8
|
+
from ..types.initialize_connection_data_target_language_code import InitializeConnectionDataTargetLanguageCode
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class InitializeConnectionDataParams(typing_extensions.TypedDict):
|
|
12
|
+
target_language_code: InitializeConnectionDataTargetLanguageCode
|
|
13
|
+
"""
|
|
14
|
+
The language of the text is BCP-47 format
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
speaker: InitializeConnectionDataSpeaker
|
|
18
|
+
"""
|
|
19
|
+
The speaker voice to be used for the output audio.
|
|
20
|
+
|
|
21
|
+
**Default:** Anushka
|
|
22
|
+
|
|
23
|
+
**Model Compatibility (Speakers compatible with respective model):**
|
|
24
|
+
- **bulbul:v2:**
|
|
25
|
+
- Female: Anushka, Manisha, Vidya, Arya
|
|
26
|
+
- Male: Abhilash, Karun, Hitesh
|
|
27
|
+
|
|
28
|
+
**Note:** Speaker selection must match the chosen model version.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
pitch: typing_extensions.NotRequired[float]
|
|
32
|
+
"""
|
|
33
|
+
Controls the pitch of the audio. Lower values result in a deeper voice,
|
|
34
|
+
while higher values make it sharper. The suitable range is between -0.75
|
|
35
|
+
and 0.75. Default is 0.0.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
pace: typing_extensions.NotRequired[float]
|
|
39
|
+
"""
|
|
40
|
+
Controls the speed of the audio. Lower values result in slower speech,
|
|
41
|
+
while higher values make it faster. The suitable range is between 0.5
|
|
42
|
+
and 2.0. Default is 1.0.
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
loudness: typing_extensions.NotRequired[float]
|
|
46
|
+
"""
|
|
47
|
+
Controls the loudness of the audio. Lower values result in quieter audio,
|
|
48
|
+
while higher values make it louder. The suitable range is between 0.3
|
|
49
|
+
and 3.0. Default is 1.0.
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
speech_sample_rate: typing_extensions.NotRequired[int]
|
|
53
|
+
"""
|
|
54
|
+
Specifies the sample rate of the output audio. Supported values are
|
|
55
|
+
8000, 16000, 22050, 24000 Hz. If not provided, the default is 22050 Hz.
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
enable_preprocessing: typing_extensions.NotRequired[bool]
|
|
59
|
+
"""
|
|
60
|
+
Controls whether normalization of English words and numeric entities
|
|
61
|
+
(e.g., numbers, dates) is performed. Set to true for better handling
|
|
62
|
+
of mixed-language text. Default is false.
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
output_audio_codec: typing_extensions.NotRequired[typing.Literal["mp3"]]
|
|
66
|
+
"""
|
|
67
|
+
Audio codec (currently supports MP3 only, optimized for real-time playback)
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
output_audio_bitrate: typing_extensions.NotRequired[InitializeConnectionDataOutputAudioBitrate]
|
|
71
|
+
"""
|
|
72
|
+
Audio bitrate (choose from 5 supported bitrate options)
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
min_buffer_size: typing_extensions.NotRequired[int]
|
|
76
|
+
"""
|
|
77
|
+
Minimum character length that triggers buffer flushing for TTS model processing
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
max_chunk_length: typing_extensions.NotRequired[int]
|
|
81
|
+
"""
|
|
82
|
+
Maximum length for sentence splitting (adjust based on content length)
|
|
83
|
+
"""
|
|
@@ -11,7 +11,6 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
|
11
11
|
from ..core.request_options import RequestOptions
|
|
12
12
|
from .raw_client import AsyncRawTextToSpeechStreamingClient, RawTextToSpeechStreamingClient
|
|
13
13
|
from .socket_client import AsyncTextToSpeechStreamingSocketClient, TextToSpeechStreamingSocketClient
|
|
14
|
-
from .types.text_to_speech_streaming_model import TextToSpeechStreamingModel
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
class TextToSpeechStreamingClient:
|
|
@@ -33,7 +32,7 @@ class TextToSpeechStreamingClient:
|
|
|
33
32
|
def connect(
|
|
34
33
|
self,
|
|
35
34
|
*,
|
|
36
|
-
model: typing.Optional[
|
|
35
|
+
model: typing.Optional[typing.Literal["bulbul:v2"]] = None,
|
|
37
36
|
api_subscription_key: typing.Optional[str] = None,
|
|
38
37
|
request_options: typing.Optional[RequestOptions] = None,
|
|
39
38
|
) -> typing.Iterator[TextToSpeechStreamingSocketClient]:
|
|
@@ -43,7 +42,7 @@ class TextToSpeechStreamingClient:
|
|
|
43
42
|
|
|
44
43
|
Parameters
|
|
45
44
|
----------
|
|
46
|
-
model : typing.Optional[
|
|
45
|
+
model : typing.Optional[typing.Literal["bulbul:v2"]]
|
|
47
46
|
Text to speech model to use
|
|
48
47
|
|
|
49
48
|
api_subscription_key : typing.Optional[str]
|
|
@@ -103,7 +102,7 @@ class AsyncTextToSpeechStreamingClient:
|
|
|
103
102
|
async def connect(
|
|
104
103
|
self,
|
|
105
104
|
*,
|
|
106
|
-
model: typing.Optional[
|
|
105
|
+
model: typing.Optional[typing.Literal["bulbul:v2"]] = None,
|
|
107
106
|
api_subscription_key: typing.Optional[str] = None,
|
|
108
107
|
request_options: typing.Optional[RequestOptions] = None,
|
|
109
108
|
) -> typing.AsyncIterator[AsyncTextToSpeechStreamingSocketClient]:
|
|
@@ -113,7 +112,7 @@ class AsyncTextToSpeechStreamingClient:
|
|
|
113
112
|
|
|
114
113
|
Parameters
|
|
115
114
|
----------
|
|
116
|
-
model : typing.Optional[
|
|
115
|
+
model : typing.Optional[typing.Literal["bulbul:v2"]]
|
|
117
116
|
Text to speech model to use
|
|
118
117
|
|
|
119
118
|
api_subscription_key : typing.Optional[str]
|
|
@@ -10,7 +10,6 @@ from ..core.api_error import ApiError
|
|
|
10
10
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
11
11
|
from ..core.request_options import RequestOptions
|
|
12
12
|
from .socket_client import AsyncTextToSpeechStreamingSocketClient, TextToSpeechStreamingSocketClient
|
|
13
|
-
from .types.text_to_speech_streaming_model import TextToSpeechStreamingModel
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
class RawTextToSpeechStreamingClient:
|
|
@@ -21,7 +20,7 @@ class RawTextToSpeechStreamingClient:
|
|
|
21
20
|
def connect(
|
|
22
21
|
self,
|
|
23
22
|
*,
|
|
24
|
-
model: typing.Optional[
|
|
23
|
+
model: typing.Optional[typing.Literal["bulbul:v2"]] = None,
|
|
25
24
|
api_subscription_key: typing.Optional[str] = None,
|
|
26
25
|
request_options: typing.Optional[RequestOptions] = None,
|
|
27
26
|
) -> typing.Iterator[TextToSpeechStreamingSocketClient]:
|
|
@@ -31,7 +30,7 @@ class RawTextToSpeechStreamingClient:
|
|
|
31
30
|
|
|
32
31
|
Parameters
|
|
33
32
|
----------
|
|
34
|
-
model : typing.Optional[
|
|
33
|
+
model : typing.Optional[typing.Literal["bulbul:v2"]]
|
|
35
34
|
Text to speech model to use
|
|
36
35
|
|
|
37
36
|
api_subscription_key : typing.Optional[str]
|
|
@@ -80,7 +79,7 @@ class AsyncRawTextToSpeechStreamingClient:
|
|
|
80
79
|
async def connect(
|
|
81
80
|
self,
|
|
82
81
|
*,
|
|
83
|
-
model: typing.Optional[
|
|
82
|
+
model: typing.Optional[typing.Literal["bulbul:v2"]] = None,
|
|
84
83
|
api_subscription_key: typing.Optional[str] = None,
|
|
85
84
|
request_options: typing.Optional[RequestOptions] = None,
|
|
86
85
|
) -> typing.AsyncIterator[AsyncTextToSpeechStreamingSocketClient]:
|
|
@@ -90,7 +89,7 @@ class AsyncRawTextToSpeechStreamingClient:
|
|
|
90
89
|
|
|
91
90
|
Parameters
|
|
92
91
|
----------
|
|
93
|
-
model : typing.Optional[
|
|
92
|
+
model : typing.Optional[typing.Literal["bulbul:v2"]]
|
|
94
93
|
Text to speech model to use
|
|
95
94
|
|
|
96
95
|
api_subscription_key : typing.Optional[str]
|
{sarvamai-0.1.8rc4 → sarvamai-0.1.8rc6}/src/sarvamai/text_to_speech_streaming/socket_client.py
RENAMED
|
@@ -8,7 +8,7 @@ import websockets.sync.connection as websockets_sync_connection
|
|
|
8
8
|
from ..core.events import EventEmitterMixin, EventType
|
|
9
9
|
from ..core.pydantic_utilities import parse_obj_as
|
|
10
10
|
from ..types.audio_output import AudioOutput
|
|
11
|
-
from ..types.
|
|
11
|
+
from ..types.flush_signal import FlushSignal
|
|
12
12
|
from ..types.error_response import ErrorResponse
|
|
13
13
|
from ..types.initialize_connection import InitializeConnection
|
|
14
14
|
from ..types.initialize_connection_data import InitializeConnectionData
|
|
@@ -58,16 +58,43 @@ class AsyncTextToSpeechStreamingSocketClient(EventEmitterMixin):
|
|
|
58
58
|
self,
|
|
59
59
|
target_language_code: str,
|
|
60
60
|
speaker: str,
|
|
61
|
+
pitch: float = 0.0,
|
|
62
|
+
pace: float = 1.0,
|
|
63
|
+
loudness: float = 1.0,
|
|
64
|
+
speech_sample_rate: int = 22050,
|
|
65
|
+
enable_preprocessing: bool = False,
|
|
66
|
+
output_audio_codec: str = "mp3",
|
|
67
|
+
output_audio_bitrate: str = "128k",
|
|
68
|
+
min_buffer_size: int = 50,
|
|
69
|
+
max_chunk_length: int = 150,
|
|
61
70
|
) -> None:
|
|
62
71
|
"""
|
|
63
72
|
Initialize the TTS connection with configuration parameters.
|
|
64
73
|
|
|
65
74
|
:param target_language_code: Target language code (e.g., 'hi-IN')
|
|
66
75
|
:param speaker: Voice speaker name (e.g., 'meera', 'arvind')
|
|
76
|
+
:param pitch: Voice pitch adjustment (-1.0 to 1.0, default: 0.0)
|
|
77
|
+
:param pace: Speech pace (0.3 to 3.0, default: 1.0)
|
|
78
|
+
:param loudness: Voice loudness (0.1 to 3.0, default: 1.0)
|
|
79
|
+
:param speech_sample_rate: Audio sample rate, default: 22050
|
|
80
|
+
:param enable_preprocessing: Enable text preprocessing, default: False
|
|
81
|
+
:param output_audio_codec: Audio codec, default: 'mp3'
|
|
82
|
+
:param output_audio_bitrate: Audio bitrate, default: '128k'
|
|
83
|
+
:param min_buffer_size: Minimum buffer size, default: 50
|
|
84
|
+
:param max_chunk_length: Maximum chunk length, default: 150
|
|
67
85
|
"""
|
|
68
86
|
data = InitializeConnectionData(
|
|
69
87
|
target_language_code=target_language_code,
|
|
70
88
|
speaker=speaker,
|
|
89
|
+
pitch=pitch,
|
|
90
|
+
pace=pace,
|
|
91
|
+
loudness=loudness,
|
|
92
|
+
speech_sample_rate=speech_sample_rate,
|
|
93
|
+
enable_preprocessing=enable_preprocessing,
|
|
94
|
+
output_audio_codec=output_audio_codec,
|
|
95
|
+
output_audio_bitrate=output_audio_bitrate,
|
|
96
|
+
min_buffer_size=min_buffer_size,
|
|
97
|
+
max_chunk_length=max_chunk_length,
|
|
71
98
|
)
|
|
72
99
|
message = InitializeConnection(data=data)
|
|
73
100
|
await self._send_model(message)
|
|
@@ -87,7 +114,7 @@ class AsyncTextToSpeechStreamingSocketClient(EventEmitterMixin):
|
|
|
87
114
|
Signal to flush the buffer and finalize audio output.
|
|
88
115
|
This indicates the end of text input.
|
|
89
116
|
"""
|
|
90
|
-
message =
|
|
117
|
+
message = FlushSignal()
|
|
91
118
|
await self._send_model(message)
|
|
92
119
|
|
|
93
120
|
async def ping(self) -> None:
|
|
@@ -159,16 +186,43 @@ class TextToSpeechStreamingSocketClient(EventEmitterMixin):
|
|
|
159
186
|
self,
|
|
160
187
|
target_language_code: str,
|
|
161
188
|
speaker: str,
|
|
189
|
+
pitch: float = 0.0,
|
|
190
|
+
pace: float = 1.0,
|
|
191
|
+
loudness: float = 1.0,
|
|
192
|
+
speech_sample_rate: int = 22050,
|
|
193
|
+
enable_preprocessing: bool = False,
|
|
194
|
+
output_audio_codec: str = "mp3",
|
|
195
|
+
output_audio_bitrate: str = "128k",
|
|
196
|
+
min_buffer_size: int = 50,
|
|
197
|
+
max_chunk_length: int = 150,
|
|
162
198
|
) -> None:
|
|
163
199
|
"""
|
|
164
200
|
Initialize the TTS connection with configuration parameters.
|
|
165
201
|
|
|
166
202
|
:param target_language_code: Target language code (e.g., 'hi-IN')
|
|
167
203
|
:param speaker: Voice speaker name (e.g., 'meera', 'arvind')
|
|
204
|
+
:param pitch: Voice pitch adjustment (-1.0 to 1.0, default: 0.0)
|
|
205
|
+
:param pace: Speech pace (0.3 to 3.0, default: 1.0)
|
|
206
|
+
:param loudness: Voice loudness (0.1 to 3.0, default: 1.0)
|
|
207
|
+
:param speech_sample_rate: Audio sample rate, default: 22050
|
|
208
|
+
:param enable_preprocessing: Enable text preprocessing, default: False
|
|
209
|
+
:param output_audio_codec: Audio codec, default: 'mp3'
|
|
210
|
+
:param output_audio_bitrate: Audio bitrate, default: '128k'
|
|
211
|
+
:param min_buffer_size: Minimum buffer size, default: 50
|
|
212
|
+
:param max_chunk_length: Maximum chunk length, default: 150
|
|
168
213
|
"""
|
|
169
214
|
data = InitializeConnectionData(
|
|
170
215
|
target_language_code=target_language_code,
|
|
171
216
|
speaker=speaker,
|
|
217
|
+
pitch=pitch,
|
|
218
|
+
pace=pace,
|
|
219
|
+
loudness=loudness,
|
|
220
|
+
speech_sample_rate=speech_sample_rate,
|
|
221
|
+
enable_preprocessing=enable_preprocessing,
|
|
222
|
+
output_audio_codec=output_audio_codec,
|
|
223
|
+
output_audio_bitrate=output_audio_bitrate,
|
|
224
|
+
min_buffer_size=min_buffer_size,
|
|
225
|
+
max_chunk_length=max_chunk_length,
|
|
172
226
|
)
|
|
173
227
|
message = InitializeConnection(data=data)
|
|
174
228
|
self._send_model(message)
|
|
@@ -188,7 +242,7 @@ class TextToSpeechStreamingSocketClient(EventEmitterMixin):
|
|
|
188
242
|
Signal to flush the buffer and finalize audio output.
|
|
189
243
|
This indicates the end of text input.
|
|
190
244
|
"""
|
|
191
|
-
message =
|
|
245
|
+
message = FlushSignal()
|
|
192
246
|
self._send_model(message)
|
|
193
247
|
|
|
194
248
|
def ping(self) -> None:
|
|
@@ -17,7 +17,6 @@ from .chat_completion_request_system_message import ChatCompletionRequestSystemM
|
|
|
17
17
|
from .chat_completion_request_user_message import ChatCompletionRequestUserMessage
|
|
18
18
|
from .chat_completion_response_message import ChatCompletionResponseMessage
|
|
19
19
|
from .choice import Choice
|
|
20
|
-
from .close_connection import CloseConnection
|
|
21
20
|
from .completion_usage import CompletionUsage
|
|
22
21
|
from .config_message import ConfigMessage
|
|
23
22
|
from .create_chat_completion_response import CreateChatCompletionResponse
|
|
@@ -31,6 +30,7 @@ from .error_response import ErrorResponse
|
|
|
31
30
|
from .error_response_data import ErrorResponseData
|
|
32
31
|
from .events_data import EventsData
|
|
33
32
|
from .finish_reason import FinishReason
|
|
33
|
+
from .flush_signal import FlushSignal
|
|
34
34
|
from .format import Format
|
|
35
35
|
from .initialize_connection import InitializeConnection
|
|
36
36
|
from .initialize_connection_data import InitializeConnectionData
|
|
@@ -92,7 +92,6 @@ __all__ = [
|
|
|
92
92
|
"ChatCompletionRequestUserMessage",
|
|
93
93
|
"ChatCompletionResponseMessage",
|
|
94
94
|
"Choice",
|
|
95
|
-
"CloseConnection",
|
|
96
95
|
"CompletionUsage",
|
|
97
96
|
"ConfigMessage",
|
|
98
97
|
"CreateChatCompletionResponse",
|
|
@@ -106,6 +105,7 @@ __all__ = [
|
|
|
106
105
|
"ErrorResponseData",
|
|
107
106
|
"EventsData",
|
|
108
107
|
"FinishReason",
|
|
108
|
+
"FlushSignal",
|
|
109
109
|
"Format",
|
|
110
110
|
"InitializeConnection",
|
|
111
111
|
"InitializeConnectionData",
|
|
@@ -6,7 +6,12 @@ import pydantic
|
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class
|
|
9
|
+
class FlushSignal(UniversalBaseModel):
|
|
10
|
+
"""
|
|
11
|
+
Forces the text buffer to process immediately, regardless of the min_buffer_size threshold.
|
|
12
|
+
Use this when you need to process remaining text that hasn't reached the minimum buffer size.
|
|
13
|
+
"""
|
|
14
|
+
|
|
10
15
|
type: typing.Literal["flush"] = "flush"
|
|
11
16
|
|
|
12
17
|
if IS_PYDANTIC_V2:
|
|
@@ -8,6 +8,13 @@ from .initialize_connection_data import InitializeConnectionData
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class InitializeConnection(UniversalBaseModel):
|
|
11
|
+
"""
|
|
12
|
+
Configuration message required as the first message after establishing the WebSocket connection.
|
|
13
|
+
This initializes TTS parameters and can be updated at any time during the WebSocket lifecycle
|
|
14
|
+
by sending a new config message. When a config update is sent, any text currently in the buffer
|
|
15
|
+
will be automatically flushed and processed before applying the new configuration.
|
|
16
|
+
"""
|
|
17
|
+
|
|
11
18
|
type: typing.Literal["config"] = "config"
|
|
12
19
|
data: InitializeConnectionData
|
|
13
20
|
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .initialize_connection_data_output_audio_bitrate import InitializeConnectionDataOutputAudioBitrate
|
|
8
|
+
from .initialize_connection_data_speaker import InitializeConnectionDataSpeaker
|
|
9
|
+
from .initialize_connection_data_target_language_code import InitializeConnectionDataTargetLanguageCode
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class InitializeConnectionData(UniversalBaseModel):
|
|
13
|
+
target_language_code: InitializeConnectionDataTargetLanguageCode = pydantic.Field()
|
|
14
|
+
"""
|
|
15
|
+
The language of the text is BCP-47 format
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
speaker: InitializeConnectionDataSpeaker = pydantic.Field()
|
|
19
|
+
"""
|
|
20
|
+
The speaker voice to be used for the output audio.
|
|
21
|
+
|
|
22
|
+
**Default:** Anushka
|
|
23
|
+
|
|
24
|
+
**Model Compatibility (Speakers compatible with respective model):**
|
|
25
|
+
- **bulbul:v2:**
|
|
26
|
+
- Female: Anushka, Manisha, Vidya, Arya
|
|
27
|
+
- Male: Abhilash, Karun, Hitesh
|
|
28
|
+
|
|
29
|
+
**Note:** Speaker selection must match the chosen model version.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
pitch: typing.Optional[float] = pydantic.Field(default=None)
|
|
33
|
+
"""
|
|
34
|
+
Controls the pitch of the audio. Lower values result in a deeper voice,
|
|
35
|
+
while higher values make it sharper. The suitable range is between -0.75
|
|
36
|
+
and 0.75. Default is 0.0.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
pace: typing.Optional[float] = pydantic.Field(default=None)
|
|
40
|
+
"""
|
|
41
|
+
Controls the speed of the audio. Lower values result in slower speech,
|
|
42
|
+
while higher values make it faster. The suitable range is between 0.5
|
|
43
|
+
and 2.0. Default is 1.0.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
loudness: typing.Optional[float] = pydantic.Field(default=None)
|
|
47
|
+
"""
|
|
48
|
+
Controls the loudness of the audio. Lower values result in quieter audio,
|
|
49
|
+
while higher values make it louder. The suitable range is between 0.3
|
|
50
|
+
and 3.0. Default is 1.0.
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
speech_sample_rate: typing.Optional[int] = pydantic.Field(default=None)
|
|
54
|
+
"""
|
|
55
|
+
Specifies the sample rate of the output audio. Supported values are
|
|
56
|
+
8000, 16000, 22050, 24000 Hz. If not provided, the default is 22050 Hz.
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
enable_preprocessing: typing.Optional[bool] = pydantic.Field(default=None)
|
|
60
|
+
"""
|
|
61
|
+
Controls whether normalization of English words and numeric entities
|
|
62
|
+
(e.g., numbers, dates) is performed. Set to true for better handling
|
|
63
|
+
of mixed-language text. Default is false.
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
output_audio_codec: typing.Optional[typing.Literal["mp3"]] = pydantic.Field(default=None)
|
|
67
|
+
"""
|
|
68
|
+
Audio codec (currently supports MP3 only, optimized for real-time playback)
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
output_audio_bitrate: typing.Optional[InitializeConnectionDataOutputAudioBitrate] = pydantic.Field(default=None)
|
|
72
|
+
"""
|
|
73
|
+
Audio bitrate (choose from 5 supported bitrate options)
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
min_buffer_size: typing.Optional[int] = pydantic.Field(default=None)
|
|
77
|
+
"""
|
|
78
|
+
Minimum character length that triggers buffer flushing for TTS model processing
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
max_chunk_length: typing.Optional[int] = pydantic.Field(default=None)
|
|
82
|
+
"""
|
|
83
|
+
Maximum length for sentence splitting (adjust based on content length)
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
if IS_PYDANTIC_V2:
|
|
87
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
88
|
+
else:
|
|
89
|
+
|
|
90
|
+
class Config:
|
|
91
|
+
frozen = True
|
|
92
|
+
smart_union = True
|
|
93
|
+
extra = pydantic.Extra.allow
|
|
@@ -7,6 +7,11 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class PingSignal(UniversalBaseModel):
|
|
10
|
+
"""
|
|
11
|
+
Send ping signal to keep the WebSocket connection alive. The connection automatically
|
|
12
|
+
closes after one minute of inactivity.
|
|
13
|
+
"""
|
|
14
|
+
|
|
10
15
|
type: typing.Literal["ping"] = "ping"
|
|
11
16
|
|
|
12
17
|
if IS_PYDANTIC_V2:
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
import typing
|
|
4
|
-
|
|
5
|
-
import typing_extensions
|
|
6
|
-
from .initialize_connection_data import InitializeConnectionDataParams
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class InitializeConnectionParams(typing_extensions.TypedDict):
|
|
10
|
-
type: typing.Literal["config"]
|
|
11
|
-
data: InitializeConnectionDataParams
|