avartha-python-sdk 0.0.1__tar.gz → 0.0.2__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.
- avartha_python_sdk-0.0.2/.github/workflows/ci.yml +102 -0
- avartha_python_sdk-0.0.2/.github/workflows/preview-behavior.yml +80 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/.github/workflows/publish.yml +11 -4
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/.gitignore +2 -0
- avartha_python_sdk-0.0.2/CONTRIBUTING.md +62 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/MANIFEST.in +3 -1
- avartha_python_sdk-0.0.2/Makefile +30 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/PKG-INFO +48 -39
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/README.md +45 -34
- avartha_python_sdk-0.0.2/THIRD_PARTY_NOTICES +241 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/report.md +7 -0
- avartha_python_sdk-0.0.2/docs/compatibility.md +368 -0
- avartha_python_sdk-0.0.2/docs/migration.md +272 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/platform.md +4 -3
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/preview-testing.md +33 -15
- avartha_python_sdk-0.0.2/docs/tts-reception-validation.md +78 -0
- avartha_python_sdk-0.0.2/docs/websocket-behavior.md +133 -0
- avartha_python_sdk-0.0.2/docs/websocket-fuzz.md +105 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/examples/realtime_asr.py +1 -4
- avartha_python_sdk-0.0.2/examples/tts.py +62 -0
- avartha_python_sdk-0.0.2/examples/tts_multi_context.py +63 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/pyproject.toml +6 -9
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/scripts/audit/catalog.py +17 -26
- avartha_python_sdk-0.0.2/scripts/freeze_realtime_types.py +157 -0
- avartha_python_sdk-0.0.2/scripts/preview_behavior.py +1244 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/scripts/preview_smoke.py +33 -30
- avartha_python_sdk-0.0.2/src/avartha/__init__.py +96 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/src/avartha/_config.py +25 -15
- avartha_python_sdk-0.0.2/src/avartha/_exceptions.py +46 -0
- avartha_python_sdk-0.0.2/src/avartha/_models.py +187 -0
- avartha_python_sdk-0.0.2/src/avartha/_openai_http.py +284 -0
- avartha_python_sdk-0.0.2/src/avartha/_openai_http_errors.py +82 -0
- avartha_python_sdk-0.0.2/src/avartha/_pacing.py +54 -0
- avartha_python_sdk-0.0.2/src/avartha/_realtime_asr.py +318 -0
- avartha_python_sdk-0.0.2/src/avartha/_realtime_openai.py +640 -0
- avartha_python_sdk-0.0.2/src/avartha/_realtime_resources.py +210 -0
- avartha_python_sdk-0.0.2/src/avartha/_realtime_tts.py +833 -0
- avartha_python_sdk-0.0.2/src/avartha/_sentinels.py +25 -0
- avartha_python_sdk-0.0.2/src/avartha/_speech_config.py +74 -0
- avartha_python_sdk-0.0.2/src/avartha/_speech_http.py +291 -0
- avartha_python_sdk-0.0.2/src/avartha/_speech_resources.py +478 -0
- avartha_python_sdk-0.0.2/src/avartha/_unsupported.py +20 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/src/avartha/_version.py +3 -3
- avartha_python_sdk-0.0.2/src/avartha/_websocket.py +22 -0
- avartha_python_sdk-0.0.2/src/avartha/_ws_state.py +149 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/src/avartha/client.py +0 -12
- avartha_python_sdk-0.0.2/src/avartha/conversational_ai/__init__.py +5 -0
- avartha_python_sdk-0.0.2/src/avartha/elevenlabs.py +160 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/src/avartha/errors.py +1 -1
- avartha_python_sdk-0.0.2/src/avartha/openai.py +339 -0
- avartha_python_sdk-0.0.2/src/avartha/pagination.py +54 -0
- avartha_python_sdk-0.0.2/src/avartha/realtime/__init__.py +31 -0
- avartha_python_sdk-0.0.2/src/avartha/realtime/speech.py +31 -0
- avartha_python_sdk-0.0.2/src/avartha/resources/__init__.py +1 -0
- avartha_python_sdk-0.0.2/src/avartha/resources/models.py +201 -0
- avartha_python_sdk-0.0.2/src/avartha/resources/realtime/__init__.py +19 -0
- avartha_python_sdk-0.0.2/src/avartha/resources/realtime/realtime.py +37 -0
- avartha_python_sdk-0.0.2/src/avartha/types/__init__.py +4 -0
- avartha_python_sdk-0.0.2/src/avartha/types/audio/__init__.py +3 -0
- avartha_python_sdk-0.0.2/src/avartha/types/audio/transcription_language.py +9 -0
- avartha_python_sdk-0.0.2/src/avartha/types/model.py +13 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/__init__.py +305 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/audio_transcription.py +29 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/audio_transcription_param.py +32 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_created_event.py +18 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item.py +40 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_added.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_create_event.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_create_event_param.py +18 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_created_event.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_delete_event.py +13 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_delete_event_param.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_deleted_event.py +13 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_done.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_input_audio_transcription_completed_event.py +47 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_input_audio_transcription_delta_event.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_input_audio_transcription_failed_event.py +22 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_input_audio_transcription_segment.py +19 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_param.py +42 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_retrieve_event.py +13 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_retrieve_event_param.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_truncate_event.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_truncate_event_param.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/conversation_item_truncated_event.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/input_audio_buffer_append_event.py +13 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/input_audio_buffer_append_event_param.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/input_audio_buffer_clear_event.py +12 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/input_audio_buffer_clear_event_param.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/input_audio_buffer_cleared_event.py +12 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/input_audio_buffer_commit_event.py +12 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/input_audio_buffer_commit_event_param.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/input_audio_buffer_committed_event.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/input_audio_buffer_dtmf_event_received_event.py +13 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/input_audio_buffer_speech_started_event.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/input_audio_buffer_speech_stopped_event.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/input_audio_buffer_timeout_triggered.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/log_prob_properties.py +11 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/mcp_list_tools_completed.py +13 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/mcp_list_tools_failed.py +13 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/mcp_list_tools_in_progress.py +13 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/noise_reduction_type.py +6 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/output_audio_buffer_clear_event.py +12 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/output_audio_buffer_clear_event_param.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/rate_limits_updated_event.py +20 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_audio_config.py +12 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_audio_config_input.py +22 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_audio_config_input_param.py +25 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_audio_config_output.py +27 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_audio_config_output_param.py +30 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_audio_config_param.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_audio_formats.py +25 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_audio_formats_param.py +25 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_audio_input_turn_detection.py +29 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_audio_input_turn_detection_param.py +29 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_client_event.py +34 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_client_event_param.py +48 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_conversation_item_assistant_message.py +23 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_conversation_item_assistant_message_param.py +26 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_conversation_item_function_call.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_conversation_item_function_call_output.py +16 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_conversation_item_function_call_output_param.py +18 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_conversation_item_function_call_param.py +19 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_conversation_item_system_message.py +21 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_conversation_item_system_message_param.py +24 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_conversation_item_user_message.py +25 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_conversation_item_user_message_param.py +28 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_error.py +13 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_error_event.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_function_tool.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_function_tool_param.py +16 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_mcp_approval_request.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_mcp_approval_request_param.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_mcp_approval_response.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_mcp_approval_response_param.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_mcp_list_tools.py +21 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_mcp_list_tools_param.py +24 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_mcp_protocol_error.py +13 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_mcp_protocol_error_param.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_mcp_tool_call.py +25 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_mcp_tool_call_param.py +29 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_mcp_tool_execution_error.py +12 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_mcp_tool_execution_error_param.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_mcphttp_error.py +13 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_mcphttp_error_param.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_reasoning.py +10 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_reasoning_effort.py +6 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_reasoning_param.py +13 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_response.py +41 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_response_create_audio_output.py +30 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_response_create_audio_output_param.py +33 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_response_create_mcp_tool.py +70 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_response_create_mcp_tool_param.py +69 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_response_create_params.py +36 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_response_create_params_param.py +42 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_response_status.py +20 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_response_usage.py +19 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_response_usage_input_token_details.py +19 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_response_usage_output_token_details.py +10 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_server_event.py +157 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_session_create_request.py +55 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_session_create_request_param.py +57 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_tool_choice_config.py +10 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_tool_choice_config_param.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_tools_config.py +8 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_tools_config_param.py +78 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_tools_config_union.py +77 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_tracing_config.py +16 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_tracing_config_param.py +18 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_transcription_session_audio.py +12 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_transcription_session_audio_input.py +22 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_transcription_session_audio_input_param.py +25 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_transcription_session_audio_input_turn_detection.py +29 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_transcription_session_audio_input_turn_detection_param.py +29 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_transcription_session_audio_param.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_transcription_session_create_request.py +16 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_transcription_session_create_request_param.py +19 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_truncation.py +10 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_truncation_param.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_truncation_retention_ratio.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/realtime_truncation_retention_ratio_param.py +19 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_audio_delta_event.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_audio_done_event.py +16 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_audio_transcript_delta_event.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_audio_transcript_done_event.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_cancel_event.py +13 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_cancel_event_param.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_content_part_added_event.py +24 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_content_part_done_event.py +24 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_create_event.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_create_event_param.py +19 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_created_event.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_done_event.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_function_call_arguments_delta_event.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_function_call_arguments_done_event.py +18 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_mcp_call_arguments_delta.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_mcp_call_arguments_done.py +16 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_mcp_call_completed.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_mcp_call_failed.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_mcp_call_in_progress.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_output_item_added_event.py +16 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_output_item_done_event.py +16 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_text_delta_event.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/response_text_done_event.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/session_created_event.py +18 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/session_update_event.py +18 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/session_update_event_param.py +25 -0
- avartha_python_sdk-0.0.2/src/avartha/types/realtime/session_updated_event.py +18 -0
- avartha_python_sdk-0.0.2/src/avartha/types/responses/__init__.py +16 -0
- avartha_python_sdk-0.0.2/src/avartha/types/responses/image_detail.py +6 -0
- avartha_python_sdk-0.0.2/src/avartha/types/responses/response_input_file.py +21 -0
- avartha_python_sdk-0.0.2/src/avartha/types/responses/response_input_file_param.py +23 -0
- avartha_python_sdk-0.0.2/src/avartha/types/responses/response_input_image.py +20 -0
- avartha_python_sdk-0.0.2/src/avartha/types/responses/response_input_image_param.py +23 -0
- avartha_python_sdk-0.0.2/src/avartha/types/responses/response_input_text.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/responses/response_input_text_param.py +19 -0
- avartha_python_sdk-0.0.2/src/avartha/types/responses/response_prompt.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/responses/response_prompt_param.py +22 -0
- avartha_python_sdk-0.0.2/src/avartha/types/responses/tool_choice_function.py +12 -0
- avartha_python_sdk-0.0.2/src/avartha/types/responses/tool_choice_function_param.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/responses/tool_choice_mcp.py +13 -0
- avartha_python_sdk-0.0.2/src/avartha/types/responses/tool_choice_mcp_param.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/responses/tool_choice_options.py +6 -0
- avartha_python_sdk-0.0.2/src/avartha/types/shared/__init__.py +3 -0
- avartha_python_sdk-0.0.2/src/avartha/types/shared/metadata.py +6 -0
- avartha_python_sdk-0.0.2/src/avartha/types/shared_params/__init__.py +3 -0
- avartha_python_sdk-0.0.2/src/avartha/types/shared_params/metadata.py +8 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/__init__.py +50 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/alignment.py +25 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/audio_output_multi.py +26 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/close_context.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/close_socket.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/final_output_multi.py +20 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/fine_tuning_response.py +31 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/fine_tuning_response_state_value.py +8 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/flush_context.py +16 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/generation_config.py +14 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/get_voices_response.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/get_voices_v_2_response.py +18 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/initialize_connection_multi.py +25 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/language_response.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/manual_verification_file_response.py +18 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/manual_verification_response.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/model.py +32 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/model_rates_response_model.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/normalized_alignment.py +25 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/output_format.py +20 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/pronunciation_dictionary_locator.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/reader_resource_response_model.py +18 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/reader_resource_response_model_resource_type.py +7 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/realtime_voice_settings.py +18 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/recording_response.py +18 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/review_status.py +8 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/send_text_multi.py +16 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/speaker_response_model.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/speaker_separation_response_model.py +22 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/speaker_separation_response_model_status.py +7 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/utterance_response_model.py +15 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/verification_attempt_response.py +20 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/verified_voice_language_response_model.py +18 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/voice.py +53 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/voice_category.py +8 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/voice_labelling_status.py +5 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/voice_recording_quality.py +7 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/voice_safety_control.py +7 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/voice_sample.py +26 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/voice_settings.py +18 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/voice_sharing_moderation_check_response_model.py +22 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/voice_sharing_response.py +53 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/voice_sharing_response_category.py +8 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/voice_sharing_state.py +7 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech/voice_verification_response.py +20 -0
- avartha_python_sdk-0.0.2/src/avartha/types/speech_language.py +17 -0
- avartha_python_sdk-0.0.2/src/avartha/types/websocket_connection_options.py +25 -0
- avartha_python_sdk-0.0.2/src/avartha/types/websocket_reconnection.py +26 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/src/avartha_python_sdk.egg-info/PKG-INFO +48 -39
- avartha_python_sdk-0.0.2/src/avartha_python_sdk.egg-info/SOURCES.txt +342 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/src/avartha_python_sdk.egg-info/requires.txt +1 -5
- avartha_python_sdk-0.0.2/tests/fixtures/elevenlabs-2.68.0.json +1542 -0
- avartha_python_sdk-0.0.2/tests/fixtures/openai/realtime.json +2791 -0
- avartha_python_sdk-0.0.2/tests/fixtures/openai-models-3.13.0.json +325 -0
- avartha_python_sdk-0.0.2/tests/fixtures/preview/constraints.txt +4 -0
- avartha_python_sdk-0.0.2/tests/fixtures/preview/contract.json +205 -0
- avartha_python_sdk-0.0.2/tests/fixtures/speech-contract.md +40 -0
- avartha_python_sdk-0.0.2/tests/fixtures/speech-http-2.68.0.json +1081 -0
- avartha_python_sdk-0.0.2/tests/test_clients.py +124 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/tests/test_fence.py +18 -0
- avartha_python_sdk-0.0.2/tests/test_openai_client.py +263 -0
- avartha_python_sdk-0.0.2/tests/test_openai_http.py +427 -0
- avartha_python_sdk-0.0.2/tests/test_owned_asr.py +353 -0
- avartha_python_sdk-0.0.2/tests/test_owned_contract.py +197 -0
- avartha_python_sdk-0.0.2/tests/test_pacing.py +42 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/tests/test_platform_e2e.py +28 -14
- avartha_python_sdk-0.0.2/tests/test_preview_behavior_runner.py +325 -0
- avartha_python_sdk-0.0.2/tests/test_preview_fuzz.py +183 -0
- avartha_python_sdk-0.0.2/tests/test_realtime_lifecycle.py +307 -0
- avartha_python_sdk-0.0.2/tests/test_realtime_model_discovery.py +253 -0
- avartha_python_sdk-0.0.2/tests/test_speech_contract.py +177 -0
- avartha_python_sdk-0.0.2/tests/test_speech_http.py +420 -0
- avartha_python_sdk-0.0.2/tests/test_tts_context_errors.py +188 -0
- avartha_python_sdk-0.0.2/tests/test_tts_iteration.py +199 -0
- avartha_python_sdk-0.0.2/tests/test_tts_reception.py +322 -0
- avartha_python_sdk-0.0.2/tests/test_tts_send_cancellation.py +431 -0
- avartha_python_sdk-0.0.2/tests/test_websockets.py +672 -0
- avartha_python_sdk-0.0.1/.github/workflows/ci.yml +0 -37
- avartha_python_sdk-0.0.1/CONTRIBUTING.md +0 -14
- avartha_python_sdk-0.0.1/Makefile +0 -17
- avartha_python_sdk-0.0.1/docs/compatibility.md +0 -112
- avartha_python_sdk-0.0.1/docs/migration.md +0 -192
- avartha_python_sdk-0.0.1/examples/agents.py +0 -66
- avartha_python_sdk-0.0.1/examples/chat.py +0 -28
- avartha_python_sdk-0.0.1/examples/conversation.py +0 -51
- avartha_python_sdk-0.0.1/examples/tts.py +0 -39
- avartha_python_sdk-0.0.1/src/avartha/__init__.py +0 -42
- avartha_python_sdk-0.0.1/src/avartha/_realtime_tts.py +0 -138
- avartha_python_sdk-0.0.1/src/avartha/conversational_ai/__init__.py +0 -19
- avartha_python_sdk-0.0.1/src/avartha/conversational_ai/conversation.py +0 -19
- avartha_python_sdk-0.0.1/src/avartha/conversational_ai/default_audio_interface.py +0 -5
- avartha_python_sdk-0.0.1/src/avartha/elevenlabs.py +0 -120
- avartha_python_sdk-0.0.1/src/avartha/openai.py +0 -106
- avartha_python_sdk-0.0.1/src/avartha_python_sdk.egg-info/SOURCES.txt +0 -78
- avartha_python_sdk-0.0.1/tests/test_clients.py +0 -325
- avartha_python_sdk-0.0.1/tests/test_websockets.py +0 -364
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/.github/CODEOWNERS +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/AGENTS.md +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/LICENSE +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/category-c-validation.md +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/findings.csv +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/findings.json +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/fuzz-coverage.csv +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/http-coverage.csv +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/http-results.json +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/invariants.json +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/inventory.csv +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/inventory.json +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/live-coverage.csv +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/live-results.json +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/source-fuzz-results.json +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/source-manifest.json +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/state-fuzz-results.json +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/summary.json +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/surface-matrix.csv +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/audit/wire-schema-results.json +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/github-policies.md +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/docs/preview-results.json +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/examples/endpoints.py +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/examples/realtime.py +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/scripts/audit/fetch_sources.py +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/scripts/audit/http_probe.py +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/scripts/audit/invariants.py +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/scripts/audit/probe.py +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/scripts/audit/report.py +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/scripts/audit/source_fuzz.py +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/scripts/audit/state_fuzz.py +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/scripts/audit/state_model.py +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/setup.cfg +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/setup.py +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/src/avartha/control.py +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/src/avartha/py.typed +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/src/avartha_python_sdk.egg-info/dependency_links.txt +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/src/avartha_python_sdk.egg-info/top_level.txt +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/tests/conftest.py +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/tests/test_control.py +0 -0
- {avartha_python_sdk-0.0.1 → avartha_python_sdk-0.0.2}/tests/test_websocket_urls.py +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
fuzz_seed:
|
|
9
|
+
description: Optional seed to replay speech HTTP and WebSocket fuzz inputs
|
|
10
|
+
type: string
|
|
11
|
+
default: ''
|
|
12
|
+
merge_group:
|
|
13
|
+
types: [checks_requested]
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
concurrency:
|
|
19
|
+
group: ci-${{ github.ref }}
|
|
20
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
check:
|
|
24
|
+
name: Python ${{ matrix.python }}
|
|
25
|
+
runs-on: ubuntu-24.04
|
|
26
|
+
timeout-minutes: 20
|
|
27
|
+
strategy:
|
|
28
|
+
fail-fast: false
|
|
29
|
+
matrix:
|
|
30
|
+
python: ['3.12', '3.13', '3.14']
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
33
|
+
with:
|
|
34
|
+
fetch-depth: 0 # setuptools_scm derives the version from git tags
|
|
35
|
+
fetch-tags: true
|
|
36
|
+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
|
37
|
+
with:
|
|
38
|
+
python-version: ${{ matrix.python }}
|
|
39
|
+
cache: pip
|
|
40
|
+
cache-dependency-path: pyproject.toml
|
|
41
|
+
- run: python -m pip install -e '.[dev]'
|
|
42
|
+
- name: Check SDK and local HTTP/WebSocket contracts
|
|
43
|
+
run: make check PYTEST_ARGS='--junitxml=artifacts/tests/results.xml'
|
|
44
|
+
- name: Upload test results
|
|
45
|
+
if: always()
|
|
46
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
47
|
+
with:
|
|
48
|
+
name: tests-python-${{ matrix.python }}
|
|
49
|
+
path: artifacts/tests/results.xml
|
|
50
|
+
if-no-files-found: warn
|
|
51
|
+
retention-days: 14
|
|
52
|
+
|
|
53
|
+
preview-fuzz:
|
|
54
|
+
name: Preview WebSocket compatibility fuzz
|
|
55
|
+
# Fork and Dependabot PRs cannot access repository secrets. Keep their
|
|
56
|
+
# offline checks above; never use pull_request_target to run PR code.
|
|
57
|
+
# Feature branches use the PR run so pushes don't duplicate live workloads.
|
|
58
|
+
if: >-
|
|
59
|
+
github.actor != 'dependabot[bot]' &&
|
|
60
|
+
(github.event_name != 'push' ||
|
|
61
|
+
github.ref == format('refs/heads/{0}', github.event.repository.default_branch)) &&
|
|
62
|
+
(github.event_name != 'pull_request' ||
|
|
63
|
+
github.event.pull_request.head.repo.full_name == github.repository)
|
|
64
|
+
runs-on: ubuntu-24.04
|
|
65
|
+
timeout-minutes: 40
|
|
66
|
+
concurrency:
|
|
67
|
+
group: preview-websocket-live
|
|
68
|
+
cancel-in-progress: false
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
71
|
+
with:
|
|
72
|
+
fetch-depth: 0
|
|
73
|
+
persist-credentials: false
|
|
74
|
+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
|
75
|
+
with:
|
|
76
|
+
python-version: '3.12'
|
|
77
|
+
cache: pip
|
|
78
|
+
cache-dependency-path: |
|
|
79
|
+
pyproject.toml
|
|
80
|
+
tests/fixtures/preview/constraints.txt
|
|
81
|
+
- run: python -m pip install -c tests/fixtures/preview/constraints.txt .
|
|
82
|
+
- name: Fuzz supported speech HTTP and WebSocket workflows
|
|
83
|
+
env:
|
|
84
|
+
AVARTHA_API_KEY: ${{ secrets.AVARTHA_API_KEY }}
|
|
85
|
+
FUZZ_SEED: ${{ inputs.fuzz_seed || github.run_id }}
|
|
86
|
+
run: >-
|
|
87
|
+
python scripts/preview_behavior.py
|
|
88
|
+
--fuzz-rounds 1 --fuzz-seed "$FUZZ_SEED"
|
|
89
|
+
--output artifacts/preview-fuzz
|
|
90
|
+
- name: Publish fuzz summary
|
|
91
|
+
if: always()
|
|
92
|
+
run: |
|
|
93
|
+
if [[ -f artifacts/preview-fuzz/summary.md ]]; then
|
|
94
|
+
cat artifacts/preview-fuzz/summary.md >> "$GITHUB_STEP_SUMMARY"
|
|
95
|
+
fi
|
|
96
|
+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
97
|
+
if: always()
|
|
98
|
+
with:
|
|
99
|
+
name: preview-websocket-fuzz-${{ github.run_id }}-${{ github.run_attempt }}
|
|
100
|
+
path: artifacts/preview-fuzz/
|
|
101
|
+
if-no-files-found: warn
|
|
102
|
+
retention-days: 14
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: Preview WebSocket behavior
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
scenario:
|
|
7
|
+
description: Optional exact scenario ID from the contract; empty runs all
|
|
8
|
+
type: string
|
|
9
|
+
default: ''
|
|
10
|
+
llm_model:
|
|
11
|
+
description: Optional text Realtime model; blank selects the first available
|
|
12
|
+
type: string
|
|
13
|
+
default: ''
|
|
14
|
+
tts_model:
|
|
15
|
+
description: Preview PCM24k TTS model
|
|
16
|
+
type: string
|
|
17
|
+
default: qwen/qwen3-tts-12hz-1.7b-base
|
|
18
|
+
asr_model:
|
|
19
|
+
description: Preview PCM16k ASR model
|
|
20
|
+
type: string
|
|
21
|
+
default: mistralai/voxtral-mini-4b-realtime-2602
|
|
22
|
+
voice:
|
|
23
|
+
description: Voice supported by the selected TTS model
|
|
24
|
+
type: string
|
|
25
|
+
default: carol
|
|
26
|
+
|
|
27
|
+
permissions:
|
|
28
|
+
contents: read
|
|
29
|
+
|
|
30
|
+
concurrency:
|
|
31
|
+
group: preview-websocket-live
|
|
32
|
+
cancel-in-progress: false
|
|
33
|
+
|
|
34
|
+
jobs:
|
|
35
|
+
behavior:
|
|
36
|
+
runs-on: ubuntu-24.04
|
|
37
|
+
timeout-minutes: 40
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
40
|
+
with:
|
|
41
|
+
fetch-depth: 0
|
|
42
|
+
persist-credentials: false
|
|
43
|
+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
|
44
|
+
with:
|
|
45
|
+
python-version: '3.12'
|
|
46
|
+
cache: pip
|
|
47
|
+
cache-dependency-path: |
|
|
48
|
+
pyproject.toml
|
|
49
|
+
tests/fixtures/preview/constraints.txt
|
|
50
|
+
- run: python -m pip install -c tests/fixtures/preview/constraints.txt .
|
|
51
|
+
- name: Exercise supported preview WebSocket behaviors
|
|
52
|
+
env:
|
|
53
|
+
AVARTHA_API_KEY: ${{ secrets.AVARTHA_API_KEY }}
|
|
54
|
+
SCENARIO: ${{ inputs.scenario }}
|
|
55
|
+
LLM_MODEL: ${{ inputs.llm_model }}
|
|
56
|
+
TTS_MODEL: ${{ inputs.tts_model }}
|
|
57
|
+
ASR_MODEL: ${{ inputs.asr_model }}
|
|
58
|
+
VOICE: ${{ inputs.voice }}
|
|
59
|
+
run: |
|
|
60
|
+
args=(--tts-model "$TTS_MODEL" --asr-model "$ASR_MODEL" --voice "$VOICE")
|
|
61
|
+
if [[ -n "$LLM_MODEL" ]]; then
|
|
62
|
+
args+=(--llm-model "$LLM_MODEL")
|
|
63
|
+
fi
|
|
64
|
+
if [[ -n "$SCENARIO" ]]; then
|
|
65
|
+
args+=(--scenario "$SCENARIO")
|
|
66
|
+
fi
|
|
67
|
+
python scripts/preview_behavior.py "${args[@]}"
|
|
68
|
+
- name: Publish behavioral summary
|
|
69
|
+
if: always()
|
|
70
|
+
run: |
|
|
71
|
+
if [[ -f artifacts/preview-behavior/summary.md ]]; then
|
|
72
|
+
cat artifacts/preview-behavior/summary.md >> "$GITHUB_STEP_SUMMARY"
|
|
73
|
+
fi
|
|
74
|
+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
75
|
+
if: always()
|
|
76
|
+
with:
|
|
77
|
+
name: preview-websocket-behavior
|
|
78
|
+
path: artifacts/preview-behavior/
|
|
79
|
+
if-no-files-found: warn
|
|
80
|
+
retention-days: 14
|
|
@@ -28,7 +28,7 @@ jobs:
|
|
|
28
28
|
python-version: '3.12'
|
|
29
29
|
cache: pip
|
|
30
30
|
cache-dependency-path: pyproject.toml
|
|
31
|
-
- run: python -m pip install --upgrade pip build twine
|
|
31
|
+
- run: python -m pip install --upgrade pip build twine "setuptools-scm>=8,<9"
|
|
32
32
|
- name: Verify version from tag
|
|
33
33
|
# Refuse to build off an untagged commit: setuptools_scm would guess the
|
|
34
34
|
# next version and we would publish a release nobody tagged.
|
|
@@ -53,10 +53,15 @@ jobs:
|
|
|
53
53
|
environment:
|
|
54
54
|
name: pypi
|
|
55
55
|
url: https://pypi.org/p/avartha-python-sdk
|
|
56
|
-
permissions:
|
|
57
|
-
# Required for Trusted Publishing; no API token is stored in this repo.
|
|
58
|
-
id-token: write
|
|
59
56
|
steps:
|
|
57
|
+
- name: Check PyPI token
|
|
58
|
+
env:
|
|
59
|
+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
60
|
+
run: |
|
|
61
|
+
if [ -z "$PYPI_API_TOKEN" ]; then
|
|
62
|
+
echo "::error::Set PYPI_API_TOKEN in the pypi environment before publishing."
|
|
63
|
+
exit 1
|
|
64
|
+
fi
|
|
60
65
|
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
|
61
66
|
with:
|
|
62
67
|
name: python-package-distributions
|
|
@@ -64,3 +69,5 @@ jobs:
|
|
|
64
69
|
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
|
|
65
70
|
with:
|
|
66
71
|
packages-dir: dist/
|
|
72
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
73
|
+
attestations: false
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Use Python 3.12+ and run `make install-dev` in a virtual environment.
|
|
4
|
+
`make format` applies formatting; `make check` runs lint, type checking, tests,
|
|
5
|
+
and wheel/source builds. Read AGENTS.md for compatibility rules.
|
|
6
|
+
|
|
7
|
+
Owned protocol primitives must preserve the frozen WebSocket behavior.
|
|
8
|
+
OpenAI and ElevenLabs compatibility is captured in protocol fixtures; neither
|
|
9
|
+
package is needed for development or runtime. Exercise new behavior with real
|
|
10
|
+
local WebSocket tests and those frozen contracts. OpenAI declarations are
|
|
11
|
+
maintained in this repository. To regenerate speech schemas, use
|
|
12
|
+
`make freeze-types FREEZE_ARGS=--elevenlabs-wheel=/path/to/elevenlabs-2.68.0-py3-none-any.whl`;
|
|
13
|
+
the tool reads declarations from that offline wheel without installing or
|
|
14
|
+
importing ElevenLabs. Review changes and third-party notices. Update the
|
|
15
|
+
compatibility matrix when platform support changes; SDK support is separate.
|
|
16
|
+
|
|
17
|
+
## WebSocket tests in GitHub Actions
|
|
18
|
+
|
|
19
|
+
The **CI** workflow runs `make check` on Python 3.12, 3.13, and 3.14 for every
|
|
20
|
+
push and pull request. Its **Check SDK and local WebSocket contracts** step
|
|
21
|
+
includes the real loopback socket tests and saves per-test JUnit results in
|
|
22
|
+
`tests-python-*` artifacts. These tests need no live credentials.
|
|
23
|
+
|
|
24
|
+
Run the full live preview suite on a specific branch with:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
gh workflow run preview-behavior.yml --ref YOUR_BRANCH
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The repository secret `AVARTHA_API_KEY` supplies credentials. The workflow fails
|
|
31
|
+
if any selected scenario fails, and publishes the scenario summary and JSON/JUnit
|
|
32
|
+
reports even on failure. See the [live contract](docs/websocket-behavior.md) for
|
|
33
|
+
its supported scenarios and limits.
|
|
34
|
+
|
|
35
|
+
## Publishing a release
|
|
36
|
+
|
|
37
|
+
Versions are derived from Git tags by `setuptools_scm`; a tag such as `v0.0.2`
|
|
38
|
+
produces package version `0.0.2`. Do not edit `pyproject.toml` or
|
|
39
|
+
`avartha.__version__` to set a release version.
|
|
40
|
+
|
|
41
|
+
Configure publishing once:
|
|
42
|
+
|
|
43
|
+
1. Create a PyPI API token scoped to the existing `avartha-python-sdk` project.
|
|
44
|
+
2. In the GitHub repository's Settings → Environments, create the `pypi`
|
|
45
|
+
environment and add an environment secret named `PYPI_API_TOKEN` containing
|
|
46
|
+
the token. Store the token only as a secret, never in repository files.
|
|
47
|
+
|
|
48
|
+
For each release:
|
|
49
|
+
|
|
50
|
+
1. Merge the release changes into `main` and wait for CI on Python 3.12, 3.13,
|
|
51
|
+
and 3.14 to pass. Run `make check` locally and review the wheel/source archive.
|
|
52
|
+
2. Create and publish a GitHub release with a new version tag targeting the
|
|
53
|
+
tested commit. For example, use `v0.0.2` for the release after `v0.0.1`.
|
|
54
|
+
3. Wait for **Publish Release to PyPI** to succeed, then verify installation
|
|
55
|
+
with `python -m pip install avartha-python-sdk==0.0.2`.
|
|
56
|
+
|
|
57
|
+
Publishing a GitHub release starts the workflow. Pushing a branch or tag alone
|
|
58
|
+
does not publish. Manual workflow runs must select a release tag; the build
|
|
59
|
+
requires its checked-out commit to have an exact tag. Each release must use a
|
|
60
|
+
new version because PyPI does not allow existing distribution files to be
|
|
61
|
+
replaced. The GitHub repository can remain private; uploaded PyPI artifacts
|
|
62
|
+
are public.
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
include LICENSE README.md CONTRIBUTING.md Makefile AGENTS.md
|
|
1
|
+
include LICENSE THIRD_PARTY_NOTICES README.md CONTRIBUTING.md Makefile AGENTS.md
|
|
2
2
|
recursive-include docs *.md *.json *.csv
|
|
3
3
|
recursive-include examples *.py
|
|
4
4
|
recursive-include tests *.py
|
|
5
|
+
recursive-include tests/fixtures *.json *.txt *.md
|
|
5
6
|
include .github/workflows/ci.yml
|
|
6
7
|
include .github/workflows/publish.yml
|
|
8
|
+
include .github/workflows/preview-behavior.yml
|
|
7
9
|
include setup.py
|
|
8
10
|
recursive-include scripts *.py
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
PYTHON ?= python
|
|
2
|
+
BUILD_FLAGS ?=
|
|
3
|
+
PREVIEW_ARGS ?=
|
|
4
|
+
FREEZE_ARGS ?=
|
|
5
|
+
PYTEST_ARGS ?=
|
|
6
|
+
.PHONY: install-dev lint format test test-preview test-preview-fuzz build check freeze-types
|
|
7
|
+
install-dev:
|
|
8
|
+
$(PYTHON) -m pip install -e '.[dev]'
|
|
9
|
+
lint:
|
|
10
|
+
$(PYTHON) -m ruff check .
|
|
11
|
+
$(PYTHON) -m ruff format --check .
|
|
12
|
+
$(PYTHON) -m mypy
|
|
13
|
+
format:
|
|
14
|
+
$(PYTHON) -m ruff check --fix .
|
|
15
|
+
$(PYTHON) -m ruff format .
|
|
16
|
+
test:
|
|
17
|
+
$(PYTHON) -m pytest $(PYTEST_ARGS)
|
|
18
|
+
test-preview:
|
|
19
|
+
$(PYTHON) scripts/preview_behavior.py $(PREVIEW_ARGS)
|
|
20
|
+
test-preview-fuzz:
|
|
21
|
+
$(PYTHON) scripts/preview_behavior.py --fuzz-rounds 1 $(PREVIEW_ARGS)
|
|
22
|
+
build:
|
|
23
|
+
$(PYTHON) -m build $(BUILD_FLAGS)
|
|
24
|
+
check: lint test build
|
|
25
|
+
|
|
26
|
+
freeze-types:
|
|
27
|
+
$(PYTHON) scripts/freeze_realtime_types.py $(FREEZE_ARGS)
|
|
28
|
+
$(PYTHON) -m ruff format src/avartha/types
|
|
29
|
+
$(PYTHON) -m ruff check --fix --ignore E501 src/avartha/types
|
|
30
|
+
$(PYTHON) -m ruff format src/avartha/types
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: avartha-python-sdk
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2
|
|
4
4
|
Summary: Python clients for Avartha inference, voice agents, and platform management
|
|
5
5
|
Author-email: "Avartha Inc." <team@avartha.ai>
|
|
6
6
|
License-Expression: LicenseRef-Avartha-Proprietary
|
|
@@ -17,13 +17,11 @@ Classifier: Typing :: Typed
|
|
|
17
17
|
Requires-Python: >=3.12
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
|
|
21
|
-
Requires-Dist: elevenlabs<2.69,>=2.68.0
|
|
20
|
+
License-File: THIRD_PARTY_NOTICES
|
|
22
21
|
Requires-Dist: httpx<0.29,>=0.28.1
|
|
23
22
|
Requires-Dist: websockets<16,>=15.0.1
|
|
24
23
|
Requires-Dist: pydantic<3,>=2.11
|
|
25
|
-
|
|
26
|
-
Requires-Dist: elevenlabs[pyaudio]<2.69,>=2.68.0; extra == "audio"
|
|
24
|
+
Requires-Dist: typing-extensions<5,>=4.12
|
|
27
25
|
Provides-Extra: dev
|
|
28
26
|
Requires-Dist: pytest<10,>=8; extra == "dev"
|
|
29
27
|
Requires-Dist: pytest-asyncio<2,>=1; extra == "dev"
|
|
@@ -35,6 +33,8 @@ Dynamic: license-file
|
|
|
35
33
|
|
|
36
34
|
# Avartha Python SDK
|
|
37
35
|
|
|
36
|
+
[](https://pypi.org/project/avartha-python-sdk/)
|
|
37
|
+
|
|
38
38
|
Synchronous and asynchronous Python clients for Avartha Realtime LLMs,
|
|
39
39
|
streaming speech, and platform management. Requires Python 3.12+.
|
|
40
40
|
|
|
@@ -54,8 +54,8 @@ the upstream resource methods, request types, response objects, and event loops:
|
|
|
54
54
|
|
|
55
55
|
These classes extend the official SDKs. Compatibility depends on the server's
|
|
56
56
|
supported endpoints. Avartha managed inference is **WebSocket-only**; legacy
|
|
57
|
-
Chat Completions, Responses, and HTTP speech calls are retired.
|
|
58
|
-
|
|
57
|
+
Chat Completions, Responses, and HTTP speech calls are retired. See the guides
|
|
58
|
+
below for compatibility details and historical test results.
|
|
59
59
|
[Migration details](docs/migration.md) · [Protocol audit and triage](docs/audit/report.md) · [Initial live test results](docs/preview-testing.md)
|
|
60
60
|
|
|
61
61
|
## Documentation
|
|
@@ -69,24 +69,24 @@ also found ASR and TTS mismatches with the official ElevenLabs client defaults.
|
|
|
69
69
|
|
|
70
70
|
## Installation
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
With GitHub access configured, install from source:
|
|
72
|
+
Install from [PyPI](https://pypi.org/project/avartha-python-sdk/):
|
|
74
73
|
|
|
75
74
|
```sh
|
|
76
|
-
|
|
77
|
-
python -m pip install ./avartha-python-sdk
|
|
75
|
+
python -m pip install avartha-python-sdk
|
|
78
76
|
```
|
|
79
77
|
|
|
80
|
-
Set your Avartha API key and platform root
|
|
78
|
+
Set your Avartha API key and platform root. Update `AVARTHA_BASE_URL` to match
|
|
79
|
+
your environment:
|
|
81
80
|
|
|
82
81
|
```sh
|
|
83
82
|
export AVARTHA_API_KEY='avk_...'
|
|
84
|
-
export AVARTHA_BASE_URL='https://platform.avartha.ai'
|
|
83
|
+
export AVARTHA_BASE_URL='https://platform.preview.avartha.ai'
|
|
85
84
|
```
|
|
86
85
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
Clients default to `https://platform.preview.avartha.ai` and the `serverless`
|
|
87
|
+
inference tier. Set `AVARTHA_BASE_URL` to use another platform root. Both protocol
|
|
88
|
+
clients derive their service URLs from this root. Use model and voice IDs from
|
|
89
|
+
the selected environment; vendor IDs are not mapped automatically.
|
|
90
90
|
|
|
91
91
|
## Usage
|
|
92
92
|
|
|
@@ -216,19 +216,21 @@ with ElevenLabs() as client:
|
|
|
216
216
|
output.writeframes(chunk)
|
|
217
217
|
```
|
|
218
218
|
|
|
219
|
-
|
|
220
|
-
`
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
outage. See [the diagnosis](docs/preview-testing.md#tts-vajra-rejects-official-client-defaults).
|
|
224
|
-
The example above preserves the vendor interface and requires that mismatch to
|
|
225
|
-
be resolved on the service.
|
|
219
|
+
Avartha's helper sends the gateway-compatible envelope and defaults to
|
|
220
|
+
`pcm_24000`. Use `AsyncElevenLabs` and `async for` for async TTS; `text` accepts
|
|
221
|
+
either a regular iterable or an async iterable. Run the
|
|
222
|
+
[TTS example](examples/tts.py) with `--async` to use that client.
|
|
226
223
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
224
|
+
For multiple utterances on one connection, use `connect_multi_context` on
|
|
225
|
+
either client. A background consumer can iterate over the session before contexts
|
|
226
|
+
are created and between turns; messages are keyed by `message.context_id`.
|
|
227
|
+
For a finite batch, create and flush contexts, then iterate over `session.drain()`.
|
|
228
|
+
Session iteration waits until the connection closes via `close_socket()` or when
|
|
229
|
+
its `with` or `async with` block exits. See the [multi-context example](examples/tts_multi_context.py)
|
|
230
|
+
and [TTS lifecycle details](docs/compatibility.md#realtime-tts).
|
|
231
|
+
|
|
232
|
+
HTTP `text_to_speech.stream` and `.convert` remain inherited methods but are not
|
|
233
|
+
supported by managed inference.
|
|
232
234
|
|
|
233
235
|
### Speech to text
|
|
234
236
|
|
|
@@ -241,11 +243,10 @@ transcript/error callbacks, streams chunks, commits, and closes the connection:
|
|
|
241
243
|
python examples/realtime_asr.py mistralai/voxtral-mini-4b-realtime-2602 speech-16k.wav
|
|
242
244
|
```
|
|
243
245
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
application option, not a change to the SDK's wire protocol.
|
|
246
|
+
`previous_text` is optional text context for transcription. When omitted from
|
|
247
|
+
`connection.send` data, the official SDK sends `null`, meaning no context.
|
|
248
|
+
Current preview accepts this default; existing audio-send code works unchanged,
|
|
249
|
+
with no empty-string workaround needed.
|
|
249
250
|
|
|
250
251
|
File-based HTTP `speech_to_text.convert` is retired on managed inference.
|
|
251
252
|
|
|
@@ -356,12 +357,13 @@ Control-plane writes are never retried automatically.
|
|
|
356
357
|
|
|
357
358
|
| Client | Meaning of explicit `base_url` |
|
|
358
359
|
| --- | --- |
|
|
359
|
-
| `OpenAI`, `AsyncOpenAI` | Full inference base: `https://platform.avartha.ai/inference/serverless/openai/v1` |
|
|
360
|
-
| `ElevenLabs`, `AsyncElevenLabs` | Dialect root before `/v1`: `https://platform.avartha.ai/inference/serverless/elevenlabs` |
|
|
361
|
-
| `Avartha`, `AsyncAvartha`, `Control`, `AsyncControl` | Platform root: `https://platform.avartha.ai` |
|
|
360
|
+
| `OpenAI`, `AsyncOpenAI` | Full inference base: `https://platform.preview.avartha.ai/inference/serverless/openai/v1` |
|
|
361
|
+
| `ElevenLabs`, `AsyncElevenLabs` | Dialect root before `/v1`: `https://platform.preview.avartha.ai/inference/serverless/elevenlabs` |
|
|
362
|
+
| `Avartha`, `AsyncAvartha`, `Control`, `AsyncControl` | Platform root: `https://platform.preview.avartha.ai` |
|
|
362
363
|
|
|
363
364
|
Without an explicit URL, protocol clients derive their URL from
|
|
364
|
-
`AVARTHA_BASE_URL
|
|
365
|
+
`AVARTHA_BASE_URL`, defaulting to `https://platform.preview.avartha.ai` and the
|
|
366
|
+
`serverless` tier. Set `tier="dedicated"` for dedicated inference; there is no
|
|
365
367
|
automatic fallback between tiers. An explicit protocol `base_url` takes
|
|
366
368
|
precedence over `tier`. `AVARTHA_ELEVENLABS_BASE_URL` overrides the derived speech
|
|
367
369
|
root, and an explicit ElevenLabs `base_url` overrides that environment variable.
|
|
@@ -398,10 +400,17 @@ scaling, routing, stopping, and deletion are described in the
|
|
|
398
400
|
|
|
399
401
|
## Examples and development
|
|
400
402
|
|
|
401
|
-
For local microphone/speaker support, install the `audio` extra
|
|
402
|
-
|
|
403
|
+
For local microphone/speaker support, install PortAudio and the `audio` extra:
|
|
404
|
+
|
|
405
|
+
```sh
|
|
406
|
+
python -m pip install 'avartha-python-sdk[audio]'
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
For development, clone the repository and run:
|
|
403
410
|
|
|
404
411
|
```sh
|
|
412
|
+
git clone https://github.com/avartha/avartha-python-sdk.git
|
|
413
|
+
cd avartha-python-sdk
|
|
405
414
|
python -m venv .venv
|
|
406
415
|
. .venv/bin/activate
|
|
407
416
|
make install-dev
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Avartha Python SDK
|
|
2
2
|
|
|
3
|
+
[](https://pypi.org/project/avartha-python-sdk/)
|
|
4
|
+
|
|
3
5
|
Synchronous and asynchronous Python clients for Avartha Realtime LLMs,
|
|
4
6
|
streaming speech, and platform management. Requires Python 3.12+.
|
|
5
7
|
|
|
@@ -19,8 +21,8 @@ the upstream resource methods, request types, response objects, and event loops:
|
|
|
19
21
|
|
|
20
22
|
These classes extend the official SDKs. Compatibility depends on the server's
|
|
21
23
|
supported endpoints. Avartha managed inference is **WebSocket-only**; legacy
|
|
22
|
-
Chat Completions, Responses, and HTTP speech calls are retired.
|
|
23
|
-
|
|
24
|
+
Chat Completions, Responses, and HTTP speech calls are retired. See the guides
|
|
25
|
+
below for compatibility details and historical test results.
|
|
24
26
|
[Migration details](docs/migration.md) · [Protocol audit and triage](docs/audit/report.md) · [Initial live test results](docs/preview-testing.md)
|
|
25
27
|
|
|
26
28
|
## Documentation
|
|
@@ -34,24 +36,24 @@ also found ASR and TTS mismatches with the official ElevenLabs client defaults.
|
|
|
34
36
|
|
|
35
37
|
## Installation
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
With GitHub access configured, install from source:
|
|
39
|
+
Install from [PyPI](https://pypi.org/project/avartha-python-sdk/):
|
|
39
40
|
|
|
40
41
|
```sh
|
|
41
|
-
|
|
42
|
-
python -m pip install ./avartha-python-sdk
|
|
42
|
+
python -m pip install avartha-python-sdk
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Set your Avartha API key and platform root
|
|
45
|
+
Set your Avartha API key and platform root. Update `AVARTHA_BASE_URL` to match
|
|
46
|
+
your environment:
|
|
46
47
|
|
|
47
48
|
```sh
|
|
48
49
|
export AVARTHA_API_KEY='avk_...'
|
|
49
|
-
export AVARTHA_BASE_URL='https://platform.avartha.ai'
|
|
50
|
+
export AVARTHA_BASE_URL='https://platform.preview.avartha.ai'
|
|
50
51
|
```
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
Clients default to `https://platform.preview.avartha.ai` and the `serverless`
|
|
54
|
+
inference tier. Set `AVARTHA_BASE_URL` to use another platform root. Both protocol
|
|
55
|
+
clients derive their service URLs from this root. Use model and voice IDs from
|
|
56
|
+
the selected environment; vendor IDs are not mapped automatically.
|
|
55
57
|
|
|
56
58
|
## Usage
|
|
57
59
|
|
|
@@ -181,19 +183,21 @@ with ElevenLabs() as client:
|
|
|
181
183
|
output.writeframes(chunk)
|
|
182
184
|
```
|
|
183
185
|
|
|
184
|
-
|
|
185
|
-
`
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
outage. See [the diagnosis](docs/preview-testing.md#tts-vajra-rejects-official-client-defaults).
|
|
189
|
-
The example above preserves the vendor interface and requires that mismatch to
|
|
190
|
-
be resolved on the service.
|
|
186
|
+
Avartha's helper sends the gateway-compatible envelope and defaults to
|
|
187
|
+
`pcm_24000`. Use `AsyncElevenLabs` and `async for` for async TTS; `text` accepts
|
|
188
|
+
either a regular iterable or an async iterable. Run the
|
|
189
|
+
[TTS example](examples/tts.py) with `--async` to use that client.
|
|
191
190
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
191
|
+
For multiple utterances on one connection, use `connect_multi_context` on
|
|
192
|
+
either client. A background consumer can iterate over the session before contexts
|
|
193
|
+
are created and between turns; messages are keyed by `message.context_id`.
|
|
194
|
+
For a finite batch, create and flush contexts, then iterate over `session.drain()`.
|
|
195
|
+
Session iteration waits until the connection closes via `close_socket()` or when
|
|
196
|
+
its `with` or `async with` block exits. See the [multi-context example](examples/tts_multi_context.py)
|
|
197
|
+
and [TTS lifecycle details](docs/compatibility.md#realtime-tts).
|
|
198
|
+
|
|
199
|
+
HTTP `text_to_speech.stream` and `.convert` remain inherited methods but are not
|
|
200
|
+
supported by managed inference.
|
|
197
201
|
|
|
198
202
|
### Speech to text
|
|
199
203
|
|
|
@@ -206,11 +210,10 @@ transcript/error callbacks, streams chunks, commits, and closes the connection:
|
|
|
206
210
|
python examples/realtime_asr.py mistralai/voxtral-mini-4b-realtime-2602 speech-16k.wav
|
|
207
211
|
```
|
|
208
212
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
application option, not a change to the SDK's wire protocol.
|
|
213
|
+
`previous_text` is optional text context for transcription. When omitted from
|
|
214
|
+
`connection.send` data, the official SDK sends `null`, meaning no context.
|
|
215
|
+
Current preview accepts this default; existing audio-send code works unchanged,
|
|
216
|
+
with no empty-string workaround needed.
|
|
214
217
|
|
|
215
218
|
File-based HTTP `speech_to_text.convert` is retired on managed inference.
|
|
216
219
|
|
|
@@ -321,12 +324,13 @@ Control-plane writes are never retried automatically.
|
|
|
321
324
|
|
|
322
325
|
| Client | Meaning of explicit `base_url` |
|
|
323
326
|
| --- | --- |
|
|
324
|
-
| `OpenAI`, `AsyncOpenAI` | Full inference base: `https://platform.avartha.ai/inference/serverless/openai/v1` |
|
|
325
|
-
| `ElevenLabs`, `AsyncElevenLabs` | Dialect root before `/v1`: `https://platform.avartha.ai/inference/serverless/elevenlabs` |
|
|
326
|
-
| `Avartha`, `AsyncAvartha`, `Control`, `AsyncControl` | Platform root: `https://platform.avartha.ai` |
|
|
327
|
+
| `OpenAI`, `AsyncOpenAI` | Full inference base: `https://platform.preview.avartha.ai/inference/serverless/openai/v1` |
|
|
328
|
+
| `ElevenLabs`, `AsyncElevenLabs` | Dialect root before `/v1`: `https://platform.preview.avartha.ai/inference/serverless/elevenlabs` |
|
|
329
|
+
| `Avartha`, `AsyncAvartha`, `Control`, `AsyncControl` | Platform root: `https://platform.preview.avartha.ai` |
|
|
327
330
|
|
|
328
331
|
Without an explicit URL, protocol clients derive their URL from
|
|
329
|
-
`AVARTHA_BASE_URL
|
|
332
|
+
`AVARTHA_BASE_URL`, defaulting to `https://platform.preview.avartha.ai` and the
|
|
333
|
+
`serverless` tier. Set `tier="dedicated"` for dedicated inference; there is no
|
|
330
334
|
automatic fallback between tiers. An explicit protocol `base_url` takes
|
|
331
335
|
precedence over `tier`. `AVARTHA_ELEVENLABS_BASE_URL` overrides the derived speech
|
|
332
336
|
root, and an explicit ElevenLabs `base_url` overrides that environment variable.
|
|
@@ -363,10 +367,17 @@ scaling, routing, stopping, and deletion are described in the
|
|
|
363
367
|
|
|
364
368
|
## Examples and development
|
|
365
369
|
|
|
366
|
-
For local microphone/speaker support, install the `audio` extra
|
|
367
|
-
|
|
370
|
+
For local microphone/speaker support, install PortAudio and the `audio` extra:
|
|
371
|
+
|
|
372
|
+
```sh
|
|
373
|
+
python -m pip install 'avartha-python-sdk[audio]'
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
For development, clone the repository and run:
|
|
368
377
|
|
|
369
378
|
```sh
|
|
379
|
+
git clone https://github.com/avartha/avartha-python-sdk.git
|
|
380
|
+
cd avartha-python-sdk
|
|
370
381
|
python -m venv .venv
|
|
371
382
|
. .venv/bin/activate
|
|
372
383
|
make install-dev
|