avartha-python-sdk 0.0.5__tar.gz → 0.0.7__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 (281) hide show
  1. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/MANIFEST.in +2 -1
  2. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/PKG-INFO +6 -4
  3. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/README.md +81 -33
  4. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/docs/compatibility.md +183 -7
  5. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/docs/migration.md +138 -13
  6. avartha_python_sdk-0.0.7/docs/platform.md +302 -0
  7. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/docs/pypi.md +5 -3
  8. avartha_python_sdk-0.0.7/docs/voice-conversations.md +282 -0
  9. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/examples/realtime.py +10 -3
  10. avartha_python_sdk-0.0.7/examples/realtime_asr.py +79 -0
  11. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/examples/tts.py +30 -15
  12. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/examples/tts_multi_context.py +11 -1
  13. avartha_python_sdk-0.0.7/examples/voice_conversation.py +41 -0
  14. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/__init__.py +7 -1
  15. avartha_python_sdk-0.0.7/src/avartha/_conversation_resources.py +555 -0
  16. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_openai_http.py +4 -1
  17. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_realtime_asr.py +141 -4
  18. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_realtime_openai.py +13 -1
  19. avartha_python_sdk-0.0.7/src/avartha/_realtime_sampling.py +77 -0
  20. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_realtime_tts.py +137 -28
  21. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_speech_http.py +69 -7
  22. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_speech_resources.py +47 -9
  23. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/control.py +528 -3
  24. avartha_python_sdk-0.0.7/src/avartha/conversational_ai/__init__.py +23 -0
  25. avartha_python_sdk-0.0.7/src/avartha/conversational_ai/conversation.py +747 -0
  26. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/elevenlabs.py +32 -13
  27. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/realtime/speech.py +9 -1
  28. avartha_python_sdk-0.0.7/src/avartha/types/conversational_ai.py +77 -0
  29. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_response_create_params.py +8 -0
  30. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_response_create_params_param.py +9 -0
  31. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_session_create_request.py +8 -0
  32. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_session_create_request_param.py +9 -0
  33. avartha_python_sdk-0.0.7/src/avartha/types/voice_agents.py +213 -0
  34. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha_python_sdk.egg-info/PKG-INFO +6 -4
  35. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha_python_sdk.egg-info/SOURCES.txt +7 -0
  36. avartha_python_sdk-0.0.5/docs/platform.md +0 -127
  37. avartha_python_sdk-0.0.5/examples/realtime_asr.py +0 -58
  38. avartha_python_sdk-0.0.5/src/avartha/conversational_ai/__init__.py +0 -5
  39. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/LICENSE +0 -0
  40. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/THIRD_PARTY_NOTICES +0 -0
  41. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/pyproject.toml +0 -0
  42. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/setup.cfg +0 -0
  43. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/setup.py +0 -0
  44. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_config.py +0 -0
  45. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_exceptions.py +0 -0
  46. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_http_errors.py +0 -0
  47. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_models.py +0 -0
  48. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_openai_http_errors.py +0 -0
  49. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_pacing.py +0 -0
  50. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_realtime_resources.py +0 -0
  51. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_sentinels.py +0 -0
  52. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_speech_config.py +0 -0
  53. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_unsupported.py +0 -0
  54. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_websocket.py +0 -0
  55. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/_ws_state.py +0 -0
  56. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/client.py +0 -0
  57. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/errors.py +0 -0
  58. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/openai.py +0 -0
  59. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/pagination.py +0 -0
  60. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/py.typed +0 -0
  61. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/realtime/__init__.py +0 -0
  62. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/resources/__init__.py +0 -0
  63. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/resources/models.py +0 -0
  64. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/resources/realtime/__init__.py +0 -0
  65. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/resources/realtime/realtime.py +0 -0
  66. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/__init__.py +0 -0
  67. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/audio/__init__.py +0 -0
  68. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/audio/transcription_language.py +0 -0
  69. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/model.py +0 -0
  70. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/__init__.py +0 -0
  71. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/audio_transcription.py +0 -0
  72. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/audio_transcription_param.py +0 -0
  73. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_created_event.py +0 -0
  74. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item.py +0 -0
  75. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_added.py +0 -0
  76. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_create_event.py +0 -0
  77. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_create_event_param.py +0 -0
  78. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_created_event.py +0 -0
  79. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_delete_event.py +0 -0
  80. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_delete_event_param.py +0 -0
  81. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_deleted_event.py +0 -0
  82. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_done.py +0 -0
  83. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_input_audio_transcription_completed_event.py +0 -0
  84. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_input_audio_transcription_delta_event.py +0 -0
  85. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_input_audio_transcription_failed_event.py +0 -0
  86. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_input_audio_transcription_segment.py +0 -0
  87. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_param.py +0 -0
  88. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_retrieve_event.py +0 -0
  89. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_retrieve_event_param.py +0 -0
  90. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_truncate_event.py +0 -0
  91. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_truncate_event_param.py +0 -0
  92. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/conversation_item_truncated_event.py +0 -0
  93. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/input_audio_buffer_append_event.py +0 -0
  94. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/input_audio_buffer_append_event_param.py +0 -0
  95. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/input_audio_buffer_clear_event.py +0 -0
  96. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/input_audio_buffer_clear_event_param.py +0 -0
  97. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/input_audio_buffer_cleared_event.py +0 -0
  98. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/input_audio_buffer_commit_event.py +0 -0
  99. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/input_audio_buffer_commit_event_param.py +0 -0
  100. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/input_audio_buffer_committed_event.py +0 -0
  101. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/input_audio_buffer_dtmf_event_received_event.py +0 -0
  102. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/input_audio_buffer_speech_started_event.py +0 -0
  103. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/input_audio_buffer_speech_stopped_event.py +0 -0
  104. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/input_audio_buffer_timeout_triggered.py +0 -0
  105. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/log_prob_properties.py +0 -0
  106. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/mcp_list_tools_completed.py +0 -0
  107. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/mcp_list_tools_failed.py +0 -0
  108. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/mcp_list_tools_in_progress.py +0 -0
  109. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/noise_reduction_type.py +0 -0
  110. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/output_audio_buffer_clear_event.py +0 -0
  111. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/output_audio_buffer_clear_event_param.py +0 -0
  112. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/rate_limits_updated_event.py +0 -0
  113. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_audio_config.py +0 -0
  114. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_audio_config_input.py +0 -0
  115. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_audio_config_input_param.py +0 -0
  116. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_audio_config_output.py +0 -0
  117. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_audio_config_output_param.py +0 -0
  118. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_audio_config_param.py +0 -0
  119. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_audio_formats.py +0 -0
  120. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_audio_formats_param.py +0 -0
  121. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_audio_input_turn_detection.py +0 -0
  122. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_audio_input_turn_detection_param.py +0 -0
  123. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_client_event.py +0 -0
  124. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_client_event_param.py +0 -0
  125. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_conversation_item_assistant_message.py +0 -0
  126. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_conversation_item_assistant_message_param.py +0 -0
  127. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_conversation_item_function_call.py +0 -0
  128. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_conversation_item_function_call_output.py +0 -0
  129. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_conversation_item_function_call_output_param.py +0 -0
  130. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_conversation_item_function_call_param.py +0 -0
  131. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_conversation_item_system_message.py +0 -0
  132. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_conversation_item_system_message_param.py +0 -0
  133. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_conversation_item_user_message.py +0 -0
  134. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_conversation_item_user_message_param.py +0 -0
  135. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_error.py +0 -0
  136. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_error_event.py +0 -0
  137. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_function_tool.py +0 -0
  138. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_function_tool_param.py +0 -0
  139. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_mcp_approval_request.py +0 -0
  140. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_mcp_approval_request_param.py +0 -0
  141. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_mcp_approval_response.py +0 -0
  142. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_mcp_approval_response_param.py +0 -0
  143. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_mcp_list_tools.py +0 -0
  144. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_mcp_list_tools_param.py +0 -0
  145. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_mcp_protocol_error.py +0 -0
  146. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_mcp_protocol_error_param.py +0 -0
  147. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_mcp_tool_call.py +0 -0
  148. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_mcp_tool_call_param.py +0 -0
  149. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_mcp_tool_execution_error.py +0 -0
  150. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_mcp_tool_execution_error_param.py +0 -0
  151. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_mcphttp_error.py +0 -0
  152. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_mcphttp_error_param.py +0 -0
  153. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_reasoning.py +0 -0
  154. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_reasoning_effort.py +0 -0
  155. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_reasoning_param.py +0 -0
  156. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_response.py +0 -0
  157. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_response_create_audio_output.py +0 -0
  158. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_response_create_audio_output_param.py +0 -0
  159. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_response_create_mcp_tool.py +0 -0
  160. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_response_create_mcp_tool_param.py +0 -0
  161. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_response_status.py +0 -0
  162. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_response_usage.py +0 -0
  163. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_response_usage_input_token_details.py +0 -0
  164. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_response_usage_output_token_details.py +0 -0
  165. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_server_event.py +0 -0
  166. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_tool_choice_config.py +0 -0
  167. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_tool_choice_config_param.py +0 -0
  168. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_tools_config.py +0 -0
  169. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_tools_config_param.py +0 -0
  170. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_tools_config_union.py +0 -0
  171. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_tracing_config.py +0 -0
  172. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_tracing_config_param.py +0 -0
  173. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_transcription_session_audio.py +0 -0
  174. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_transcription_session_audio_input.py +0 -0
  175. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_transcription_session_audio_input_param.py +0 -0
  176. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_transcription_session_audio_input_turn_detection.py +0 -0
  177. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_transcription_session_audio_input_turn_detection_param.py +0 -0
  178. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_transcription_session_audio_param.py +0 -0
  179. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_transcription_session_create_request.py +0 -0
  180. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_transcription_session_create_request_param.py +0 -0
  181. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_truncation.py +0 -0
  182. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_truncation_param.py +0 -0
  183. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_truncation_retention_ratio.py +0 -0
  184. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/realtime_truncation_retention_ratio_param.py +0 -0
  185. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_audio_delta_event.py +0 -0
  186. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_audio_done_event.py +0 -0
  187. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_audio_transcript_delta_event.py +0 -0
  188. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_audio_transcript_done_event.py +0 -0
  189. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_cancel_event.py +0 -0
  190. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_cancel_event_param.py +0 -0
  191. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_content_part_added_event.py +0 -0
  192. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_content_part_done_event.py +0 -0
  193. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_create_event.py +0 -0
  194. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_create_event_param.py +0 -0
  195. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_created_event.py +0 -0
  196. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_done_event.py +0 -0
  197. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_function_call_arguments_delta_event.py +0 -0
  198. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_function_call_arguments_done_event.py +0 -0
  199. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_mcp_call_arguments_delta.py +0 -0
  200. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_mcp_call_arguments_done.py +0 -0
  201. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_mcp_call_completed.py +0 -0
  202. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_mcp_call_failed.py +0 -0
  203. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_mcp_call_in_progress.py +0 -0
  204. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_output_item_added_event.py +0 -0
  205. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_output_item_done_event.py +0 -0
  206. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_text_delta_event.py +0 -0
  207. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/response_text_done_event.py +0 -0
  208. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/session_created_event.py +0 -0
  209. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/session_update_event.py +0 -0
  210. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/session_update_event_param.py +0 -0
  211. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/realtime/session_updated_event.py +0 -0
  212. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/responses/__init__.py +0 -0
  213. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/responses/image_detail.py +0 -0
  214. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/responses/response_input_file.py +0 -0
  215. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/responses/response_input_file_param.py +0 -0
  216. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/responses/response_input_image.py +0 -0
  217. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/responses/response_input_image_param.py +0 -0
  218. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/responses/response_input_text.py +0 -0
  219. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/responses/response_input_text_param.py +0 -0
  220. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/responses/response_prompt.py +0 -0
  221. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/responses/response_prompt_param.py +0 -0
  222. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/responses/tool_choice_function.py +0 -0
  223. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/responses/tool_choice_function_param.py +0 -0
  224. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/responses/tool_choice_mcp.py +0 -0
  225. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/responses/tool_choice_mcp_param.py +0 -0
  226. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/responses/tool_choice_options.py +0 -0
  227. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/shared/__init__.py +0 -0
  228. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/shared/metadata.py +0 -0
  229. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/shared_params/__init__.py +0 -0
  230. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/shared_params/metadata.py +0 -0
  231. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/__init__.py +0 -0
  232. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/alignment.py +0 -0
  233. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/audio_output_multi.py +0 -0
  234. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/close_context.py +0 -0
  235. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/close_socket.py +0 -0
  236. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/final_output_multi.py +0 -0
  237. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/fine_tuning_response.py +0 -0
  238. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/fine_tuning_response_state_value.py +0 -0
  239. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/flush_context.py +0 -0
  240. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/generation_config.py +0 -0
  241. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/get_voices_response.py +0 -0
  242. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/get_voices_v_2_response.py +0 -0
  243. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/initialize_connection_multi.py +0 -0
  244. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/language_response.py +0 -0
  245. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/manual_verification_file_response.py +0 -0
  246. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/manual_verification_response.py +0 -0
  247. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/model.py +0 -0
  248. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/model_rates_response_model.py +0 -0
  249. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/normalized_alignment.py +0 -0
  250. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/output_format.py +0 -0
  251. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/pronunciation_dictionary_locator.py +0 -0
  252. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/reader_resource_response_model.py +0 -0
  253. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/reader_resource_response_model_resource_type.py +0 -0
  254. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/realtime_voice_settings.py +0 -0
  255. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/recording_response.py +0 -0
  256. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/review_status.py +0 -0
  257. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/send_text_multi.py +0 -0
  258. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/speaker_response_model.py +0 -0
  259. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/speaker_separation_response_model.py +0 -0
  260. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/speaker_separation_response_model_status.py +0 -0
  261. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/utterance_response_model.py +0 -0
  262. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/verification_attempt_response.py +0 -0
  263. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/verified_voice_language_response_model.py +0 -0
  264. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/voice.py +0 -0
  265. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/voice_category.py +0 -0
  266. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/voice_labelling_status.py +0 -0
  267. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/voice_recording_quality.py +0 -0
  268. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/voice_safety_control.py +0 -0
  269. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/voice_sample.py +0 -0
  270. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/voice_settings.py +0 -0
  271. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/voice_sharing_moderation_check_response_model.py +0 -0
  272. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/voice_sharing_response.py +0 -0
  273. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/voice_sharing_response_category.py +0 -0
  274. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/voice_sharing_state.py +0 -0
  275. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech/voice_verification_response.py +0 -0
  276. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/speech_language.py +0 -0
  277. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/websocket_connection_options.py +0 -0
  278. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha/types/websocket_reconnection.py +0 -0
  279. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha_python_sdk.egg-info/dependency_links.txt +0 -0
  280. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha_python_sdk.egg-info/requires.txt +0 -0
  281. {avartha_python_sdk-0.0.5 → avartha_python_sdk-0.0.7}/src/avartha_python_sdk.egg-info/top_level.txt +0 -0
@@ -5,5 +5,6 @@ recursive-include src/avartha *.py py.typed
5
5
  exclude src/avartha/_version.py
6
6
  recursive-include src/avartha_python_sdk.egg-info PKG-INFO SOURCES.txt dependency_links.txt requires.txt top_level.txt
7
7
  include docs/pypi.md docs/compatibility.md docs/migration.md docs/platform.md
8
+ include docs/voice-conversations.md
8
9
  include examples/realtime.py examples/tts.py examples/tts_multi_context.py
9
- include examples/realtime_asr.py
10
+ include examples/realtime_asr.py examples/voice_conversation.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: avartha-python-sdk
3
- Version: 0.0.5
3
+ Version: 0.0.7
4
4
  Summary: Python clients for Avartha Realtime text, streaming speech, and platform management
5
5
  Author-email: "Avartha Inc." <team@avartha.ai>
6
6
  License-Expression: LicenseRef-Avartha-Proprietary
@@ -109,12 +109,14 @@ Inference consumes credits.
109
109
  | Realtime ASR | `await client.speech_to_text.realtime.connect(...)` on either speech client |
110
110
  | Speech discovery | Speech clients: models, voices, voice settings, ASR languages |
111
111
  | Workspaces, members, invitations | `Control` / `AsyncControl` |
112
+ | Voice agents: create, edit, publish, restore, delete | `Control` / `AsyncControl`: `voice_agents` |
113
+ | Live conversations with published agents | `avartha.conversational_ai`: `Conversation`, `AsyncConversation` |
114
+ | Placing phone calls from Twilio numbers | `ElevenLabs` / `AsyncElevenLabs`: `conversational_ai.twilio.outbound_call` |
112
115
  | Combined inference and management | `Avartha` / `AsyncAvartha` |
113
116
 
114
117
  Managed inference uses WebSockets; Chat Completions, Responses, HTTP TTS,
115
- and file transcription are unavailable. Agent management and conversation
116
- sessions are planned; accessing `conversational_ai` currently raises
117
- `NotImplementedError`.
118
+ and file transcription are unavailable. ElevenLabs-schema agent management is not
119
+ implemented, and accessing it under `conversational_ai` raises `NotImplementedError`.
118
120
 
119
121
  ## Migrating and handling errors
120
122
 
@@ -137,7 +137,9 @@ async def main():
137
137
  asyncio.run(main())
138
138
  ```
139
139
 
140
- [Complete Realtime example](examples/realtime.py).
140
+ [Complete Realtime example](examples/realtime.py). Avartha also accepts
141
+ `temperature` and other [sampling controls](docs/compatibility.md#sampling-controls)
142
+ in `session.update` and `response.create`.
141
143
 
142
144
  ## Streaming speech
143
145
 
@@ -161,9 +163,9 @@ with ElevenLabs() as client:
161
163
  print(voice.voice_id)
162
164
  ```
163
165
 
164
- Stream text over a WebSocket with `convert_realtime`. Avartha returns PCM;
165
- select a sample rate supported by your model and write a WAV header for playback.
166
- This example uses Qwen's 24 kHz output:
166
+ Stream text over a WebSocket with `convert_realtime`. The runtime converts the
167
+ model's audio to the `output_format` you select: raw PCM at 8 to 48 kHz, MP3, or
168
+ G.711 (`ulaw_8000`, `alaw_8000`). This example writes 24 kHz PCM to a WAV file:
167
169
 
168
170
  ```python
169
171
  import wave
@@ -184,7 +186,9 @@ with ElevenLabs() as client:
184
186
  output.writeframes(chunk)
185
187
  ```
186
188
 
187
- The default output format is `pcm_24000`. Use `AsyncElevenLabs` and `async for`
189
+ The default output format is `pcm_24000`. See
190
+ [output formats, timeouts, and timestamps](docs/compatibility.md#output-formats-timeouts-and-timestamps)
191
+ for every format, `inactivity_timeout`, and character timestamps. Use `AsyncElevenLabs` and `async for`
188
192
  for async TTS; the async client's `text` accepts either a regular iterable or
189
193
  an async iterable. Run the
190
194
  [TTS example](examples/tts.py) with `--async` to use that client.
@@ -221,7 +225,9 @@ Use `AsyncAvartha` or `AsyncElevenLabs` for an async application. See the
221
225
  [live STT execution guidance](docs/migration.md#live-speech-to-text) for scripts
222
226
  and applications with an existing event loop.
223
227
 
224
- Send mono PCM16 audio and await a committed transcript.
228
+ Current ASR models require 16 kHz mono PCM16 audio. Convert other formats or
229
+ sample rates before sending audio chunks; the SDK does not resample them.
230
+ Await a committed transcript before closing the session.
225
231
  [The complete example](examples/realtime_asr.py) reads a WAV file, registers
226
232
  transcript/error callbacks, streams chunks, commits, and closes the connection:
227
233
 
@@ -229,44 +235,82 @@ transcript/error callbacks, streams chunks, commits, and closes the connection:
229
235
  python examples/realtime_asr.py mistralai/voxtral-mini-4b-realtime-2602 speech-16k.wav
230
236
  ```
231
237
 
232
- `previous_text` is optional text context for transcription. When omitted from
233
- `connection.send` data, Avartha sends `null`, meaning no context. You can omit
234
- this field when streaming audio without prior text.
238
+ Current ASR models reject nonempty `previous_text`. Omit it from
239
+ `connection.send`; the SDK sends `null`. An empty string is also accepted.
240
+ For vocabulary hints on supported models, pass `keyterms` in the connection
241
+ options instead.
235
242
 
236
243
  File-based HTTP `speech_to_text.convert` is retired on managed inference.
237
244
 
245
+ Connection options cover background speech filtering, vocabulary hints,
246
+ manual/VAD commits, semantic turn detection, word log probabilities, timestamps,
247
+ and speaker labels on supported models. Register `RealtimeEvents.WARNING` for nonfatal
248
+ warnings, including unavailable timing metadata. See
249
+ [ASR options and callbacks](docs/migration.md#recognition-and-context-hints)
250
+ for configuration and server requirements.
251
+
238
252
  ## Agents
239
253
 
240
- Agent management, tools, knowledge bases, and conversation sessions/history are
241
- currently unavailable. Accessing `client.conversational_ai` raises
242
- `NotImplementedError`.
254
+ `Control.voice_agents` creates, edits, publishes, restores, and deletes Avartha voice
255
+ agents, using the platform's own schema. See [voice agents](docs/platform.md#voice-agents) for an
256
+ example and the access each operation needs:
257
+
258
+ ```python
259
+ from avartha import Control
243
260
 
244
- ElevenLabs-compatible `conversational_ai` support is planned for an upcoming
245
- release, including agent creation, tools, knowledge-base documents, and
246
- conversations.
261
+ with Control() as client:
262
+ agent = client.voice_agents.create(
263
+ "your-workspace-id",
264
+ name="Support",
265
+ template_id="blank",
266
+ config={"schema_version": 1, "instructions": "Answer questions concisely."},
267
+ )
268
+ print(agent["id"], agent["generation"])
269
+ ```
247
270
 
248
- The following example previews the planned API. It requires that future SDK
249
- release and a service implementing the corresponding agent endpoints:
271
+ Hold a live conversation with a published agent using `Conversation` or
272
+ `AsyncConversation`. They follow the ElevenLabs conversation client for the subset the
273
+ platform supports. See [voice conversations](docs/voice-conversations.md) for speech,
274
+ per-call options, and conversation records:
250
275
 
251
276
  ```python
277
+ import time
278
+
252
279
  from avartha import ElevenLabs
280
+ from avartha.conversational_ai import Conversation
253
281
 
254
- with ElevenLabs(base_url="https://your-compatible-agent-service") as client:
255
- agent = client.conversational_ai.agents.create(
256
- name="Support",
257
- conversation_config={
258
- "agent": {
259
- "first_message": "What can I help you with?",
260
- "prompt": {"prompt": "Help customers find concise, accurate answers."},
261
- },
262
- "tts": {"voice_id": "your-voice"},
263
- },
282
+ with ElevenLabs() as client:
283
+ conversation = Conversation(
284
+ client,
285
+ "your-agent-id",
286
+ requires_auth=False,
287
+ callback_agent_response=lambda text: print("Agent:", text),
264
288
  )
265
- print(agent.agent_id)
289
+ conversation.start_session()
290
+ conversation.wait_for_session_start()
291
+ conversation.send_user_message("What can you help me with?")
292
+ time.sleep(15) # Replies arrive through the callbacks.
293
+ conversation.end_session()
294
+ conversation.wait_for_session_end()
266
295
  ```
267
296
 
268
- The planned `avartha.conversational_ai` namespace will also include
269
- `Conversation`, `AsyncConversation`, and `ClientTools`.
297
+ An agent can also call someone from one of the workspace's Twilio numbers. Pass an
298
+ `idempotency_key`, so a retry can't ring them twice, and check `placed.success`:
299
+
300
+ ```python
301
+ placed = client.conversational_ai.twilio.outbound_call(
302
+ agent_id="your-agent-id",
303
+ agent_phone_number_id="your-twilio-number-id",
304
+ to_number="+14155550100",
305
+ idempotency_key="order-1042-reminder",
306
+ )
307
+ ```
308
+
309
+ See [placing a phone call](docs/voice-conversations.md#placing-a-phone-call) for its
310
+ prerequisites and how to follow the call.
311
+
312
+ ElevenLabs-schema agent management, tools, and knowledge bases are not implemented.
313
+ Accessing them under `client.conversational_ai` raises `NotImplementedError`.
270
314
 
271
315
  ## Using types
272
316
 
@@ -346,9 +390,13 @@ with OpenAI(timeout=30.0, max_retries=0) as client:
346
390
  print(client.models.list())
347
391
  ```
348
392
 
349
- HTTP and WebSocket retry settings are separate. The OpenAI-compatible clients accept
350
- `client.realtime.connect(..., max_retries=0)` to disable automatic reconnection,
351
- and `websocket_connection_options` for transport settings. Use `asyncio.timeout`
393
+ HTTP and WebSocket retry settings are separate. Realtime reconnection is opt-in:
394
+ supply `on_reconnecting` to `client.realtime.connect(...)`. `max_retries` bounds
395
+ consecutive recovery attempts; a session greeting alone does not reset the budget.
396
+ Set `max_retries=0` to disable retries even when a callback is supplied.
397
+ A reconnect opens a fresh session. The SDK does not replay session configuration,
398
+ conversation history, or an interrupted response; the application must restore
399
+ its state. Use `websocket_connection_options` for transport settings and `asyncio.timeout`
352
400
  when an async operation needs an overall deadline. Close active sessions when
353
401
  cancelling. ElevenLabs `timeout` configures HTTP calls; it does not set a
354
402
  WebSocket receive deadline. Platform management writes are never retried
@@ -20,16 +20,19 @@ use HTTP.
20
20
  | Chat Completions, Responses, SSE, and OpenAI HTTP speech | Unavailable | Managed inference requires a Realtime connection |
21
21
  | Speech models and voices | Typed sync/async HTTP discovery | A visible speech model; voice discovery requires a routable TTS model |
22
22
  | ASR languages | Sync/async `speech_to_text.languages.list(model_id=...)` | A routable ASR model; language hints depend on the model |
23
- | Single-context TTS | Sync/async `convert_realtime` | A TTS model and voice supporting the selected PCM format |
24
- | Multi-context TTS | Sync/async `connect_multi_context` | A model supporting multiple contexts; each utterance needs a new context ID |
23
+ | Single-context TTS | Sync/async `convert_realtime` | A TTS model and voice; the runtime converts to the selected PCM, MP3 or G.711 format |
24
+ | Multi-context TTS | Sync/async `connect_multi_context` | A model supporting multiple contexts; each utterance needs a new context ID. Character timestamps need a timestamp-capable model |
25
25
  | Realtime ASR | Async connections on both speech clients | An ASR model supporting the supplied audio format and sample rate |
26
26
  | HTTP TTS and file transcription | Unavailable | Use realtime speech methods |
27
- | Agents, tools, knowledge bases, conversation sessions/history | Planned; currently unavailable | Accessing `conversational_ai` raises `NotImplementedError` |
27
+ | Live conversations and their history | Sync/async `Conversation`, `AsyncConversation`, and `conversational_ai.conversations` | A published agent and an API key for its workspace; see [voice conversations](voice-conversations.md) |
28
+ | Placing phone calls | Sync/async `conversational_ai.twilio.outbound_call` | Outbound calling enabled, a key with `voice_calls_place`, a Twilio number, and a published agent; see [placing a phone call](voice-conversations.md#placing-a-phone-call) |
29
+ | ElevenLabs-schema agents, tools, knowledge bases | Not implemented | Accessing them under `conversational_ai` raises `NotImplementedError` |
30
+ | Avartha voice agents: create, read, edit, publish, restore, delete | Sync/async `Control.voice_agents` | An API key with voice-agent management access to that workspace; the feature enabled; capacity to publish |
28
31
  | Catalog, workspaces, members, and invitations | Sync/async `Control` | An Avartha API key with the required workspace role and allocation |
29
32
  | API-key administration | Unavailable through `Control` | Use the platform portal; these operations require a browser session |
30
33
 
31
34
  See [platform management](platform.md) for workspace roles, invitation
32
- requirements, and permissions.
35
+ requirements, voice agents, and permissions.
33
36
 
34
37
  ## OpenAI Realtime text
35
38
 
@@ -50,6 +53,43 @@ serialization methods. The server must implement each requested feature.
50
53
  Inspect `response.done.response.status` to distinguish successful completion
51
54
  from failure, cancellation, or an incomplete response.
52
55
 
56
+ ### Sampling controls
57
+
58
+ Avartha adds sampling controls to `session.update` and `response.create`:
59
+ `temperature`, `top_p`, `top_k`, `min_p`, `presence_penalty`,
60
+ `frequency_penalty`, and `repetition_penalty`. They are typed on
61
+ `RealtimeSessionCreateRequestParam` and `RealtimeResponseCreateParamsParam`.
62
+ They are not part of the upstream OpenAI GA Realtime contract, and are sent
63
+ unchanged. Omitted fields use the deployment's sampling preset, which can differ
64
+ by model, reasoning mode, and tool use. A session value applies to later
65
+ responses, and `None` restores the preset for that field. A response value
66
+ applies only to that response; `None` there keeps the session's value. A
67
+ `session.updated` event echoes only the sampling values a `session.update` set.
68
+
69
+ ```python
70
+ await connection.session.update(session={"type": "realtime", "temperature": 0.7})
71
+ await connection.response.create(response={"temperature": 0.2}) # this response only
72
+ ```
73
+
74
+ A temperature below `0.00001` decodes greedily. In the same event, leave
75
+ `top_p`, `top_k`, and `min_p` unset or at their neutral values: `1`, `-1` or `0`,
76
+ and `0`. Values outside these ranges raise `ValueError` before a frame is sent
77
+ or queued, including through `send_raw()`:
78
+
79
+ | Field | Accepted values |
80
+ | --- | --- |
81
+ | `temperature` | A finite number from 0 to 2 |
82
+ | `top_p` | Greater than 0 and at most 1 |
83
+ | `top_k` | An integer: `-1` or `0` (disabled), or 1 to 2,147,483,647 |
84
+ | `min_p` | 0 to 1 |
85
+ | `presence_penalty`, `frequency_penalty` | -2 to 2 |
86
+ | `repetition_penalty` | A finite number greater than 0 |
87
+
88
+ Active penalties also require deployment support; otherwise the server refuses
89
+ them with an `error` event. Speech-to-text connections have no temperature setting.
90
+
91
+ ### Unsupported operations
92
+
53
93
  Explicit audio/transcription/image requests raise `UnsupportedOperationError`
54
94
  before a frame is sent or queued. Audio event declarations remain importable for
55
95
  schema compatibility. Unsupported HTTP resources, including Chat Completions,
@@ -124,9 +164,13 @@ Speech discovery uses these HTTP routes under
124
164
  | `voices.search(...)` | `/v2/voices` | Same; supported filters are `search`, `page_size` (1–100), `next_page_token`, and `include_total_count` |
125
165
  | `voices.get(voice_id)` | `/v1/voices/{voice_id}` | Voice exists for the selected model |
126
166
  | `voices.settings.get(voice_id)` | `/v1/voices/{voice_id}/settings` | Same; server reports supported `speed=1.0` |
127
- | `speech_to_text.languages.list(model_id=...)` | `/v1/speech-to-text/languages` | A routable ASR model; runtime reports supported languages or unavailable hints |
167
+ | `speech_to_text.languages.list(model_id=...)` | `/v1/models` | Selects the ASR model's language metadata from the speech catalog |
128
168
 
129
169
  All methods have sync and async variants and typed raw-response access.
170
+ The language helper maps catalog `language_id` entries to `code`. An empty
171
+ language list means hints are unsupported; missing metadata or an unavailable
172
+ model raises `ApiError`. Its raw-response wrapper retains the catalog response's
173
+ HTTP status and headers while exposing the selected model's typed language list.
130
174
  Model/voice methods retain upstream signatures; language discovery is an
131
175
  Avartha extension. Pass the TTS `model_id` through
132
176
  `request_options.additional_query_parameters`, especially when multiple TTS
@@ -161,6 +205,43 @@ This does not change when the serving model starts generating audio.
161
205
  Both single-context and multi-context SDK helpers always send `auto_mode=true`.
162
206
  The SDK does not support `auto_mode=False` or `default_mode`.
163
207
 
208
+ ### Output formats, timeouts, and timestamps
209
+
210
+ `output_format` selects the delivery encoding and sample rate. The runtime
211
+ converts the model's native audio and keeps its channel count.
212
+ `TextToSpeechOutputFormat` lists the accepted values:
213
+
214
+ | Encoding | Formats |
215
+ | --- | --- |
216
+ | Raw PCM16, little-endian, no WAV header | `pcm_8000`, `pcm_16000`, `pcm_22050`, `pcm_24000`, `pcm_32000`, `pcm_44100`, `pcm_48000`, or the model's native rate |
217
+ | MP3; the suffix is the bitrate in kbit/s | `mp3_22050_32`, `mp3_44100_32`, `mp3_44100_64`, `mp3_44100_96`, `mp3_44100_128`, `mp3_44100_192` |
218
+ | G.711 telephony | `ulaw_8000`, `alaw_8000` |
219
+
220
+ The SDK helpers send `DEFAULT_TTS_OUTPUT_FORMAT` (`pcm_24000`) when the argument
221
+ is omitted, so the delivered rate does not depend on the model. Audio bytes are
222
+ returned exactly as received: decode MP3 and G.711 with a matching decoder, and
223
+ play or wrap PCM at the selected rate. Conversion can add first-audio latency.
224
+
225
+ `inactivity_timeout` is an Avartha extension on `convert_realtime` and
226
+ `connect_multi_context`. It is the number of seconds, from 1 to 180, the
227
+ runtime waits for more text on a context before ending it; omission uses the
228
+ runtime's 20-second default. WebSocket pings keep the connection open but do not
229
+ reset this timer. In a multi-context session, `send(context_id, "")` refreshes
230
+ only that context. The platform's connection watchdog is separate: it closes a
231
+ connection after 90 seconds without traffic, or after `inactivity_timeout` plus
232
+ 10 seconds when that is longer.
233
+
234
+ `connect_multi_context(..., sync_alignment=True)` requests approximate character
235
+ timings on timestamp-capable models. They arrive in
236
+ `AudioOutputMulti.normalized_alignment`, measured from the start of that
237
+ message's audio. Alignment requires PCM or G.711 output; MP3 packets do not share
238
+ the alignment clock. `convert_realtime` yields audio bytes only, so it has no
239
+ alignment option.
240
+
241
+ Out-of-range `inactivity_timeout` values, a non-boolean `sync_alignment`, and
242
+ `sync_alignment=True` with MP3 raise `ValueError` before connecting. For
243
+ `convert_realtime`, that happens when iteration starts.
244
+
164
245
  Use `contextlib.closing(audio)` for the sync iterator or
165
246
  `contextlib.aclosing(audio)` for the async iterator when playback may stop early.
166
247
  Closing the iterator closes the socket and waits for its sender to stop. Started
@@ -254,10 +335,105 @@ budget of 1,000 burst frames and 250 frames/second. If a deployment advertises
254
335
  different limits, pass its `websocket_limits` mapping to the `ElevenLabs` or
255
336
  `AsyncElevenLabs` constructor. Limits are applied separately to each socket.
256
337
 
257
- Audio formats and `voice_settings` depend on the selected model. Specifying an
258
- option in the SDK does not make it available on the server. Runnable examples:
338
+ `voice_settings`, character timestamps, and the native rate depend on the
339
+ selected model. Specifying an option in the SDK does not make it available on
340
+ the server. Runnable examples:
259
341
  [single-context](../examples/tts.py), [multi-context](../examples/tts_multi_context.py).
260
342
 
343
+ ## Realtime ASR
344
+
345
+ Audio-chunk mode sends samples unchanged. Supply matching `audio_format` and
346
+ `sample_rate`; mismatches raise `ValueError` before opening a socket. Supported
347
+ encodings and rates depend on the server. URL mode requires FFmpeg and converts
348
+ the source to 16 kHz mono PCM16. After a successful, nonempty source reaches EOF,
349
+ the SDK commits the final turn and keeps receiving transcript events until the
350
+ application closes the connection. FFmpeg failures emit `RealtimeEvents.ERROR`.
351
+ Custom client headers also apply to the ASR WebSocket handshake.
352
+
353
+ The SDK also preserves `previous_text` on audio chunks, but current ASR models
354
+ accept only omission, `null`, or an empty string. Nonempty values are rejected.
355
+ Vocabulary hints use `keyterms` on models that support them.
356
+
357
+ The SDK forwards background filtering (`filter_background_audio`), vocabulary
358
+ hints (`keyterms`), manual/VAD commit controls, and `include_timestamps`.
359
+ It additionally exposes Avartha's `diarize`, `include_logprobs`, `turn_model`,
360
+ and `turn_threshold` options on both audio-chunk and URL connections. These
361
+ extensions are not a claim of upstream ElevenLabs realtime feature parity.
362
+ Omitted extension options are not added to the query; explicit booleans are
363
+ sent as `true` or `false`.
364
+
365
+ The server validates feature combinations and model availability. Diarization
366
+ requires timestamps and a model with speaker-label support. Timestamps also
367
+ depend on language support. Background filtering and vocabulary hints also
368
+ depend on the model.
369
+
370
+ ### Turn detection
371
+
372
+ `turn_model` takes `"silence"` (the default), `"smart_turn_v3"`, or
373
+ `"turn_eot_t3_v1"` (the `TurnModel` type) and requires
374
+ `commit_strategy=CommitStrategy.VAD`. The two semantic models estimate whether
375
+ a pause means the speaker has finished. The deployment must load the requested
376
+ model, and the server refuses one it has not loaded rather than substituting
377
+ another. Shipped Qwen3-ASR deployments load `turn_eot_t3_v1`; on them,
378
+ `smart_turn_v3` is refused.
379
+
380
+ | Setting | Accepted values | Default |
381
+ | --- | --- | --- |
382
+ | `turn_threshold` | Strictly between 0 and 1; requires a semantic `turn_model` | `0.79` for `turn_eot_t3_v1`, `0.5` for `smart_turn_v3` |
383
+ | `vad_silence_threshold_secs` | 0.2 to 5.0 seconds | `1.0` with `silence`; `2.0` as the fallback with a semantic model |
384
+ | `vad_threshold` | Strictly between 0 and 1 | `0.5` |
385
+ | `min_speech_duration_ms` | An integer; rounded up to 32 ms frames, plus 300 ms, it must fit 8,000 ms (at most 7,680) | Model-dependent |
386
+ | `min_silence_duration_ms` | An integer below the silence threshold in milliseconds | Model-dependent |
387
+
388
+ These settings raise `ValueError` before connecting when used without VAD
389
+ mode, when out of range, or, for `turn_threshold`, with `turn_model="silence"`
390
+ or no `turn_model`. `session_started.config` reports the effective values.
391
+
392
+ The silence threshold controls when buffered audio is submitted, not how quickly
393
+ the final transcript arrives. `connection.commit()` skips the remaining VAD
394
+ wait, but queueing, final decoding, and delivery still take time.
395
+
396
+ ### Vocabulary hints and language
397
+
398
+ `keyterms` biases recognition toward the listed terms on Qwen3-ASR deployments
399
+ with context biasing. It does not guarantee a spelling. Each term is sent
400
+ unchanged as its own query parameter. The server trims each term before
401
+ counting, so the SDK checks these limits before connecting:
402
+
403
+ - at most 16 terms;
404
+ - at most 40 whitespace-separated words across all terms;
405
+ - at most 128 UTF-8 bytes per term;
406
+ - no blank terms or control characters.
407
+
408
+ The server also caps the terms' combined tokens at about 40. It tokenizes each
409
+ term separately with the model's tokenizer and reserves room for the separators
410
+ it adds between terms. Sixteen terms can therefore exceed the token cap,
411
+ especially invented names that use several tokens each. The
412
+ SDK cannot measure tokens; the server's refusal reports the measured count and
413
+ the limit. An error before `session_started` closes the connection.
414
+
415
+ `language_code` is an optional spoken-language hint, fixed for the connection.
416
+ Omit it for automatic detection; `""` and `"auto"` raise `ValueError`. Regional
417
+ forms such as `en-US` match their base language. Qwen3-ASR adds the hint to
418
+ its decoder prompt. A correct hint can leave the transcript unchanged, so it
419
+ does not guarantee an accuracy change. Check support with
420
+ `speech_to_text.languages.list(model_id=...)`.
421
+
422
+ ### Session timing
423
+
424
+ Send the first audio chunk or commit within 30 seconds of connecting. WebSocket
425
+ pings do not count toward this deadline, and the server closes an idle new
426
+ session with an `input_error` event. After the first message, the server's
427
+ pings keep the connection open between utterances. The one-hour session
428
+ lifetime still applies. Close the connection when transcription is finished.
429
+
430
+ Transcript callbacks preserve server dictionaries, including `words` with
431
+ timing, speaker labels, and log probabilities when supplied.
432
+ `RealtimeEvents.WARNING` delivers nonfatal warnings without also dispatching
433
+ `ERROR`. A timing warning can replace a timed result; the preceding plain
434
+ committed transcript remains usable. See the
435
+ [ASR options and event guidance](migration.md#recognition-and-context-hints).
436
+
261
437
  ## URLs and authentication
262
438
 
263
439
  - `Avartha` and `Control` accept a platform root, including a proxy prefix.
@@ -76,6 +76,11 @@ Keep `client.realtime.connect`, `session.update`,
76
76
  The same applies to `AsyncOpenAI` with `await` and `async for`.
77
77
  [Complete usage examples](../README.md#usage).
78
78
 
79
+ The GA Realtime session has no `temperature`. Avartha accepts `temperature`
80
+ (0 to 2) and other sampling controls in `session.update` and as per-response
81
+ overrides in `response.create`; see
82
+ [sampling controls](compatibility.md#sampling-controls).
83
+
79
84
  ### Types, errors, and integrations
80
85
 
81
86
  Replace `openai.types` imports with the corresponding `avartha.types` imports;
@@ -159,12 +164,19 @@ use `avartha.ApiError`. WebSocket exceptions retain the `websockets` classes.
159
164
  | Speech discovery | `models.list`, `voices.get_all`, `voices.search`, `voices.get`, `voices.settings.get` | Typed sync/async HTTP resources |
160
165
  | ASR languages | `speech_to_text.languages.list(model_id=...)` | Typed sync/async Avartha extension |
161
166
  | HTTP TTS, file ASR | `text_to_speech.convert`, `text_to_speech.stream`, `speech_to_text.convert` | Unavailable in this SDK |
162
- | Agents, tools, knowledge bases, conversation sessions/history | `conversational_ai` | Currently unavailable |
167
+ | Conversation sessions and history | `conversational_ai.conversation`, `conversational_ai.conversations` | A documented subset; see [voice conversations](voice-conversations.md) |
168
+ | Placing phone calls | `conversational_ai.twilio.outbound_call` | A documented subset; see [placing a phone call](voice-conversations.md#placing-a-phone-call) |
169
+ | Registering Twilio calls | `conversational_ai.twilio.register_call` | Unavailable in this SDK |
170
+ | Agents, tools, knowledge bases | `conversational_ai` | Not implemented |
163
171
 
164
172
  Replace `avartha.legacy.ElevenLabs` and `avartha.legacy.AsyncElevenLabs` imports
165
173
  with `avartha.ElevenLabs` and `avartha.AsyncElevenLabs`.
166
- `conversational_ai` access raises `NotImplementedError`. The old conversation
167
- runtime, `play`/`save`/`stream` re-exports, and `audio` extra were removed.
174
+ Accessing agents, tools, or knowledge bases under `conversational_ai` raises
175
+ `NotImplementedError`; Avartha's own voice agents use a different schema and are managed
176
+ with [`Control.voice_agents`](platform.md#voice-agents). Conversations use
177
+ `avartha.conversational_ai`; call `wait_for_session_start()` before sending, and pass
178
+ your own audio interface, because `DefaultAudioInterface` is not included. The
179
+ `play`/`save`/`stream` re-exports and `audio` extra were removed.
168
180
  Write received PCM bytes to a WAV file or use your application's audio player;
169
181
  see [the TTS example](../examples/tts.py).
170
182
 
@@ -191,9 +203,7 @@ with ElevenLabs() as client:
191
203
  if voices:
192
204
  voice = client.voices.get(voices[0].voice_id, request_options=options)
193
205
  settings = client.voices.settings.get(voice.voice_id, request_options=options)
194
- languages = client.speech_to_text.languages.list(
195
- model_id="mistralai/voxtral-mini-4b-realtime-2602"
196
- )
206
+ languages = client.speech_to_text.languages.list(model_id="YOUR_ASR_MODEL_ID")
197
207
  ```
198
208
 
199
209
  Use `AsyncElevenLabs` with `async with` and `await` for each call. Each resource
@@ -213,15 +223,21 @@ available as `error.__cause__`.
213
223
  `model_id` is an Avartha query extension for voice discovery. Specify it when
214
224
  more than one TTS model is available. The platform supports `search`, `page_size`,
215
225
  `next_page_token`, and `include_total_count` on `voices.search`; other vendor
216
- filters are forwarded and may be rejected by the server. ASR language hints
217
- can be unavailable, with `language_hints_supported=False` and an empty list.
226
+ filters are forwarded and may be rejected by the server. The language helper
227
+ selects the requested ASR model from `models.list()`. An empty language list
228
+ means hints are unsupported (`language_hints_supported=False`); a missing
229
+ model or missing language metadata raises `ApiError` instead.
218
230
  See [supported HTTP endpoints and server prerequisites](compatibility.md#speech-http-discovery).
219
231
 
220
232
  ### Speech-specific configuration
221
233
 
222
- Avartha TTS returns PCM and defaults to `pcm_24000`. Select an `output_format`
223
- supported by your model. Write a WAV header with the corresponding sample rate
224
- or encode the PCM yourself; the SDK does not convert audio formats.
234
+ Avartha TTS defaults to `pcm_24000`, unlike ElevenLabs' MP3 default. The
235
+ runtime converts to the selected `output_format`: raw PCM at 8 to 48 kHz, MP3,
236
+ or G.711 `ulaw_8000` and `alaw_8000`. See
237
+ [output formats](compatibility.md#output-formats-timeouts-and-timestamps).
238
+ Add a WAV header to PCM for a WAV file; the SDK returns the bytes unchanged.
239
+ `inactivity_timeout` (1 to 180 seconds) sets how long a context waits for more
240
+ text; the runtime default is 20 seconds.
225
241
  Single-context and multi-context TTS always use `auto_mode=true`.
226
242
  `auto_mode=False` and `default_mode` are unsupported.
227
243
 
@@ -248,8 +264,17 @@ transcripts. Handlers can be ordinary functions or async functions.
248
264
  ASR events retain their names and raw dictionary payloads, including the
249
265
  deprecated `UNACCEPTED_TERMS_ERROR` callback alias.
250
266
 
251
- `previous_text` supplies optional text context for transcription. When omitted,
252
- Avartha sends `null`, meaning no context. Audio-send code can omit the field:
267
+ Current ASR models require raw 16 kHz mono PCM16 samples without a file header.
268
+ For audio chunks, select `AudioFormat.PCM_16000` and `sample_rate=16000`, and
269
+ convert other formats or sample rates before sending. The SDK does not
270
+ resample chunks or convert their encoding. URL mode uses FFmpeg to convert the
271
+ source to the required format and requires FFmpeg on `PATH`.
272
+
273
+ Nonempty `previous_text` is unsupported by current ASR models. The SDK
274
+ preserves this protocol field, but the server rejects nonempty values rather
275
+ than using them as context. Omission, `None`, or an empty string supplies no
276
+ context. Use `keyterms` in the connection options for vocabulary hints on
277
+ supported models. Audio-send code can omit `previous_text`; the SDK sends `null`:
253
278
 
254
279
  ```python
255
280
  async def send_audio(connection, encoded_chunk):
@@ -269,6 +294,106 @@ In an application or notebook with a running event loop, await the workflow
269
294
  directly instead of calling `asyncio.run()`. Close the live session before
270
295
  leaving the client context; closing the client only closes its HTTP transports.
271
296
 
297
+ #### Recognition and context hints
298
+
299
+ Pass options to `realtime.connect()` using `RealtimeAudioOptions` for audio
300
+ chunks or `RealtimeUrlOptions` for an audio URL. The SDK forwards these settings;
301
+ the selected model and server must support them.
302
+
303
+ `filter_background_audio=True` enables experimental background speech filtering
304
+ on supported models. Use it to reduce transcription of background speakers.
305
+ It defaults to off and is separate from microphone echo cancellation.
306
+
307
+ Use `keyterms=["Avartha", "Kubernetes"]` for vocabulary hints on models that
308
+ support them. The SDK sends each term as a separate query parameter and handles
309
+ URL encoding. Hints do not guarantee a spelling and are not a free-form prompt.
310
+ Up to 16 terms and 40 words in total are accepted; the server also limits their
311
+ combined tokens, as described under
312
+ [vocabulary hints](compatibility.md#vocabulary-hints-and-language).
313
+ `language_code` hints the spoken language, such as `"en"` or `"en-US"`; omit it
314
+ for automatic detection. A hint does not guarantee a different transcript. Use
315
+ `speech_to_text.languages.list(model_id=...)` to check language support.
316
+
317
+ #### Ending an utterance
318
+
319
+ `commit_strategy=CommitStrategy.MANUAL` is the default. Send audio, then call
320
+ `await connection.commit()` when your application decides the utterance is
321
+ complete. This waits for the send, not the transcript: wait for
322
+ `RealtimeEvents.COMMITTED_TRANSCRIPT` before treating transcription as complete.
323
+ Do not commit an empty audio buffer as a completion check.
324
+
325
+ For automatic commits, use `commit_strategy=CommitStrategy.VAD`. Without
326
+ `turn_model`, or with `turn_model="silence"`, a turn ends after
327
+ `vad_silence_threshold_secs` of silence (1 second by default). Tune
328
+ `vad_threshold` for speech detection sensitivity. VAD controls require VAD mode;
329
+ the SDK raises `ValueError` if you pass them in manual mode.
330
+
331
+ Semantic turn detection uses an end-of-turn model to judge whether the speaker
332
+ has finished, so a hesitation need not end the utterance. Shipped Qwen3-ASR
333
+ deployments load `turn_model="turn_eot_t3_v1"`, with a `turn_threshold`
334
+ default of `0.79`. `turn_model="smart_turn_v3"` (default threshold `0.5`)
335
+ requires a deployment that loads it; the server refuses a model it has not loaded.
336
+ The threshold must be strictly between `0` and `1` and needs a semantic model.
337
+ Sustained silence still ends the turn after `vad_silence_threshold_secs`, which
338
+ defaults to 2 seconds with either semantic model. For example, inside an async
339
+ client context:
340
+
341
+ ```python
342
+ from avartha import AudioFormat, CommitStrategy, RealtimeAudioOptions
343
+
344
+ options = RealtimeAudioOptions(
345
+ model_id="YOUR_ASR_MODEL_ID",
346
+ audio_format=AudioFormat.PCM_16000,
347
+ sample_rate=16000,
348
+ commit_strategy=CommitStrategy.VAD,
349
+ turn_model="turn_eot_t3_v1",
350
+ turn_threshold=0.79,
351
+ )
352
+ connection = await client.speech_to_text.realtime.connect(options)
353
+ ```
354
+
355
+ `await connection.commit()` also works in VAD mode and skips the remaining
356
+ silence wait. Final decoding and delivery still take time after a commit.
357
+ See [turn detection](compatibility.md#turn-detection) for every range.
358
+
359
+ #### Transcript details
360
+
361
+ `include_logprobs=True` requests word log probabilities in final transcripts.
362
+ These are model scores, not calibrated confidence percentages. This option does
363
+ not enable timestamps. `include_timestamps=True` requests a separate
364
+ `RealtimeEvents.COMMITTED_TRANSCRIPT_WITH_TIMESTAMPS` event after the plain
365
+ committed transcript. Use it to enrich the same utterance, not append a duplicate.
366
+
367
+ `diarize=True` requests speaker labels and requires `include_timestamps=True`.
368
+ On supported models, timed `words` entries can include `speaker_id` alongside
369
+ `start` and `end`. Speaker labels may be absent if diarization fails; timestamps
370
+ can still be returned. These three options default to off. For a model and
371
+ language that support the requested details:
372
+
373
+ Add `include_timestamps=True`, `diarize=True`, and `include_logprobs=True` to
374
+ the `RealtimeAudioOptions` above before connecting. Omit options you do not need.
375
+
376
+ Register handlers before sending audio. Callbacks receive the unmodified server
377
+ dictionary, including word scores, timestamps, and speaker labels:
378
+
379
+ ```python
380
+ from avartha import RealtimeEvents
381
+
382
+ connection.on(RealtimeEvents.COMMITTED_TRANSCRIPT, lambda event: print(event["text"]))
383
+ connection.on(
384
+ RealtimeEvents.COMMITTED_TRANSCRIPT_WITH_TIMESTAMPS,
385
+ lambda event: print(event.get("words", [])),
386
+ )
387
+ connection.on(RealtimeEvents.WARNING, lambda event: print("Warning:", event))
388
+ connection.on(RealtimeEvents.ERROR, lambda event: print("Error:", event))
389
+ ```
390
+
391
+ If timing cannot be produced, the server can send a `WARNING` instead of the
392
+ timed event. Retain the plain committed transcript. Warnings do not trigger the
393
+ `ERROR` callback or close the SDK connection. When waiting for optional metadata,
394
+ handle both the timed event and the warning, and use an application timeout.
395
+ Do not close immediately after the plain final if you still need its metadata.
396
+
272
397
  ## Configuration
273
398
 
274
399
  | Setting | Avartha behavior |