sarvamai 0.1.8rc5__tar.gz → 0.1.8rc7__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.
Files changed (187) hide show
  1. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/PKG-INFO +1 -1
  2. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/pyproject.toml +1 -1
  3. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/__init__.py +14 -16
  4. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/core/client_wrapper.py +2 -2
  5. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/__init__.py +4 -4
  6. sarvamai-0.1.8rc7/src/sarvamai/requests/configure_connection.py +18 -0
  7. sarvamai-0.1.8rc7/src/sarvamai/requests/configure_connection_data.py +83 -0
  8. sarvamai-0.1.8rc7/src/sarvamai/requests/flush_signal.py +14 -0
  9. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/ping_signal.py +5 -0
  10. sarvamai-0.1.8rc7/src/sarvamai/text_to_speech_streaming/__init__.py +4 -0
  11. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/text_to_speech_streaming/client.py +4 -5
  12. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/text_to_speech_streaming/raw_client.py +4 -5
  13. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/text_to_speech_streaming/socket_client.py +80 -46
  14. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/__init__.py +10 -10
  15. sarvamai-0.1.8rc7/src/sarvamai/types/configure_connection.py +28 -0
  16. sarvamai-0.1.8rc7/src/sarvamai/types/configure_connection_data.py +93 -0
  17. sarvamai-0.1.8rc5/src/sarvamai/types/initialize_connection_data_output_audio_bitrate.py → sarvamai-0.1.8rc7/src/sarvamai/types/configure_connection_data_output_audio_bitrate.py +1 -1
  18. sarvamai-0.1.8rc7/src/sarvamai/types/configure_connection_data_speaker.py +7 -0
  19. sarvamai-0.1.8rc5/src/sarvamai/types/initialize_connection_data_target_language_code.py → sarvamai-0.1.8rc7/src/sarvamai/types/configure_connection_data_target_language_code.py +1 -1
  20. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/flush_signal.py +5 -0
  21. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/ping_signal.py +5 -0
  22. sarvamai-0.1.8rc5/src/sarvamai/requests/flush_signal.py +0 -9
  23. sarvamai-0.1.8rc5/src/sarvamai/requests/initialize_connection.py +0 -11
  24. sarvamai-0.1.8rc5/src/sarvamai/requests/initialize_connection_data.py +0 -22
  25. sarvamai-0.1.8rc5/src/sarvamai/text_to_speech_streaming/__init__.py +0 -7
  26. sarvamai-0.1.8rc5/src/sarvamai/text_to_speech_streaming/types/__init__.py +0 -7
  27. sarvamai-0.1.8rc5/src/sarvamai/text_to_speech_streaming/types/text_to_speech_streaming_model.py +0 -5
  28. sarvamai-0.1.8rc5/src/sarvamai/types/initialize_connection.py +0 -21
  29. sarvamai-0.1.8rc5/src/sarvamai/types/initialize_connection_data.py +0 -32
  30. sarvamai-0.1.8rc5/src/sarvamai/types/initialize_connection_data_speaker.py +0 -28
  31. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/README.md +0 -0
  32. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/chat/__init__.py +0 -0
  33. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/chat/client.py +0 -0
  34. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/chat/raw_client.py +0 -0
  35. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/client.py +0 -0
  36. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/core/__init__.py +0 -0
  37. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/core/api_error.py +0 -0
  38. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/core/datetime_utils.py +0 -0
  39. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/core/events.py +0 -0
  40. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/core/file.py +0 -0
  41. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/core/force_multipart.py +0 -0
  42. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/core/http_client.py +0 -0
  43. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/core/http_response.py +0 -0
  44. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/core/jsonable_encoder.py +0 -0
  45. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/core/pydantic_utilities.py +0 -0
  46. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/core/query_encoder.py +0 -0
  47. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/core/remove_none_from_dict.py +0 -0
  48. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/core/request_options.py +0 -0
  49. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/core/serialization.py +0 -0
  50. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/environment.py +0 -0
  51. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/errors/__init__.py +0 -0
  52. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/errors/bad_request_error.py +0 -0
  53. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/errors/forbidden_error.py +0 -0
  54. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/errors/internal_server_error.py +0 -0
  55. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/errors/service_unavailable_error.py +0 -0
  56. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/errors/too_many_requests_error.py +0 -0
  57. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/errors/unprocessable_entity_error.py +0 -0
  58. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/play.py +0 -0
  59. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/py.typed +0 -0
  60. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/audio_data.py +0 -0
  61. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/audio_message.py +0 -0
  62. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/audio_output.py +0 -0
  63. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/audio_output_data.py +0 -0
  64. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/chat_completion_request_assistant_message.py +0 -0
  65. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/chat_completion_request_message.py +0 -0
  66. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/chat_completion_request_system_message.py +0 -0
  67. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/chat_completion_request_user_message.py +0 -0
  68. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/chat_completion_response_message.py +0 -0
  69. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/choice.py +0 -0
  70. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/completion_usage.py +0 -0
  71. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/config_message.py +0 -0
  72. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/create_chat_completion_response.py +0 -0
  73. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/diarized_entry.py +0 -0
  74. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/diarized_transcript.py +0 -0
  75. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/error_data.py +0 -0
  76. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/error_details.py +0 -0
  77. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/error_message.py +0 -0
  78. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/error_response.py +0 -0
  79. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/error_response_data.py +0 -0
  80. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/events_data.py +0 -0
  81. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/language_identification_response.py +0 -0
  82. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/send_text.py +0 -0
  83. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/send_text_data.py +0 -0
  84. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/speech_to_text_response.py +0 -0
  85. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/speech_to_text_response_data.py +0 -0
  86. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/speech_to_text_streaming_response.py +0 -0
  87. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/speech_to_text_transcription_data.py +0 -0
  88. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/speech_to_text_translate_response.py +0 -0
  89. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/speech_to_text_translate_response_data.py +0 -0
  90. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/speech_to_text_translate_streaming_response.py +0 -0
  91. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/speech_to_text_translate_transcription_data.py +0 -0
  92. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/stop_configuration.py +0 -0
  93. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/text_to_speech_response.py +0 -0
  94. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/timestamps_model.py +0 -0
  95. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/transcription_metrics.py +0 -0
  96. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/translation_response.py +0 -0
  97. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/requests/transliteration_response.py +0 -0
  98. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text/__init__.py +0 -0
  99. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text/client.py +0 -0
  100. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text/raw_client.py +0 -0
  101. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_streaming/__init__.py +0 -0
  102. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_streaming/client.py +0 -0
  103. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_streaming/raw_client.py +0 -0
  104. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_streaming/socket_client.py +0 -0
  105. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_streaming/types/__init__.py +0 -0
  106. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_high_vad_sensitivity.py +0 -0
  107. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_language_code.py +0 -0
  108. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_model.py +0 -0
  109. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_vad_signals.py +0 -0
  110. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_translate_streaming/__init__.py +0 -0
  111. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_translate_streaming/client.py +0 -0
  112. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_translate_streaming/raw_client.py +0 -0
  113. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_translate_streaming/socket_client.py +0 -0
  114. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_translate_streaming/types/__init__.py +0 -0
  115. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_high_vad_sensitivity.py +0 -0
  116. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_model.py +0 -0
  117. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_vad_signals.py +0 -0
  118. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/text/__init__.py +0 -0
  119. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/text/client.py +0 -0
  120. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/text/raw_client.py +0 -0
  121. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/text_to_speech/__init__.py +0 -0
  122. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/text_to_speech/client.py +0 -0
  123. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/text_to_speech/raw_client.py +0 -0
  124. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/audio_data.py +0 -0
  125. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/audio_message.py +0 -0
  126. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/audio_output.py +0 -0
  127. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/audio_output_data.py +0 -0
  128. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/chat_completion_request_assistant_message.py +0 -0
  129. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/chat_completion_request_message.py +0 -0
  130. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/chat_completion_request_system_message.py +0 -0
  131. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/chat_completion_request_user_message.py +0 -0
  132. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/chat_completion_response_message.py +0 -0
  133. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/choice.py +0 -0
  134. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/completion_usage.py +0 -0
  135. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/config_message.py +0 -0
  136. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/create_chat_completion_response.py +0 -0
  137. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/diarized_entry.py +0 -0
  138. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/diarized_transcript.py +0 -0
  139. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/error_code.py +0 -0
  140. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/error_data.py +0 -0
  141. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/error_details.py +0 -0
  142. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/error_message.py +0 -0
  143. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/error_response.py +0 -0
  144. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/error_response_data.py +0 -0
  145. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/events_data.py +0 -0
  146. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/finish_reason.py +0 -0
  147. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/format.py +0 -0
  148. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/language_identification_response.py +0 -0
  149. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/numerals_format.py +0 -0
  150. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/reasoning_effort.py +0 -0
  151. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/response_type.py +0 -0
  152. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/role.py +0 -0
  153. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/sarvam_model_ids.py +0 -0
  154. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/send_text.py +0 -0
  155. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/send_text_data.py +0 -0
  156. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/speech_sample_rate.py +0 -0
  157. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/speech_to_text_language.py +0 -0
  158. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/speech_to_text_model.py +0 -0
  159. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/speech_to_text_response.py +0 -0
  160. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/speech_to_text_response_data.py +0 -0
  161. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/speech_to_text_streaming_response.py +0 -0
  162. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/speech_to_text_transcription_data.py +0 -0
  163. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/speech_to_text_translate_language.py +0 -0
  164. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/speech_to_text_translate_model.py +0 -0
  165. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/speech_to_text_translate_response.py +0 -0
  166. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/speech_to_text_translate_response_data.py +0 -0
  167. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/speech_to_text_translate_streaming_response.py +0 -0
  168. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/speech_to_text_translate_transcription_data.py +0 -0
  169. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/spoken_form_numerals_format.py +0 -0
  170. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/stop_configuration.py +0 -0
  171. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/text_to_speech_language.py +0 -0
  172. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/text_to_speech_model.py +0 -0
  173. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/text_to_speech_response.py +0 -0
  174. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/text_to_speech_speaker.py +0 -0
  175. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/timestamps_model.py +0 -0
  176. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/transcription_metrics.py +0 -0
  177. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/translate_mode.py +0 -0
  178. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/translate_model.py +0 -0
  179. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/translate_source_language.py +0 -0
  180. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/translate_speaker_gender.py +0 -0
  181. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/translate_target_language.py +0 -0
  182. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/translation_response.py +0 -0
  183. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/translatiterate_target_language.py +0 -0
  184. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/transliterate_mode.py +0 -0
  185. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/transliterate_source_language.py +0 -0
  186. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/types/transliteration_response.py +0 -0
  187. {sarvamai-0.1.8rc5 → sarvamai-0.1.8rc7}/src/sarvamai/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sarvamai
3
- Version: 0.1.8rc5
3
+ Version: 0.1.8rc7
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -3,7 +3,7 @@ name = "sarvamai"
3
3
 
4
4
  [tool.poetry]
5
5
  name = "sarvamai"
6
- version = "0.1.8rc5"
6
+ version = "0.1.8rc7"
7
7
  description = ""
8
8
  readme = "README.md"
9
9
  authors = []
@@ -18,6 +18,11 @@ from .types import (
18
18
  Choice,
19
19
  CompletionUsage,
20
20
  ConfigMessage,
21
+ ConfigureConnection,
22
+ ConfigureConnectionData,
23
+ ConfigureConnectionDataOutputAudioBitrate,
24
+ ConfigureConnectionDataSpeaker,
25
+ ConfigureConnectionDataTargetLanguageCode,
21
26
  CreateChatCompletionResponse,
22
27
  DiarizedEntry,
23
28
  DiarizedTranscript,
@@ -31,11 +36,6 @@ from .types import (
31
36
  FinishReason,
32
37
  FlushSignal,
33
38
  Format,
34
- InitializeConnection,
35
- InitializeConnectionData,
36
- InitializeConnectionDataOutputAudioBitrate,
37
- InitializeConnectionDataSpeaker,
38
- InitializeConnectionDataTargetLanguageCode,
39
39
  LanguageIdentificationResponse,
40
40
  NumeralsFormat,
41
41
  PingSignal,
@@ -112,6 +112,8 @@ from .requests import (
112
112
  ChoiceParams,
113
113
  CompletionUsageParams,
114
114
  ConfigMessageParams,
115
+ ConfigureConnectionDataParams,
116
+ ConfigureConnectionParams,
115
117
  CreateChatCompletionResponseParams,
116
118
  DiarizedEntryParams,
117
119
  DiarizedTranscriptParams,
@@ -122,8 +124,6 @@ from .requests import (
122
124
  ErrorResponseParams,
123
125
  EventsDataParams,
124
126
  FlushSignalParams,
125
- InitializeConnectionDataParams,
126
- InitializeConnectionParams,
127
127
  LanguageIdentificationResponseParams,
128
128
  PingSignalParams,
129
129
  SendTextDataParams,
@@ -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__ = [
@@ -190,6 +189,13 @@ __all__ = [
190
189
  "CompletionUsageParams",
191
190
  "ConfigMessage",
192
191
  "ConfigMessageParams",
192
+ "ConfigureConnection",
193
+ "ConfigureConnectionData",
194
+ "ConfigureConnectionDataOutputAudioBitrate",
195
+ "ConfigureConnectionDataParams",
196
+ "ConfigureConnectionDataSpeaker",
197
+ "ConfigureConnectionDataTargetLanguageCode",
198
+ "ConfigureConnectionParams",
193
199
  "CreateChatCompletionResponse",
194
200
  "CreateChatCompletionResponseParams",
195
201
  "DiarizedEntry",
@@ -214,13 +220,6 @@ __all__ = [
214
220
  "FlushSignalParams",
215
221
  "ForbiddenError",
216
222
  "Format",
217
- "InitializeConnection",
218
- "InitializeConnectionData",
219
- "InitializeConnectionDataOutputAudioBitrate",
220
- "InitializeConnectionDataParams",
221
- "InitializeConnectionDataSpeaker",
222
- "InitializeConnectionDataTargetLanguageCode",
223
- "InitializeConnectionParams",
224
223
  "InternalServerError",
225
224
  "LanguageIdentificationResponse",
226
225
  "LanguageIdentificationResponseParams",
@@ -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.8rc5",
20
+ "User-Agent": "sarvamai/0.1.8rc7",
21
21
  "X-Fern-Language": "Python",
22
22
  "X-Fern-SDK-Name": "sarvamai",
23
- "X-Fern-SDK-Version": "0.1.8rc5",
23
+ "X-Fern-SDK-Version": "0.1.8rc7",
24
24
  }
25
25
  headers["api-subscription-key"] = self.api_subscription_key
26
26
  return headers
@@ -19,6 +19,8 @@ from .chat_completion_response_message import ChatCompletionResponseMessageParam
19
19
  from .choice import ChoiceParams
20
20
  from .completion_usage import CompletionUsageParams
21
21
  from .config_message import ConfigMessageParams
22
+ from .configure_connection import ConfigureConnectionParams
23
+ from .configure_connection_data import ConfigureConnectionDataParams
22
24
  from .create_chat_completion_response import CreateChatCompletionResponseParams
23
25
  from .diarized_entry import DiarizedEntryParams
24
26
  from .diarized_transcript import DiarizedTranscriptParams
@@ -29,8 +31,6 @@ from .error_response import ErrorResponseParams
29
31
  from .error_response_data import ErrorResponseDataParams
30
32
  from .events_data import EventsDataParams
31
33
  from .flush_signal import FlushSignalParams
32
- from .initialize_connection import InitializeConnectionParams
33
- from .initialize_connection_data import InitializeConnectionDataParams
34
34
  from .language_identification_response import LanguageIdentificationResponseParams
35
35
  from .ping_signal import PingSignalParams
36
36
  from .send_text import SendTextParams
@@ -66,6 +66,8 @@ __all__ = [
66
66
  "ChoiceParams",
67
67
  "CompletionUsageParams",
68
68
  "ConfigMessageParams",
69
+ "ConfigureConnectionDataParams",
70
+ "ConfigureConnectionParams",
69
71
  "CreateChatCompletionResponseParams",
70
72
  "DiarizedEntryParams",
71
73
  "DiarizedTranscriptParams",
@@ -76,8 +78,6 @@ __all__ = [
76
78
  "ErrorResponseParams",
77
79
  "EventsDataParams",
78
80
  "FlushSignalParams",
79
- "InitializeConnectionDataParams",
80
- "InitializeConnectionParams",
81
81
  "LanguageIdentificationResponseParams",
82
82
  "PingSignalParams",
83
83
  "SendTextDataParams",
@@ -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 .configure_connection_data import ConfigureConnectionDataParams
7
+
8
+
9
+ class ConfigureConnectionParams(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: ConfigureConnectionDataParams
@@ -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.configure_connection_data_output_audio_bitrate import ConfigureConnectionDataOutputAudioBitrate
7
+ from ..types.configure_connection_data_speaker import ConfigureConnectionDataSpeaker
8
+ from ..types.configure_connection_data_target_language_code import ConfigureConnectionDataTargetLanguageCode
9
+
10
+
11
+ class ConfigureConnectionDataParams(typing_extensions.TypedDict):
12
+ target_language_code: ConfigureConnectionDataTargetLanguageCode
13
+ """
14
+ The language of the text is BCP-47 format
15
+ """
16
+
17
+ speaker: ConfigureConnectionDataSpeaker
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[ConfigureConnectionDataOutputAudioBitrate]
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
+ """
@@ -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"]
@@ -6,4 +6,9 @@ import typing_extensions
6
6
 
7
7
 
8
8
  class PingSignalParams(typing_extensions.TypedDict):
9
+ """
10
+ Send ping signal to keep the WebSocket connection alive. The connection automatically
11
+ closes after one minute of inactivity.
12
+ """
13
+
9
14
  type: typing.Literal["ping"]
@@ -0,0 +1,4 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
@@ -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[TextToSpeechStreamingModel] = None,
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[TextToSpeechStreamingModel]
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[TextToSpeechStreamingModel] = None,
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[TextToSpeechStreamingModel]
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[TextToSpeechStreamingModel] = None,
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[TextToSpeechStreamingModel]
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[TextToSpeechStreamingModel] = None,
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[TextToSpeechStreamingModel]
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]
@@ -10,8 +10,8 @@ from ..core.pydantic_utilities import parse_obj_as
10
10
  from ..types.audio_output import AudioOutput
11
11
  from ..types.flush_signal import FlushSignal
12
12
  from ..types.error_response import ErrorResponse
13
- from ..types.initialize_connection import InitializeConnection
14
- from ..types.initialize_connection_data import InitializeConnectionData
13
+ from ..types.configure_connection import ConfigureConnection
14
+ from ..types.configure_connection_data import ConfigureConnectionData
15
15
  from ..types.ping_signal import PingSignal
16
16
  from ..types.send_text import SendText
17
17
  from ..types.send_text_data import SendTextData
@@ -54,10 +54,10 @@ class AsyncTextToSpeechStreamingSocketClient(EventEmitterMixin):
54
54
  finally:
55
55
  self._emit(EventType.CLOSE, None)
56
56
 
57
- async def initialize_connection(
57
+ async def configure(
58
58
  self,
59
59
  target_language_code: str,
60
- speaker: str,
60
+ speaker: str = "anushka",
61
61
  pitch: float = 0.0,
62
62
  pace: float = 1.0,
63
63
  loudness: float = 1.0,
@@ -69,21 +69,35 @@ class AsyncTextToSpeechStreamingSocketClient(EventEmitterMixin):
69
69
  max_chunk_length: int = 150,
70
70
  ) -> None:
71
71
  """
72
- Initialize the TTS connection with configuration parameters.
72
+ Configuration message required as the first message after establishing the WebSocket connection.
73
+ This initializes TTS parameters and can be updated at any time during the WebSocket lifecycle
74
+ by sending a new config message. When a config update is sent, any text currently in the buffer
75
+ will be automatically flushed and processed before applying the new configuration.
73
76
 
74
- :param target_language_code: Target language code (e.g., 'hi-IN')
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
85
- """
86
- data = InitializeConnectionData(
77
+ :param target_language_code: The language of the text is BCP-47 format
78
+ :param speaker: The speaker voice to be used for the output audio. Default: Anushka.
79
+ Model Compatibility (bulbul:v2): Female: Anushka, Manisha, Vidya, Arya;
80
+ Male: Abhilash, Karun, Hitesh
81
+ :param pitch: Controls the pitch of the audio. Lower values result in a deeper voice,
82
+ while higher values make it sharper. The suitable range is between -0.75
83
+ and 0.75. Default is 0.0.
84
+ :param pace: Controls the speed of the audio. Lower values result in slower speech,
85
+ while higher values make it faster. The suitable range is between 0.5
86
+ and 2.0. Default is 1.0.
87
+ :param loudness: Controls the loudness of the audio. Lower values result in quieter audio,
88
+ while higher values make it louder. The suitable range is between 0.3
89
+ and 3.0. Default is 1.0.
90
+ :param speech_sample_rate: Specifies the sample rate of the output audio. Supported values are
91
+ 8000, 16000, 22050, 24000 Hz. If not provided, the default is 22050 Hz.
92
+ :param enable_preprocessing: Controls whether normalization of English words and numeric entities
93
+ (e.g., numbers, dates) is performed. Set to true for better handling
94
+ of mixed-language text. Default is false.
95
+ :param output_audio_codec: Audio codec (currently supports MP3 only, optimized for real-time playback)
96
+ :param output_audio_bitrate: Audio bitrate (choose from 5 supported bitrate options)
97
+ :param min_buffer_size: Minimum character length that triggers buffer flushing for TTS model processing
98
+ :param max_chunk_length: Maximum length for sentence splitting (adjust based on content length)
99
+ """
100
+ data = ConfigureConnectionData(
87
101
  target_language_code=target_language_code,
88
102
  speaker=speaker,
89
103
  pitch=pitch,
@@ -96,14 +110,16 @@ class AsyncTextToSpeechStreamingSocketClient(EventEmitterMixin):
96
110
  min_buffer_size=min_buffer_size,
97
111
  max_chunk_length=max_chunk_length,
98
112
  )
99
- message = InitializeConnection(data=data)
113
+ message = ConfigureConnection(data=data)
100
114
  await self._send_model(message)
101
115
 
102
116
  async def convert(self, text: str) -> None:
103
117
  """
104
- Send text to be converted to speech.
118
+ Send text to be converted to speech. Text length should be 1-2500 characters.
119
+ Recommended: <500 characters for optimal streaming performance.
120
+ Real-time endpoints perform better with longer character counts.
105
121
 
106
- :param text: Text to be synthesized (1-2500 characters)
122
+ :param text: Text to be synthesized (1-2500 characters, recommended <500)
107
123
  """
108
124
  data = SendTextData(text=text)
109
125
  message = SendText(data=data)
@@ -111,15 +127,16 @@ class AsyncTextToSpeechStreamingSocketClient(EventEmitterMixin):
111
127
 
112
128
  async def flush(self) -> None:
113
129
  """
114
- Signal to flush the buffer and finalize audio output.
115
- This indicates the end of text input.
130
+ Forces the text buffer to process immediately, regardless of the min_buffer_size threshold.
131
+ Use this when you need to process remaining text that hasn't reached the minimum buffer size.
116
132
  """
117
133
  message = FlushSignal()
118
134
  await self._send_model(message)
119
135
 
120
136
  async def ping(self) -> None:
121
137
  """
122
- Send ping signal to keep the WebSocket connection alive.
138
+ Send ping signal to keep the WebSocket connection alive. The connection automatically
139
+ closes after one minute of inactivity.
123
140
  """
124
141
  message = PingSignal()
125
142
  await self._send_model(message)
@@ -182,10 +199,10 @@ class TextToSpeechStreamingSocketClient(EventEmitterMixin):
182
199
  finally:
183
200
  self._emit(EventType.CLOSE, None)
184
201
 
185
- def initialize_connection(
202
+ def configure(
186
203
  self,
187
204
  target_language_code: str,
188
- speaker: str,
205
+ speaker: str = "anushka",
189
206
  pitch: float = 0.0,
190
207
  pace: float = 1.0,
191
208
  loudness: float = 1.0,
@@ -197,21 +214,35 @@ class TextToSpeechStreamingSocketClient(EventEmitterMixin):
197
214
  max_chunk_length: int = 150,
198
215
  ) -> None:
199
216
  """
200
- Initialize the TTS connection with configuration parameters.
217
+ Configuration message required as the first message after establishing the WebSocket connection.
218
+ This initializes TTS parameters and can be updated at any time during the WebSocket lifecycle
219
+ by sending a new config message. When a config update is sent, any text currently in the buffer
220
+ will be automatically flushed and processed before applying the new configuration.
201
221
 
202
- :param target_language_code: Target language code (e.g., 'hi-IN')
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
213
- """
214
- data = InitializeConnectionData(
222
+ :param target_language_code: The language of the text is BCP-47 format
223
+ :param speaker: The speaker voice to be used for the output audio. Default: Anushka.
224
+ Model Compatibility (bulbul:v2): Female: Anushka, Manisha, Vidya, Arya;
225
+ Male: Abhilash, Karun, Hitesh
226
+ :param pitch: Controls the pitch of the audio. Lower values result in a deeper voice,
227
+ while higher values make it sharper. The suitable range is between -0.75
228
+ and 0.75. Default is 0.0.
229
+ :param pace: Controls the speed of the audio. Lower values result in slower speech,
230
+ while higher values make it faster. The suitable range is between 0.5
231
+ and 2.0. Default is 1.0.
232
+ :param loudness: Controls the loudness of the audio. Lower values result in quieter audio,
233
+ while higher values make it louder. The suitable range is between 0.3
234
+ and 3.0. Default is 1.0.
235
+ :param speech_sample_rate: Specifies the sample rate of the output audio. Supported values are
236
+ 8000, 16000, 22050, 24000 Hz. If not provided, the default is 22050 Hz.
237
+ :param enable_preprocessing: Controls whether normalization of English words and numeric entities
238
+ (e.g., numbers, dates) is performed. Set to true for better handling
239
+ of mixed-language text. Default is false.
240
+ :param output_audio_codec: Audio codec (currently supports MP3 only, optimized for real-time playback)
241
+ :param output_audio_bitrate: Audio bitrate (choose from 5 supported bitrate options)
242
+ :param min_buffer_size: Minimum character length that triggers buffer flushing for TTS model processing
243
+ :param max_chunk_length: Maximum length for sentence splitting (adjust based on content length)
244
+ """
245
+ data = ConfigureConnectionData(
215
246
  target_language_code=target_language_code,
216
247
  speaker=speaker,
217
248
  pitch=pitch,
@@ -224,14 +255,16 @@ class TextToSpeechStreamingSocketClient(EventEmitterMixin):
224
255
  min_buffer_size=min_buffer_size,
225
256
  max_chunk_length=max_chunk_length,
226
257
  )
227
- message = InitializeConnection(data=data)
258
+ message = ConfigureConnection(data=data)
228
259
  self._send_model(message)
229
260
 
230
261
  def convert(self, text: str) -> None:
231
262
  """
232
- Send text to be converted to speech.
263
+ Send text to be converted to speech. Text length should be 1-2500 characters.
264
+ Recommended: <500 characters for optimal streaming performance.
265
+ Real-time endpoints perform better with longer character counts.
233
266
 
234
- :param text: Text to be synthesized (1-2500 characters)
267
+ :param text: Text to be synthesized (1-2500 characters, recommended <500)
235
268
  """
236
269
  data = SendTextData(text=text)
237
270
  message = SendText(data=data)
@@ -239,15 +272,16 @@ class TextToSpeechStreamingSocketClient(EventEmitterMixin):
239
272
 
240
273
  def flush(self) -> None:
241
274
  """
242
- Signal to flush the buffer and finalize audio output.
243
- This indicates the end of text input.
275
+ Forces the text buffer to process immediately, regardless of the min_buffer_size threshold.
276
+ Use this when you need to process remaining text that hasn't reached the minimum buffer size.
244
277
  """
245
278
  message = FlushSignal()
246
279
  self._send_model(message)
247
280
 
248
281
  def ping(self) -> None:
249
282
  """
250
- Send ping signal to keep the WebSocket connection alive.
283
+ Send ping signal to keep the WebSocket connection alive. The connection automatically
284
+ closes after one minute of inactivity.
251
285
  """
252
286
  message = PingSignal()
253
287
  self._send_model(message)
@@ -19,6 +19,11 @@ from .chat_completion_response_message import ChatCompletionResponseMessage
19
19
  from .choice import Choice
20
20
  from .completion_usage import CompletionUsage
21
21
  from .config_message import ConfigMessage
22
+ from .configure_connection import ConfigureConnection
23
+ from .configure_connection_data import ConfigureConnectionData
24
+ from .configure_connection_data_output_audio_bitrate import ConfigureConnectionDataOutputAudioBitrate
25
+ from .configure_connection_data_speaker import ConfigureConnectionDataSpeaker
26
+ from .configure_connection_data_target_language_code import ConfigureConnectionDataTargetLanguageCode
22
27
  from .create_chat_completion_response import CreateChatCompletionResponse
23
28
  from .diarized_entry import DiarizedEntry
24
29
  from .diarized_transcript import DiarizedTranscript
@@ -32,11 +37,6 @@ from .events_data import EventsData
32
37
  from .finish_reason import FinishReason
33
38
  from .flush_signal import FlushSignal
34
39
  from .format import Format
35
- from .initialize_connection import InitializeConnection
36
- from .initialize_connection_data import InitializeConnectionData
37
- from .initialize_connection_data_output_audio_bitrate import InitializeConnectionDataOutputAudioBitrate
38
- from .initialize_connection_data_speaker import InitializeConnectionDataSpeaker
39
- from .initialize_connection_data_target_language_code import InitializeConnectionDataTargetLanguageCode
40
40
  from .language_identification_response import LanguageIdentificationResponse
41
41
  from .numerals_format import NumeralsFormat
42
42
  from .ping_signal import PingSignal
@@ -94,6 +94,11 @@ __all__ = [
94
94
  "Choice",
95
95
  "CompletionUsage",
96
96
  "ConfigMessage",
97
+ "ConfigureConnection",
98
+ "ConfigureConnectionData",
99
+ "ConfigureConnectionDataOutputAudioBitrate",
100
+ "ConfigureConnectionDataSpeaker",
101
+ "ConfigureConnectionDataTargetLanguageCode",
97
102
  "CreateChatCompletionResponse",
98
103
  "DiarizedEntry",
99
104
  "DiarizedTranscript",
@@ -107,11 +112,6 @@ __all__ = [
107
112
  "FinishReason",
108
113
  "FlushSignal",
109
114
  "Format",
110
- "InitializeConnection",
111
- "InitializeConnectionData",
112
- "InitializeConnectionDataOutputAudioBitrate",
113
- "InitializeConnectionDataSpeaker",
114
- "InitializeConnectionDataTargetLanguageCode",
115
115
  "LanguageIdentificationResponse",
116
116
  "NumeralsFormat",
117
117
  "PingSignal",