sarvamai 0.1.20a2__tar.gz → 0.1.21__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.20a2 → sarvamai-0.1.21}/PKG-INFO +1 -1
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/pyproject.toml +1 -1
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/__init__.py +0 -4
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/core/client_wrapper.py +2 -2
- sarvamai-0.1.21/src/sarvamai/play.py +140 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/audio_output_data.py +5 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/error_response_data.py +5 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_streaming/__init__.py +0 -2
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_streaming/client.py +4 -5
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_streaming/raw_client.py +4 -5
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_streaming/types/__init__.py +0 -2
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_streaming/__init__.py +0 -2
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_streaming/client.py +4 -5
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_streaming/raw_client.py +4 -5
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_streaming/types/__init__.py +0 -2
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/audio_output_data.py +5 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/error_response_data.py +5 -0
- sarvamai-0.1.21/src/sarvamai/types/speech_to_text_model.py +5 -0
- sarvamai-0.1.21/src/sarvamai/types/speech_to_text_translate_model.py +5 -0
- sarvamai-0.1.20a2/src/sarvamai/play.py +0 -72
- sarvamai-0.1.20a2/src/sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_model.py +0 -5
- sarvamai-0.1.20a2/src/sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_model.py +0 -5
- sarvamai-0.1.20a2/src/sarvamai/types/speech_to_text_model.py +0 -7
- sarvamai-0.1.20a2/src/sarvamai/types/speech_to_text_translate_model.py +0 -7
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/README.md +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/chat/__init__.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/chat/client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/chat/raw_client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/core/__init__.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/core/api_error.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/core/datetime_utils.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/core/events.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/core/file.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/core/force_multipart.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/core/http_client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/core/http_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/core/jsonable_encoder.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/core/pydantic_utilities.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/core/query_encoder.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/core/remove_none_from_dict.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/core/request_options.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/core/serialization.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/environment.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/errors/__init__.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/errors/bad_request_error.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/errors/forbidden_error.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/errors/internal_server_error.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/errors/service_unavailable_error.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/errors/too_many_requests_error.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/errors/unprocessable_entity_error.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/py.typed +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/__init__.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/audio_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/audio_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/audio_output.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/base_job_parameters.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/bulk_job_callback.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/bulk_job_init_response_v_1.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/chat_completion_request_assistant_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/chat_completion_request_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/chat_completion_request_system_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/chat_completion_request_user_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/chat_completion_response_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/choice.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/completion_usage.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/config_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/configure_connection.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/configure_connection_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/create_chat_completion_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/diarized_entry.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/diarized_transcript.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/error_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/error_details.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/error_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/error_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/event_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/event_response_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/events_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/file_signed_url_details.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/files_download_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/files_request.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/files_upload_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/flush_signal.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/job_status_v_1_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/language_identification_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/ping_signal.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/send_text.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/send_text_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/speech_to_text_job_parameters.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/speech_to_text_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/speech_to_text_response_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/speech_to_text_streaming_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/speech_to_text_transcription_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/speech_to_text_translate_job_parameters.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/speech_to_text_translate_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/speech_to_text_translate_response_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/speech_to_text_translate_streaming_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/speech_to_text_translate_transcription_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/stop_configuration.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/stt_flush_signal.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/task_detail_v_1.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/task_file_details.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/text_to_speech_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/timestamps_model.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/transcription_metrics.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/translation_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/requests/transliteration_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text/__init__.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text/client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text/raw_client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_job/__init__.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_job/client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_job/job.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_job/raw_client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_streaming/socket_client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_flush_signal.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_high_vad_sensitivity.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_input_audio_codec.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_language_code.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_vad_signals.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_job/__init__.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_job/client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_job/job.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_job/raw_client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_streaming/socket_client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_flush_signal.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_high_vad_sensitivity.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_input_audio_codec.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_vad_signals.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/text/__init__.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/text/client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/text/raw_client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/text_to_speech/__init__.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/text_to_speech/client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/text_to_speech/raw_client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/text_to_speech_streaming/__init__.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/text_to_speech_streaming/client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/text_to_speech_streaming/raw_client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/text_to_speech_streaming/socket_client.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/text_to_speech_streaming/types/__init__.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/text_to_speech_streaming/types/text_to_speech_streaming_send_completion_event.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/__init__.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/audio_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/audio_data_input_audio_codec.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/audio_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/audio_output.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/base_job_parameters.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/bulk_job_callback.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/bulk_job_init_response_v_1.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/chat_completion_request_assistant_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/chat_completion_request_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/chat_completion_request_system_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/chat_completion_request_user_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/chat_completion_response_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/choice.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/completion_event_flag.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/completion_usage.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/config_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/configure_connection.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/configure_connection_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/configure_connection_data_output_audio_bitrate.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/configure_connection_data_output_audio_codec.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/configure_connection_data_speaker.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/configure_connection_data_target_language_code.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/connection_sample_rate.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/create_chat_completion_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/diarized_entry.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/diarized_transcript.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/error_code.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/error_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/error_details.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/error_message.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/error_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/event_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/event_response_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/events_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/events_data_signal_type.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/file_signed_url_details.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/files_download_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/files_request.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/files_upload_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/finish_reason.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/flush_signal.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/input_audio_codec.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/job_state.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/job_status_v_1_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/language_identification_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/numerals_format.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/ping_signal.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/reasoning_effort.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/response_type.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/role.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/sarvam_model_ids.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/send_text.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/send_text_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/speech_sample_rate.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/speech_to_text_job_parameters.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/speech_to_text_language.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/speech_to_text_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/speech_to_text_response_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/speech_to_text_streaming_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/speech_to_text_transcription_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/speech_to_text_translate_job_parameters.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/speech_to_text_translate_language.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/speech_to_text_translate_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/speech_to_text_translate_response_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/speech_to_text_translate_streaming_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/speech_to_text_translate_transcription_data.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/spoken_form_numerals_format.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/stop_configuration.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/storage_container_type.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/stt_flush_signal.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/task_detail_v_1.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/task_file_details.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/task_state.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/text_to_speech_language.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/text_to_speech_model.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/text_to_speech_output_audio_codec.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/text_to_speech_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/text_to_speech_speaker.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/timestamps_model.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/transcription_metrics.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/translate_mode.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/translate_model.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/translate_source_language.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/translate_speaker_gender.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/translate_target_language.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/translation_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/translatiterate_target_language.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/transliterate_mode.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/transliterate_source_language.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/types/transliteration_response.py +0 -0
- {sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/version.py +0 -0
|
@@ -189,14 +189,12 @@ from .speech_to_text_streaming import (
|
|
|
189
189
|
SpeechToTextStreamingHighVadSensitivity,
|
|
190
190
|
SpeechToTextStreamingInputAudioCodec,
|
|
191
191
|
SpeechToTextStreamingLanguageCode,
|
|
192
|
-
SpeechToTextStreamingModel,
|
|
193
192
|
SpeechToTextStreamingVadSignals,
|
|
194
193
|
)
|
|
195
194
|
from .speech_to_text_translate_streaming import (
|
|
196
195
|
SpeechToTextTranslateStreamingFlushSignal,
|
|
197
196
|
SpeechToTextTranslateStreamingHighVadSensitivity,
|
|
198
197
|
SpeechToTextTranslateStreamingInputAudioCodec,
|
|
199
|
-
SpeechToTextTranslateStreamingModel,
|
|
200
198
|
SpeechToTextTranslateStreamingVadSignals,
|
|
201
199
|
)
|
|
202
200
|
from .text_to_speech_streaming import TextToSpeechStreamingSendCompletionEvent
|
|
@@ -322,7 +320,6 @@ __all__ = [
|
|
|
322
320
|
"SpeechToTextStreamingHighVadSensitivity",
|
|
323
321
|
"SpeechToTextStreamingInputAudioCodec",
|
|
324
322
|
"SpeechToTextStreamingLanguageCode",
|
|
325
|
-
"SpeechToTextStreamingModel",
|
|
326
323
|
"SpeechToTextStreamingResponse",
|
|
327
324
|
"SpeechToTextStreamingResponseParams",
|
|
328
325
|
"SpeechToTextStreamingVadSignals",
|
|
@@ -339,7 +336,6 @@ __all__ = [
|
|
|
339
336
|
"SpeechToTextTranslateStreamingFlushSignal",
|
|
340
337
|
"SpeechToTextTranslateStreamingHighVadSensitivity",
|
|
341
338
|
"SpeechToTextTranslateStreamingInputAudioCodec",
|
|
342
|
-
"SpeechToTextTranslateStreamingModel",
|
|
343
339
|
"SpeechToTextTranslateStreamingResponse",
|
|
344
340
|
"SpeechToTextTranslateStreamingResponseParams",
|
|
345
341
|
"SpeechToTextTranslateStreamingVadSignals",
|
|
@@ -23,10 +23,10 @@ class BaseClientWrapper:
|
|
|
23
23
|
|
|
24
24
|
def get_headers(self) -> typing.Dict[str, str]:
|
|
25
25
|
headers: typing.Dict[str, str] = {
|
|
26
|
-
"User-Agent": "sarvamai/0.1.
|
|
26
|
+
"User-Agent": "sarvamai/0.1.21",
|
|
27
27
|
"X-Fern-Language": "Python",
|
|
28
28
|
"X-Fern-SDK-Name": "sarvamai",
|
|
29
|
-
"X-Fern-SDK-Version": "0.1.
|
|
29
|
+
"X-Fern-SDK-Version": "0.1.21",
|
|
30
30
|
**(self.get_custom_headers() or {}),
|
|
31
31
|
}
|
|
32
32
|
headers["api-subscription-key"] = self.api_subscription_key
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import base64
|
|
2
|
+
import shutil
|
|
3
|
+
import subprocess
|
|
4
|
+
import wave
|
|
5
|
+
from .types.text_to_speech_response import TextToSpeechResponse
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def is_installed(lib_name: str) -> bool:
|
|
9
|
+
lib = shutil.which(lib_name)
|
|
10
|
+
if lib is None:
|
|
11
|
+
return False
|
|
12
|
+
return True
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def play(
|
|
16
|
+
audio: TextToSpeechResponse, notebook: bool = False, use_ffmpeg: bool = True
|
|
17
|
+
) -> None:
|
|
18
|
+
# Iterate through all audio chunks and concatenate them properly
|
|
19
|
+
combined_audio_data = b""
|
|
20
|
+
|
|
21
|
+
for i, audio_chunk in enumerate(audio.audios):
|
|
22
|
+
# Decode each base64 chunk to get raw WAV data
|
|
23
|
+
chunk_data = base64.b64decode(audio_chunk)
|
|
24
|
+
|
|
25
|
+
if i == 0:
|
|
26
|
+
# For the first chunk, keep the entire WAV file
|
|
27
|
+
combined_audio_data = chunk_data
|
|
28
|
+
else:
|
|
29
|
+
# For subsequent chunks, find the data chunk and append only audio data
|
|
30
|
+
data_pos = chunk_data.find(b"data")
|
|
31
|
+
if data_pos != -1:
|
|
32
|
+
# Skip the 'data' header (8 bytes: 'data' + size)
|
|
33
|
+
audio_data_start = data_pos + 8
|
|
34
|
+
combined_audio_data += chunk_data[audio_data_start:]
|
|
35
|
+
|
|
36
|
+
# Update the WAV header with the correct total file size
|
|
37
|
+
if len(audio.audios) > 1:
|
|
38
|
+
# Update the RIFF chunk size (bytes 4-7)
|
|
39
|
+
total_size = len(combined_audio_data) - 8
|
|
40
|
+
combined_audio_data = (
|
|
41
|
+
combined_audio_data[:4]
|
|
42
|
+
+ total_size.to_bytes(4, "little")
|
|
43
|
+
+ combined_audio_data[8:]
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
# Update the data chunk size (find data chunk and update its size)
|
|
47
|
+
data_pos = combined_audio_data.find(b"data")
|
|
48
|
+
if data_pos != -1:
|
|
49
|
+
data_size = len(combined_audio_data) - data_pos - 8
|
|
50
|
+
combined_audio_data = (
|
|
51
|
+
combined_audio_data[: data_pos + 4]
|
|
52
|
+
+ data_size.to_bytes(4, "little")
|
|
53
|
+
+ combined_audio_data[data_pos + 8 :]
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
af_bytes = combined_audio_data
|
|
57
|
+
if notebook:
|
|
58
|
+
try:
|
|
59
|
+
from IPython.display import Audio, display # type: ignore
|
|
60
|
+
except ModuleNotFoundError:
|
|
61
|
+
message = "`pip install ipython` required when `notebook=False` "
|
|
62
|
+
raise ValueError(message)
|
|
63
|
+
|
|
64
|
+
display(Audio(af_bytes, rate=22050, autoplay=True))
|
|
65
|
+
elif use_ffmpeg:
|
|
66
|
+
if not is_installed("ffplay"):
|
|
67
|
+
message = (
|
|
68
|
+
"ffplay from ffmpeg not found, necessary to play audio. "
|
|
69
|
+
"On mac you can install it with 'brew install ffmpeg'. "
|
|
70
|
+
"On linux and windows you can install it from "
|
|
71
|
+
"https://ffmpeg.org/"
|
|
72
|
+
)
|
|
73
|
+
raise ValueError(message)
|
|
74
|
+
args = ["ffplay", "-autoexit", "-", "-nodisp"]
|
|
75
|
+
proc = subprocess.Popen(
|
|
76
|
+
args=args,
|
|
77
|
+
stdout=subprocess.PIPE,
|
|
78
|
+
stdin=subprocess.PIPE,
|
|
79
|
+
stderr=subprocess.PIPE,
|
|
80
|
+
)
|
|
81
|
+
out, err = proc.communicate(input=af_bytes)
|
|
82
|
+
proc.poll()
|
|
83
|
+
else:
|
|
84
|
+
try:
|
|
85
|
+
import io
|
|
86
|
+
|
|
87
|
+
import sounddevice as sd # type: ignore
|
|
88
|
+
import soundfile as sf # type: ignore
|
|
89
|
+
except ModuleNotFoundError:
|
|
90
|
+
message = (
|
|
91
|
+
"`pip install sounddevice soundfile` required when "
|
|
92
|
+
"`use_ffmpeg=False` "
|
|
93
|
+
)
|
|
94
|
+
raise ValueError(message)
|
|
95
|
+
sd.play(*sf.read(io.BytesIO(af_bytes)))
|
|
96
|
+
sd.wait()
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def save(audio: TextToSpeechResponse, filename: str) -> None:
|
|
100
|
+
if isinstance(audio.audios, list):
|
|
101
|
+
# Iterate through all audio chunks and concatenate them properly
|
|
102
|
+
combined_audio_data = b""
|
|
103
|
+
|
|
104
|
+
for i, audio_chunk in enumerate(audio.audios):
|
|
105
|
+
# Decode each base64 chunk to get raw WAV data
|
|
106
|
+
chunk_data = base64.b64decode(audio_chunk)
|
|
107
|
+
|
|
108
|
+
if i == 0:
|
|
109
|
+
# For the first chunk, keep the entire WAV file
|
|
110
|
+
combined_audio_data = chunk_data
|
|
111
|
+
else:
|
|
112
|
+
# For subsequent chunks, find the data chunk and append only audio data
|
|
113
|
+
data_pos = chunk_data.find(b"data")
|
|
114
|
+
if data_pos != -1:
|
|
115
|
+
# Skip the 'data' header (8 bytes: 'data' + size)
|
|
116
|
+
audio_data_start = data_pos + 8
|
|
117
|
+
combined_audio_data += chunk_data[audio_data_start:]
|
|
118
|
+
|
|
119
|
+
# Update the WAV header with the correct total file size
|
|
120
|
+
if len(audio.audios) > 1:
|
|
121
|
+
# Update the RIFF chunk size (bytes 4-7)
|
|
122
|
+
total_size = len(combined_audio_data) - 8
|
|
123
|
+
combined_audio_data = (
|
|
124
|
+
combined_audio_data[:4]
|
|
125
|
+
+ total_size.to_bytes(4, "little")
|
|
126
|
+
+ combined_audio_data[8:]
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
# Update the data chunk size (find data chunk and update its size)
|
|
130
|
+
data_pos = combined_audio_data.find(b"data")
|
|
131
|
+
if data_pos != -1:
|
|
132
|
+
data_size = len(combined_audio_data) - data_pos - 8
|
|
133
|
+
combined_audio_data = (
|
|
134
|
+
combined_audio_data[: data_pos + 4]
|
|
135
|
+
+ data_size.to_bytes(4, "little")
|
|
136
|
+
+ combined_audio_data[data_pos + 8 :]
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
with open(filename, "wb") as f:
|
|
140
|
+
f.write(combined_audio_data)
|
|
@@ -7,7 +7,6 @@ from .types import (
|
|
|
7
7
|
SpeechToTextStreamingHighVadSensitivity,
|
|
8
8
|
SpeechToTextStreamingInputAudioCodec,
|
|
9
9
|
SpeechToTextStreamingLanguageCode,
|
|
10
|
-
SpeechToTextStreamingModel,
|
|
11
10
|
SpeechToTextStreamingVadSignals,
|
|
12
11
|
)
|
|
13
12
|
|
|
@@ -16,6 +15,5 @@ __all__ = [
|
|
|
16
15
|
"SpeechToTextStreamingHighVadSensitivity",
|
|
17
16
|
"SpeechToTextStreamingInputAudioCodec",
|
|
18
17
|
"SpeechToTextStreamingLanguageCode",
|
|
19
|
-
"SpeechToTextStreamingModel",
|
|
20
18
|
"SpeechToTextStreamingVadSignals",
|
|
21
19
|
]
|
|
@@ -15,7 +15,6 @@ from .types.speech_to_text_streaming_flush_signal import SpeechToTextStreamingFl
|
|
|
15
15
|
from .types.speech_to_text_streaming_high_vad_sensitivity import SpeechToTextStreamingHighVadSensitivity
|
|
16
16
|
from .types.speech_to_text_streaming_input_audio_codec import SpeechToTextStreamingInputAudioCodec
|
|
17
17
|
from .types.speech_to_text_streaming_language_code import SpeechToTextStreamingLanguageCode
|
|
18
|
-
from .types.speech_to_text_streaming_model import SpeechToTextStreamingModel
|
|
19
18
|
from .types.speech_to_text_streaming_vad_signals import SpeechToTextStreamingVadSignals
|
|
20
19
|
|
|
21
20
|
try:
|
|
@@ -44,7 +43,7 @@ class SpeechToTextStreamingClient:
|
|
|
44
43
|
self,
|
|
45
44
|
*,
|
|
46
45
|
language_code: SpeechToTextStreamingLanguageCode,
|
|
47
|
-
model: typing.Optional[
|
|
46
|
+
model: typing.Optional[typing.Literal["saarika:v2.5"]] = None,
|
|
48
47
|
input_audio_codec: typing.Optional[SpeechToTextStreamingInputAudioCodec] = None,
|
|
49
48
|
sample_rate: typing.Optional[str] = None,
|
|
50
49
|
high_vad_sensitivity: typing.Optional[SpeechToTextStreamingHighVadSensitivity] = None,
|
|
@@ -61,7 +60,7 @@ class SpeechToTextStreamingClient:
|
|
|
61
60
|
language_code : SpeechToTextStreamingLanguageCode
|
|
62
61
|
Language code for speech recognition
|
|
63
62
|
|
|
64
|
-
model : typing.Optional[
|
|
63
|
+
model : typing.Optional[typing.Literal["saarika:v2.5"]]
|
|
65
64
|
Speech to text model to use
|
|
66
65
|
|
|
67
66
|
input_audio_codec : typing.Optional[SpeechToTextStreamingInputAudioCodec]
|
|
@@ -149,7 +148,7 @@ class AsyncSpeechToTextStreamingClient:
|
|
|
149
148
|
self,
|
|
150
149
|
*,
|
|
151
150
|
language_code: SpeechToTextStreamingLanguageCode,
|
|
152
|
-
model: typing.Optional[
|
|
151
|
+
model: typing.Optional[typing.Literal["saarika:v2.5"]] = None,
|
|
153
152
|
input_audio_codec: typing.Optional[SpeechToTextStreamingInputAudioCodec] = None,
|
|
154
153
|
sample_rate: typing.Optional[str] = None,
|
|
155
154
|
high_vad_sensitivity: typing.Optional[SpeechToTextStreamingHighVadSensitivity] = None,
|
|
@@ -166,7 +165,7 @@ class AsyncSpeechToTextStreamingClient:
|
|
|
166
165
|
language_code : SpeechToTextStreamingLanguageCode
|
|
167
166
|
Language code for speech recognition
|
|
168
167
|
|
|
169
|
-
model : typing.Optional[
|
|
168
|
+
model : typing.Optional[typing.Literal["saarika:v2.5"]]
|
|
170
169
|
Speech to text model to use
|
|
171
170
|
|
|
172
171
|
input_audio_codec : typing.Optional[SpeechToTextStreamingInputAudioCodec]
|
|
@@ -14,7 +14,6 @@ from .types.speech_to_text_streaming_flush_signal import SpeechToTextStreamingFl
|
|
|
14
14
|
from .types.speech_to_text_streaming_high_vad_sensitivity import SpeechToTextStreamingHighVadSensitivity
|
|
15
15
|
from .types.speech_to_text_streaming_input_audio_codec import SpeechToTextStreamingInputAudioCodec
|
|
16
16
|
from .types.speech_to_text_streaming_language_code import SpeechToTextStreamingLanguageCode
|
|
17
|
-
from .types.speech_to_text_streaming_model import SpeechToTextStreamingModel
|
|
18
17
|
from .types.speech_to_text_streaming_vad_signals import SpeechToTextStreamingVadSignals
|
|
19
18
|
|
|
20
19
|
try:
|
|
@@ -32,7 +31,7 @@ class RawSpeechToTextStreamingClient:
|
|
|
32
31
|
self,
|
|
33
32
|
*,
|
|
34
33
|
language_code: SpeechToTextStreamingLanguageCode,
|
|
35
|
-
model: typing.Optional[
|
|
34
|
+
model: typing.Optional[typing.Literal["saarika:v2.5"]] = None,
|
|
36
35
|
input_audio_codec: typing.Optional[SpeechToTextStreamingInputAudioCodec] = None,
|
|
37
36
|
sample_rate: typing.Optional[str] = None,
|
|
38
37
|
high_vad_sensitivity: typing.Optional[SpeechToTextStreamingHighVadSensitivity] = None,
|
|
@@ -49,7 +48,7 @@ class RawSpeechToTextStreamingClient:
|
|
|
49
48
|
language_code : SpeechToTextStreamingLanguageCode
|
|
50
49
|
Language code for speech recognition
|
|
51
50
|
|
|
52
|
-
model : typing.Optional[
|
|
51
|
+
model : typing.Optional[typing.Literal["saarika:v2.5"]]
|
|
53
52
|
Speech to text model to use
|
|
54
53
|
|
|
55
54
|
input_audio_codec : typing.Optional[SpeechToTextStreamingInputAudioCodec]
|
|
@@ -126,7 +125,7 @@ class AsyncRawSpeechToTextStreamingClient:
|
|
|
126
125
|
self,
|
|
127
126
|
*,
|
|
128
127
|
language_code: SpeechToTextStreamingLanguageCode,
|
|
129
|
-
model: typing.Optional[
|
|
128
|
+
model: typing.Optional[typing.Literal["saarika:v2.5"]] = None,
|
|
130
129
|
input_audio_codec: typing.Optional[SpeechToTextStreamingInputAudioCodec] = None,
|
|
131
130
|
sample_rate: typing.Optional[str] = None,
|
|
132
131
|
high_vad_sensitivity: typing.Optional[SpeechToTextStreamingHighVadSensitivity] = None,
|
|
@@ -143,7 +142,7 @@ class AsyncRawSpeechToTextStreamingClient:
|
|
|
143
142
|
language_code : SpeechToTextStreamingLanguageCode
|
|
144
143
|
Language code for speech recognition
|
|
145
144
|
|
|
146
|
-
model : typing.Optional[
|
|
145
|
+
model : typing.Optional[typing.Literal["saarika:v2.5"]]
|
|
147
146
|
Speech to text model to use
|
|
148
147
|
|
|
149
148
|
input_audio_codec : typing.Optional[SpeechToTextStreamingInputAudioCodec]
|
{sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_streaming/types/__init__.py
RENAMED
|
@@ -6,7 +6,6 @@ from .speech_to_text_streaming_flush_signal import SpeechToTextStreamingFlushSig
|
|
|
6
6
|
from .speech_to_text_streaming_high_vad_sensitivity import SpeechToTextStreamingHighVadSensitivity
|
|
7
7
|
from .speech_to_text_streaming_input_audio_codec import SpeechToTextStreamingInputAudioCodec
|
|
8
8
|
from .speech_to_text_streaming_language_code import SpeechToTextStreamingLanguageCode
|
|
9
|
-
from .speech_to_text_streaming_model import SpeechToTextStreamingModel
|
|
10
9
|
from .speech_to_text_streaming_vad_signals import SpeechToTextStreamingVadSignals
|
|
11
10
|
|
|
12
11
|
__all__ = [
|
|
@@ -14,6 +13,5 @@ __all__ = [
|
|
|
14
13
|
"SpeechToTextStreamingHighVadSensitivity",
|
|
15
14
|
"SpeechToTextStreamingInputAudioCodec",
|
|
16
15
|
"SpeechToTextStreamingLanguageCode",
|
|
17
|
-
"SpeechToTextStreamingModel",
|
|
18
16
|
"SpeechToTextStreamingVadSignals",
|
|
19
17
|
]
|
{sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_streaming/__init__.py
RENAMED
|
@@ -6,7 +6,6 @@ from .types import (
|
|
|
6
6
|
SpeechToTextTranslateStreamingFlushSignal,
|
|
7
7
|
SpeechToTextTranslateStreamingHighVadSensitivity,
|
|
8
8
|
SpeechToTextTranslateStreamingInputAudioCodec,
|
|
9
|
-
SpeechToTextTranslateStreamingModel,
|
|
10
9
|
SpeechToTextTranslateStreamingVadSignals,
|
|
11
10
|
)
|
|
12
11
|
|
|
@@ -14,6 +13,5 @@ __all__ = [
|
|
|
14
13
|
"SpeechToTextTranslateStreamingFlushSignal",
|
|
15
14
|
"SpeechToTextTranslateStreamingHighVadSensitivity",
|
|
16
15
|
"SpeechToTextTranslateStreamingInputAudioCodec",
|
|
17
|
-
"SpeechToTextTranslateStreamingModel",
|
|
18
16
|
"SpeechToTextTranslateStreamingVadSignals",
|
|
19
17
|
]
|
{sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_streaming/client.py
RENAMED
|
@@ -16,7 +16,6 @@ from .types.speech_to_text_translate_streaming_high_vad_sensitivity import (
|
|
|
16
16
|
SpeechToTextTranslateStreamingHighVadSensitivity,
|
|
17
17
|
)
|
|
18
18
|
from .types.speech_to_text_translate_streaming_input_audio_codec import SpeechToTextTranslateStreamingInputAudioCodec
|
|
19
|
-
from .types.speech_to_text_translate_streaming_model import SpeechToTextTranslateStreamingModel
|
|
20
19
|
from .types.speech_to_text_translate_streaming_vad_signals import SpeechToTextTranslateStreamingVadSignals
|
|
21
20
|
|
|
22
21
|
try:
|
|
@@ -44,7 +43,7 @@ class SpeechToTextTranslateStreamingClient:
|
|
|
44
43
|
def connect(
|
|
45
44
|
self,
|
|
46
45
|
*,
|
|
47
|
-
model: typing.Optional[
|
|
46
|
+
model: typing.Optional[typing.Literal["saaras:v2.5"]] = None,
|
|
48
47
|
input_audio_codec: typing.Optional[SpeechToTextTranslateStreamingInputAudioCodec] = None,
|
|
49
48
|
sample_rate: typing.Optional[str] = None,
|
|
50
49
|
high_vad_sensitivity: typing.Optional[SpeechToTextTranslateStreamingHighVadSensitivity] = None,
|
|
@@ -58,7 +57,7 @@ class SpeechToTextTranslateStreamingClient:
|
|
|
58
57
|
|
|
59
58
|
Parameters
|
|
60
59
|
----------
|
|
61
|
-
model : typing.Optional[
|
|
60
|
+
model : typing.Optional[typing.Literal["saaras:v2.5"]]
|
|
62
61
|
Speech to text model to use (defaults to "saaras:v2.5" if not specified)
|
|
63
62
|
|
|
64
63
|
input_audio_codec : typing.Optional[SpeechToTextTranslateStreamingInputAudioCodec]
|
|
@@ -143,7 +142,7 @@ class AsyncSpeechToTextTranslateStreamingClient:
|
|
|
143
142
|
async def connect(
|
|
144
143
|
self,
|
|
145
144
|
*,
|
|
146
|
-
model: typing.Optional[
|
|
145
|
+
model: typing.Optional[typing.Literal["saaras:v2.5"]] = None,
|
|
147
146
|
input_audio_codec: typing.Optional[SpeechToTextTranslateStreamingInputAudioCodec] = None,
|
|
148
147
|
sample_rate: typing.Optional[str] = None,
|
|
149
148
|
high_vad_sensitivity: typing.Optional[SpeechToTextTranslateStreamingHighVadSensitivity] = None,
|
|
@@ -157,7 +156,7 @@ class AsyncSpeechToTextTranslateStreamingClient:
|
|
|
157
156
|
|
|
158
157
|
Parameters
|
|
159
158
|
----------
|
|
160
|
-
model : typing.Optional[
|
|
159
|
+
model : typing.Optional[typing.Literal["saaras:v2.5"]]
|
|
161
160
|
Speech to text model to use (defaults to "saaras:v2.5" if not specified)
|
|
162
161
|
|
|
163
162
|
input_audio_codec : typing.Optional[SpeechToTextTranslateStreamingInputAudioCodec]
|
{sarvamai-0.1.20a2 → sarvamai-0.1.21}/src/sarvamai/speech_to_text_translate_streaming/raw_client.py
RENAMED
|
@@ -15,7 +15,6 @@ from .types.speech_to_text_translate_streaming_high_vad_sensitivity import (
|
|
|
15
15
|
SpeechToTextTranslateStreamingHighVadSensitivity,
|
|
16
16
|
)
|
|
17
17
|
from .types.speech_to_text_translate_streaming_input_audio_codec import SpeechToTextTranslateStreamingInputAudioCodec
|
|
18
|
-
from .types.speech_to_text_translate_streaming_model import SpeechToTextTranslateStreamingModel
|
|
19
18
|
from .types.speech_to_text_translate_streaming_vad_signals import SpeechToTextTranslateStreamingVadSignals
|
|
20
19
|
|
|
21
20
|
try:
|
|
@@ -32,7 +31,7 @@ class RawSpeechToTextTranslateStreamingClient:
|
|
|
32
31
|
def connect(
|
|
33
32
|
self,
|
|
34
33
|
*,
|
|
35
|
-
model: typing.Optional[
|
|
34
|
+
model: typing.Optional[typing.Literal["saaras:v2.5"]] = None,
|
|
36
35
|
input_audio_codec: typing.Optional[SpeechToTextTranslateStreamingInputAudioCodec] = None,
|
|
37
36
|
sample_rate: typing.Optional[str] = None,
|
|
38
37
|
high_vad_sensitivity: typing.Optional[SpeechToTextTranslateStreamingHighVadSensitivity] = None,
|
|
@@ -46,7 +45,7 @@ class RawSpeechToTextTranslateStreamingClient:
|
|
|
46
45
|
|
|
47
46
|
Parameters
|
|
48
47
|
----------
|
|
49
|
-
model : typing.Optional[
|
|
48
|
+
model : typing.Optional[typing.Literal["saaras:v2.5"]]
|
|
50
49
|
Speech to text model to use (defaults to "saaras:v2.5" if not specified)
|
|
51
50
|
|
|
52
51
|
input_audio_codec : typing.Optional[SpeechToTextTranslateStreamingInputAudioCodec]
|
|
@@ -120,7 +119,7 @@ class AsyncRawSpeechToTextTranslateStreamingClient:
|
|
|
120
119
|
async def connect(
|
|
121
120
|
self,
|
|
122
121
|
*,
|
|
123
|
-
model: typing.Optional[
|
|
122
|
+
model: typing.Optional[typing.Literal["saaras:v2.5"]] = None,
|
|
124
123
|
input_audio_codec: typing.Optional[SpeechToTextTranslateStreamingInputAudioCodec] = None,
|
|
125
124
|
sample_rate: typing.Optional[str] = None,
|
|
126
125
|
high_vad_sensitivity: typing.Optional[SpeechToTextTranslateStreamingHighVadSensitivity] = None,
|
|
@@ -134,7 +133,7 @@ class AsyncRawSpeechToTextTranslateStreamingClient:
|
|
|
134
133
|
|
|
135
134
|
Parameters
|
|
136
135
|
----------
|
|
137
|
-
model : typing.Optional[
|
|
136
|
+
model : typing.Optional[typing.Literal["saaras:v2.5"]]
|
|
138
137
|
Speech to text model to use (defaults to "saaras:v2.5" if not specified)
|
|
139
138
|
|
|
140
139
|
input_audio_codec : typing.Optional[SpeechToTextTranslateStreamingInputAudioCodec]
|
|
@@ -5,13 +5,11 @@
|
|
|
5
5
|
from .speech_to_text_translate_streaming_flush_signal import SpeechToTextTranslateStreamingFlushSignal
|
|
6
6
|
from .speech_to_text_translate_streaming_high_vad_sensitivity import SpeechToTextTranslateStreamingHighVadSensitivity
|
|
7
7
|
from .speech_to_text_translate_streaming_input_audio_codec import SpeechToTextTranslateStreamingInputAudioCodec
|
|
8
|
-
from .speech_to_text_translate_streaming_model import SpeechToTextTranslateStreamingModel
|
|
9
8
|
from .speech_to_text_translate_streaming_vad_signals import SpeechToTextTranslateStreamingVadSignals
|
|
10
9
|
|
|
11
10
|
__all__ = [
|
|
12
11
|
"SpeechToTextTranslateStreamingFlushSignal",
|
|
13
12
|
"SpeechToTextTranslateStreamingHighVadSensitivity",
|
|
14
13
|
"SpeechToTextTranslateStreamingInputAudioCodec",
|
|
15
|
-
"SpeechToTextTranslateStreamingModel",
|
|
16
14
|
"SpeechToTextTranslateStreamingVadSignals",
|
|
17
15
|
]
|
|
@@ -17,6 +17,11 @@ class AudioOutputData(UniversalBaseModel):
|
|
|
17
17
|
Base64-encoded audio data ready for playback or download
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
|
+
request_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
21
|
+
"""
|
|
22
|
+
Unique identifier for the request
|
|
23
|
+
"""
|
|
24
|
+
|
|
20
25
|
if IS_PYDANTIC_V2:
|
|
21
26
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
22
27
|
else:
|
|
@@ -18,6 +18,11 @@ class ErrorResponseData(UniversalBaseModel):
|
|
|
18
18
|
Additional error details and context information
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
|
+
request_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
22
|
+
"""
|
|
23
|
+
Unique identifier for the request
|
|
24
|
+
"""
|
|
25
|
+
|
|
21
26
|
if IS_PYDANTIC_V2:
|
|
22
27
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
23
28
|
else:
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import base64
|
|
2
|
-
import shutil
|
|
3
|
-
import subprocess
|
|
4
|
-
import wave
|
|
5
|
-
from .types.text_to_speech_response import TextToSpeechResponse
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def is_installed(lib_name: str) -> bool:
|
|
9
|
-
lib = shutil.which(lib_name)
|
|
10
|
-
if lib is None:
|
|
11
|
-
return False
|
|
12
|
-
return True
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def play(
|
|
16
|
-
audio: TextToSpeechResponse,
|
|
17
|
-
notebook: bool = False,
|
|
18
|
-
use_ffmpeg: bool = True
|
|
19
|
-
) -> None:
|
|
20
|
-
af_str = "".join(audio.audios)
|
|
21
|
-
af_bytes = base64.b64decode(af_str)
|
|
22
|
-
if notebook:
|
|
23
|
-
try:
|
|
24
|
-
from IPython.display import Audio, display # type: ignore
|
|
25
|
-
except ModuleNotFoundError:
|
|
26
|
-
message = (
|
|
27
|
-
"`pip install ipython` required when `notebook=False` "
|
|
28
|
-
)
|
|
29
|
-
raise ValueError(message)
|
|
30
|
-
|
|
31
|
-
display(Audio(af_bytes, rate=22050, autoplay=True))
|
|
32
|
-
elif use_ffmpeg:
|
|
33
|
-
if not is_installed("ffplay"):
|
|
34
|
-
message = (
|
|
35
|
-
"ffplay from ffmpeg not found, necessary to play audio. "
|
|
36
|
-
"On mac you can install it with 'brew install ffmpeg'. "
|
|
37
|
-
"On linux and windows you can install it from "
|
|
38
|
-
"https://ffmpeg.org/"
|
|
39
|
-
)
|
|
40
|
-
raise ValueError(message)
|
|
41
|
-
args = ["ffplay", "-autoexit", "-", "-nodisp"]
|
|
42
|
-
proc = subprocess.Popen(
|
|
43
|
-
args=args,
|
|
44
|
-
stdout=subprocess.PIPE,
|
|
45
|
-
stdin=subprocess.PIPE,
|
|
46
|
-
stderr=subprocess.PIPE,
|
|
47
|
-
)
|
|
48
|
-
out, err = proc.communicate(input=af_bytes)
|
|
49
|
-
proc.poll()
|
|
50
|
-
else:
|
|
51
|
-
try:
|
|
52
|
-
import io
|
|
53
|
-
|
|
54
|
-
import sounddevice as sd # type: ignore
|
|
55
|
-
import soundfile as sf # type: ignore
|
|
56
|
-
except ModuleNotFoundError:
|
|
57
|
-
message = (
|
|
58
|
-
"`pip install sounddevice soundfile` required when "
|
|
59
|
-
"`use_ffmpeg=False` "
|
|
60
|
-
)
|
|
61
|
-
raise ValueError(message)
|
|
62
|
-
sd.play(*sf.read(io.BytesIO(af_bytes)))
|
|
63
|
-
sd.wait()
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
def save(audio: TextToSpeechResponse, filename: str) -> None:
|
|
67
|
-
if isinstance(audio.audios, list):
|
|
68
|
-
combined_audio = "".join(audio.audios)
|
|
69
|
-
b64_file = base64.b64decode(combined_audio)
|
|
70
|
-
|
|
71
|
-
with open(filename, "wb") as f:
|
|
72
|
-
f.write(b64_file)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|