agora-agent-server-sdk 1.0.0__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.
- agora_agent_server_sdk-1.0.0/PKG-INFO +559 -0
- agora_agent_server_sdk-1.0.0/README.md +531 -0
- agora_agent_server_sdk-1.0.0/pyproject.toml +84 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/__init__.py +81 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agentkit/__init__.py +198 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agentkit/agent.py +562 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agentkit/agent_session.py +579 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agentkit/avatar_types.py +82 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agentkit/constants.py +55 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agentkit/token.py +312 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agentkit/vendors/__init__.py +80 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agentkit/vendors/avatar.py +85 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agentkit/vendors/base.py +93 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agentkit/vendors/llm.py +203 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agentkit/vendors/mllm.py +105 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agentkit/vendors/stt.py +272 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agentkit/vendors/tts.py +383 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/__init__.py +4 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/client.py +1030 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/raw_client.py +961 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/__init__.py +4 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/get_agents_response.py +51 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/get_agents_response_status.py +7 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/get_history_agents_response.py +39 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/get_history_agents_response_contents_item.py +31 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/get_history_agents_response_contents_item_role.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/interrupt_agents_response.py +33 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/list_agents_request_state.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/list_agents_response.py +35 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/list_agents_response_data.py +37 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/list_agents_response_data_list_item.py +34 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/list_agents_response_data_list_item_status.py +7 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/list_agents_response_meta.py +32 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/speak_agents_request_priority.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/speak_agents_response.py +33 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties.py +131 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_advanced_features.py +47 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_asr.py +47 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_asr_vendor.py +10 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_avatar.py +40 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_avatar_vendor.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_filler_words.py +41 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content.py +38 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_static_config.py +39 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_static_config_selection_rule.py +7 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_filler_words_trigger.py +38 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_filler_words_trigger_fixed_time_config.py +27 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_geofence.py +34 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_geofence_area.py +7 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_geofence_exclude_area.py +7 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_llm.py +110 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_llm_greeting_configs.py +32 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_llm_greeting_configs_mode.py +7 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_llm_mcp_servers_item.py +54 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_llm_style.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_mllm.py +74 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_mllm_vendor.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_parameters.py +58 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_parameters_data_channel.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_parameters_farewell_config.py +34 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_parameters_silence_config.py +44 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_parameters_silence_config_action.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_rtc.py +45 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_sal.py +42 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_sal_sal_mode.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_turn_detection.py +105 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config.py +47 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_end_of_speech.py +52 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_end_of_speech_mode.py +7 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_end_of_speech_semantic_config.py +25 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_end_of_speech_vad_config.py +24 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_start_of_speech.py +63 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_start_of_speech_disabled_config.py +34 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_start_of_speech_disabled_config_strategy.py +7 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_start_of_speech_keywords_config.py +26 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_start_of_speech_mode.py +7 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_config_start_of_speech_vad_config.py +26 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_eagerness.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_interrupt_mode.py +7 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_request_properties_turn_detection_type.py +7 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_response.py +41 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/start_agents_response_status.py +7 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/update_agents_request_properties.py +39 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/update_agents_request_properties_llm.py +32 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/update_agents_request_properties_mllm.py +27 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/update_agents_response.py +41 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/agents/types/update_agents_response_status.py +7 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/client.py +227 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/__init__.py +34 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/api_error.py +23 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/client_wrapper.py +114 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/datetime_utils.py +28 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/domain.py +204 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/file.py +67 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/force_multipart.py +18 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/http_client.py +543 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/http_response.py +55 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/http_sse/__init__.py +42 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/http_sse/_api.py +112 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/http_sse/_decoders.py +61 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/http_sse/_exceptions.py +7 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/http_sse/_models.py +17 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/jsonable_encoder.py +100 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/pagination.py +82 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/pydantic_utilities.py +260 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/query_encoder.py +58 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/remove_none_from_dict.py +11 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/request_options.py +35 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/serialization.py +276 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/core/unchecked_base_model.py +376 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/environment.py +7 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/__init__.py +4 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/client.py +589 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/raw_client.py +554 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/__init__.py +4 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/add_phone_numbers_request_inbound_config.py +27 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/add_phone_numbers_request_outbound_config.py +37 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/add_phone_numbers_request_provider.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/add_phone_numbers_response.py +49 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/add_phone_numbers_response_associated_pipeline.py +32 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/get_phone_numbers_response.py +62 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/get_phone_numbers_response_associated_pipeline.py +32 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/get_phone_numbers_response_provider.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/list_phone_numbers_response_item.py +62 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/list_phone_numbers_response_item_associated_pipeline.py +32 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/list_phone_numbers_response_item_provider.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/update_phone_numbers_request_inbound_config.py +27 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/update_phone_numbers_request_outbound_config.py +27 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/update_phone_numbers_response.py +62 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/update_phone_numbers_response_associated_pipeline.py +32 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/phone_numbers/types/update_phone_numbers_response_provider.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/pool_client.py +546 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/py.typed +0 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/__init__.py +4 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/client.py +554 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/raw_client.py +557 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/__init__.py +4 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/call_telephony_request_properties.py +44 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/call_telephony_request_sip.py +42 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/call_telephony_response.py +23 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/get_telephony_response.py +78 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/get_telephony_response_reason.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/get_telephony_response_state.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/get_telephony_response_type.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/hangup_telephony_response.py +18 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/list_telephony_request_type.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/list_telephony_response.py +35 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/list_telephony_response_data.py +37 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/list_telephony_response_data_list_item.py +69 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/list_telephony_response_data_list_item_state.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/list_telephony_response_data_list_item_type.py +5 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/telephony/types/list_telephony_response_meta.py +32 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/__init__.py +4 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/amazon_tts.py +29 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/amazon_tts_params.py +42 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/cartesia_tts.py +29 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/cartesia_tts_params.py +42 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/eleven_labs_tts.py +29 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/eleven_labs_tts_params.py +47 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/fish_audio_tts.py +29 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/fish_audio_tts_params.py +32 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/google_tts.py +29 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/google_tts_params.py +42 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/hume_ai_tts.py +29 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/hume_ai_tts_params.py +32 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/microsoft_tts.py +29 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/microsoft_tts_params.py +42 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/minimax_tts.py +29 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/minimax_tts_params.py +44 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/minimax_tts_params_voice_setting.py +23 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/murf_tts.py +29 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/murf_tts_params.py +37 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/open_ai_tts.py +29 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/open_ai_tts_params.py +37 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/rime_tts.py +29 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/rime_tts_params.py +37 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/sarvam_tts.py +29 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/sarvam_tts_params.py +37 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/types/tts.py +221 -0
- agora_agent_server_sdk-1.0.0/src/agora_agent/version.py +3 -0
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: agora-agent-server-sdk
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary:
|
|
5
|
+
Requires-Python: >=3.8,<4.0
|
|
6
|
+
Classifier: Intended Audience :: Developers
|
|
7
|
+
Classifier: Operating System :: MacOS
|
|
8
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Operating System :: POSIX
|
|
11
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
12
|
+
Classifier: Programming Language :: Python
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Dist: httpx (>=0.21.2)
|
|
22
|
+
Requires-Dist: pydantic (>=1.9.2)
|
|
23
|
+
Requires-Dist: pydantic-core (>=2.18.2)
|
|
24
|
+
Requires-Dist: typing_extensions (>=4.0.0)
|
|
25
|
+
Project-URL: Repository, https://github.com/AgoraIO-Conversational-AI/agent-server-sdk-python
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# Agora Agent Server SDK for Python
|
|
29
|
+
|
|
30
|
+
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FAgoraIO-Conversational-AI%2Fagent-server-sdk-python)
|
|
31
|
+
[](https://pypi.python.org/pypi/agent-server-sdk-python)
|
|
32
|
+
|
|
33
|
+
The Agora Conversational AI SDK provides convenient access to the Agora Conversational AI APIs,
|
|
34
|
+
enabling you to build voice-powered AI agents with support for both cascading flows (ASR -> LLM -> TTS)
|
|
35
|
+
and multimodal flows (MLLM) for real-time audio processing.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## Table of Contents
|
|
39
|
+
|
|
40
|
+
- [Installation](#installation)
|
|
41
|
+
- [Quick Start](#quick-start)
|
|
42
|
+
- [Documentation](#documentation)
|
|
43
|
+
- [Reference](#reference)
|
|
44
|
+
- [Mllm Flow Multimodal](#mllm-flow-multimodal)
|
|
45
|
+
- [Mllm Flow Multimodal](#mllm-flow-multimodal)
|
|
46
|
+
- [Usage](#usage)
|
|
47
|
+
- [Async Client](#async-client)
|
|
48
|
+
- [Exception Handling](#exception-handling)
|
|
49
|
+
- [Pagination](#pagination)
|
|
50
|
+
- [Advanced](#advanced)
|
|
51
|
+
- [Access Raw Response Data](#access-raw-response-data)
|
|
52
|
+
- [Retries](#retries)
|
|
53
|
+
- [Timeouts](#timeouts)
|
|
54
|
+
- [Custom Client](#custom-client)
|
|
55
|
+
- [Contributing](#contributing)
|
|
56
|
+
|
|
57
|
+
## Installation
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
pip install agent-server-sdk-python
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Quick Start
|
|
64
|
+
|
|
65
|
+
Use the **builder pattern** with `Agent` and `AgentSession`. The SDK auto-generates all required tokens:
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
from agora_agent import Agora, Area
|
|
69
|
+
from agora_agent.agentkit import Agent, expires_in_hours
|
|
70
|
+
from agora_agent.agentkit.vendors import OpenAI, ElevenLabsTTS, DeepgramSTT
|
|
71
|
+
|
|
72
|
+
client = Agora(
|
|
73
|
+
area=Area.US,
|
|
74
|
+
app_id="your-app-id",
|
|
75
|
+
app_certificate="your-app-certificate",
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
agent = (
|
|
79
|
+
Agent(name="support-assistant", instructions="You are a helpful voice assistant.")
|
|
80
|
+
# Create Agent: STT → LLM → TTS → (optional) Avatar
|
|
81
|
+
.with_stt(DeepgramSTT(api_key="your-deepgram-key", language="en-US"))
|
|
82
|
+
.with_llm(OpenAI(api_key="your-openai-key", model="gpt-4o-mini"))
|
|
83
|
+
.with_tts(ElevenLabsTTS(key="your-elevenlabs-key", model_id="eleven_flash_v2_5", voice_id="your-voice-id", sample_rate=24000))
|
|
84
|
+
# .with_avatar(HeyGenAvatar(...)) # optional
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
session = agent.create_session(
|
|
88
|
+
client,
|
|
89
|
+
channel="support-room-123",
|
|
90
|
+
agent_uid="1",
|
|
91
|
+
remote_uids=["100"],
|
|
92
|
+
expires_in=expires_in_hours(12), # optional — default is 24 h (Agora max)
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
# start() returns a session ID unique to this agent session
|
|
96
|
+
agent_session_id = session.start()
|
|
97
|
+
|
|
98
|
+
# In production, stop is typically called when your client signals the session has ended.
|
|
99
|
+
# Your server receives that request and calls session.stop().
|
|
100
|
+
session.stop()
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
For async usage, use `AsyncAgora` and `await session.start()`, etc. See [Quick Start](docs/getting-started/quick-start.md).
|
|
104
|
+
|
|
105
|
+
### Session lifecycle
|
|
106
|
+
|
|
107
|
+
`start()` joins the agent to the channel and returns a **session ID** — a unique identifier for this agent session. The session stays active until `stop()` is called.
|
|
108
|
+
|
|
109
|
+
There are two ways to stop a session depending on how your server is structured:
|
|
110
|
+
|
|
111
|
+
**Option 1 — Hold the session in memory:**
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
# start-session handler
|
|
115
|
+
agent_session_id = session.start() # unique ID for this session
|
|
116
|
+
# stop-session handler (same process, session still in scope)
|
|
117
|
+
session.stop()
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Option 2 — Store the session ID and stop by ID (stateless servers):**
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
# start-session handler: return session ID to your client app
|
|
124
|
+
agent_session_id = session.start()
|
|
125
|
+
# ... return agent_session_id to client ...
|
|
126
|
+
|
|
127
|
+
# stop-session handler: client sends back agent_session_id
|
|
128
|
+
client = Agora(area=Area.US, app_id="...", app_certificate="...")
|
|
129
|
+
client.stop_agent(agent_session_id)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Manual tokens (for debugging)
|
|
133
|
+
|
|
134
|
+
Generate tokens yourself and pass them in — useful when inspecting or reusing tokens:
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
from agora_agent import Agora, Area
|
|
138
|
+
from agora_agent.agentkit.token import generate_convo_ai_token, expires_in_hours
|
|
139
|
+
|
|
140
|
+
APP_ID = "your-app-id"
|
|
141
|
+
APP_CERT = "your-app-certificate"
|
|
142
|
+
CHANNEL = "support-room-123"
|
|
143
|
+
AGENT_UID = "1"
|
|
144
|
+
|
|
145
|
+
# Auth header token — used by the SDK to authenticate REST API calls
|
|
146
|
+
auth_token = generate_convo_ai_token(
|
|
147
|
+
app_id=APP_ID, app_certificate=APP_CERT,
|
|
148
|
+
channel_name=CHANNEL, account=AGENT_UID,
|
|
149
|
+
token_expire=expires_in_hours(12),
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
# Channel join token — embedded in the start request so the agent can join the channel
|
|
153
|
+
join_token = generate_convo_ai_token(
|
|
154
|
+
app_id=APP_ID, app_certificate=APP_CERT,
|
|
155
|
+
channel_name=CHANNEL, account=AGENT_UID,
|
|
156
|
+
token_expire=expires_in_hours(12),
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
client = Agora(
|
|
160
|
+
area=Area.US,
|
|
161
|
+
app_id=APP_ID,
|
|
162
|
+
app_certificate=APP_CERT,
|
|
163
|
+
auth_token=auth_token, # SDK sets Authorization: agora token=<auth_token>
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
session = agent.create_session(
|
|
167
|
+
client, channel=CHANNEL, agent_uid=AGENT_UID, remote_uids=["100"],
|
|
168
|
+
token=join_token, # channel join token
|
|
169
|
+
)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Documentation
|
|
173
|
+
|
|
174
|
+
API reference documentation is available [here](https://docs.agora.io/en/conversational-ai/overview).
|
|
175
|
+
|
|
176
|
+
## Reference
|
|
177
|
+
|
|
178
|
+
A full reference for this library is available [here](https://github.com/AgoraIO-Conversational-AI/agent-server-sdk-python/blob/HEAD/./reference.md).
|
|
179
|
+
|
|
180
|
+
## MLLM Flow (Multimodal)
|
|
181
|
+
|
|
182
|
+
For real-time audio processing using OpenAI's Realtime API or Google Gemini Live, use the MLLM (Multimodal Large Language Model) flow instead of the cascading ASR -> LLM -> TTS flow. See the [MLLM Overview](https://docs.agora.io/en/conversational-ai/models/mllm/overview) for more details.
|
|
183
|
+
|
|
184
|
+
```python
|
|
185
|
+
from agora_agent import Agora, Area
|
|
186
|
+
from agora_agent.agentkit import (
|
|
187
|
+
AdvancedFeatures,
|
|
188
|
+
TurnDetectionConfig,
|
|
189
|
+
TurnDetectionTypeValues,
|
|
190
|
+
)
|
|
191
|
+
from agora_agent.agents import (
|
|
192
|
+
StartAgentsRequestProperties,
|
|
193
|
+
StartAgentsRequestPropertiesMllm,
|
|
194
|
+
StartAgentsRequestPropertiesMllmVendor,
|
|
195
|
+
StartAgentsRequestPropertiesTts,
|
|
196
|
+
StartAgentsRequestPropertiesTtsVendor,
|
|
197
|
+
StartAgentsRequestPropertiesLlm,
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
client = Agora(
|
|
201
|
+
area=Area.US,
|
|
202
|
+
app_id="YOUR_APP_ID",
|
|
203
|
+
app_certificate="YOUR_APP_CERTIFICATE",
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
client.agents.start(
|
|
207
|
+
client.app_id,
|
|
208
|
+
name="mllm_agent",
|
|
209
|
+
properties=StartAgentsRequestProperties(
|
|
210
|
+
channel="channel_name",
|
|
211
|
+
token="your_token",
|
|
212
|
+
agent_rtc_uid="1001",
|
|
213
|
+
remote_rtc_uids=["1002"],
|
|
214
|
+
idle_timeout=120,
|
|
215
|
+
advanced_features=AdvancedFeatures(enable_mllm=True),
|
|
216
|
+
mllm=StartAgentsRequestPropertiesMllm(
|
|
217
|
+
url="wss://api.openai.com/v1/realtime",
|
|
218
|
+
api_key="<your_openai_api_key>",
|
|
219
|
+
vendor=StartAgentsRequestPropertiesMllmVendor.OPENAI,
|
|
220
|
+
params={
|
|
221
|
+
"model": "gpt-4o-realtime-preview",
|
|
222
|
+
"voice": "alloy",
|
|
223
|
+
},
|
|
224
|
+
input_modalities=["audio"],
|
|
225
|
+
output_modalities=["text", "audio"],
|
|
226
|
+
greeting_message="Hello! I'm ready to chat in real-time.",
|
|
227
|
+
),
|
|
228
|
+
turn_detection=TurnDetectionConfig(
|
|
229
|
+
type=TurnDetectionTypeValues.SERVER_VAD, # deprecated; use config.end_of_speech instead
|
|
230
|
+
threshold=0.5,
|
|
231
|
+
silence_duration_ms=500,
|
|
232
|
+
),
|
|
233
|
+
# TTS and LLM are still required but not used when MLLM is enabled
|
|
234
|
+
tts=StartAgentsRequestPropertiesTts(
|
|
235
|
+
vendor=StartAgentsRequestPropertiesTtsVendor.MICROSOFT,
|
|
236
|
+
params={},
|
|
237
|
+
),
|
|
238
|
+
llm=StartAgentsRequestPropertiesLlm(
|
|
239
|
+
url="https://api.openai.com/v1/chat/completions",
|
|
240
|
+
),
|
|
241
|
+
),
|
|
242
|
+
)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## MLLM Flow (Multimodal)
|
|
246
|
+
|
|
247
|
+
For real-time audio processing using OpenAI's Realtime API or Google Gemini Live, use the MLLM (Multimodal Large Language Model) flow instead of the cascading ASR -> LLM -> TTS flow. See the [MLLM Overview](https://docs.agora.io/en/conversational-ai/models/mllm/overview) for more details.
|
|
248
|
+
|
|
249
|
+
```python
|
|
250
|
+
from agora-agent-server-sdk import Agora
|
|
251
|
+
from agora-agent-server-sdk.agents import (
|
|
252
|
+
StartAgentsRequestProperties,
|
|
253
|
+
StartAgentsRequestPropertiesAdvancedFeatures,
|
|
254
|
+
StartAgentsRequestPropertiesMllm,
|
|
255
|
+
StartAgentsRequestPropertiesMllmVendor,
|
|
256
|
+
StartAgentsRequestPropertiesTts,
|
|
257
|
+
StartAgentsRequestPropertiesTtsVendor,
|
|
258
|
+
StartAgentsRequestPropertiesLlm,
|
|
259
|
+
StartAgentsRequestPropertiesTurnDetection,
|
|
260
|
+
StartAgentsRequestPropertiesTurnDetectionType,
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
client = Agora(
|
|
264
|
+
customer_id="YOUR_CUSTOMER_ID",
|
|
265
|
+
customer_secret="YOUR_CUSTOMER_SECRET",
|
|
266
|
+
)
|
|
267
|
+
|
|
268
|
+
client.agents.start(
|
|
269
|
+
appid="your_app_id",
|
|
270
|
+
name="mllm_agent",
|
|
271
|
+
properties=StartAgentsRequestProperties(
|
|
272
|
+
channel="channel_name",
|
|
273
|
+
token="your_token",
|
|
274
|
+
agent_rtc_uid="1001",
|
|
275
|
+
remote_rtc_uids=["1002"],
|
|
276
|
+
idle_timeout=120,
|
|
277
|
+
advanced_features=StartAgentsRequestPropertiesAdvancedFeatures(
|
|
278
|
+
enable_mllm=True,
|
|
279
|
+
),
|
|
280
|
+
mllm=StartAgentsRequestPropertiesMllm(
|
|
281
|
+
url="wss://api.openai.com/v1/realtime",
|
|
282
|
+
api_key="<your_openai_api_key>",
|
|
283
|
+
vendor=StartAgentsRequestPropertiesMllmVendor.OPENAI,
|
|
284
|
+
params={
|
|
285
|
+
"model": "gpt-4o-realtime-preview",
|
|
286
|
+
"voice": "alloy",
|
|
287
|
+
},
|
|
288
|
+
input_modalities=["audio"],
|
|
289
|
+
output_modalities=["text", "audio"],
|
|
290
|
+
greeting_message="Hello! I'm ready to chat in real-time.",
|
|
291
|
+
),
|
|
292
|
+
turn_detection=StartAgentsRequestPropertiesTurnDetection(
|
|
293
|
+
type=StartAgentsRequestPropertiesTurnDetectionType.SERVER_VAD,
|
|
294
|
+
threshold=0.5,
|
|
295
|
+
silence_duration_ms=500,
|
|
296
|
+
),
|
|
297
|
+
# TTS and LLM are still required but not used when MLLM is enabled
|
|
298
|
+
tts=StartAgentsRequestPropertiesTts(
|
|
299
|
+
vendor=StartAgentsRequestPropertiesTtsVendor.MICROSOFT,
|
|
300
|
+
params={},
|
|
301
|
+
),
|
|
302
|
+
llm=StartAgentsRequestPropertiesLlm(
|
|
303
|
+
url="https://api.openai.com/v1/chat/completions",
|
|
304
|
+
),
|
|
305
|
+
),
|
|
306
|
+
)
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
## Usage
|
|
311
|
+
|
|
312
|
+
Instantiate and use the client with the following:
|
|
313
|
+
|
|
314
|
+
```python
|
|
315
|
+
from agora_agent import Agora, MicrosoftTtsParams, Tts_Microsoft
|
|
316
|
+
from agora_agent.agents import (
|
|
317
|
+
StartAgentsRequestProperties,
|
|
318
|
+
StartAgentsRequestPropertiesAsr,
|
|
319
|
+
StartAgentsRequestPropertiesLlm,
|
|
320
|
+
)
|
|
321
|
+
|
|
322
|
+
client = Agora(
|
|
323
|
+
authorization="YOUR_AUTHORIZATION",
|
|
324
|
+
username="YOUR_USERNAME",
|
|
325
|
+
password="YOUR_PASSWORD",
|
|
326
|
+
)
|
|
327
|
+
client.agents.start(
|
|
328
|
+
appid="appid",
|
|
329
|
+
name="unique_name",
|
|
330
|
+
properties=StartAgentsRequestProperties(
|
|
331
|
+
channel="channel_name",
|
|
332
|
+
token="token",
|
|
333
|
+
agent_rtc_uid="1001",
|
|
334
|
+
remote_rtc_uids=["1002"],
|
|
335
|
+
idle_timeout=120,
|
|
336
|
+
asr=StartAgentsRequestPropertiesAsr(
|
|
337
|
+
language="en-US",
|
|
338
|
+
),
|
|
339
|
+
tts=Tts_Microsoft(
|
|
340
|
+
params=MicrosoftTtsParams(
|
|
341
|
+
key="key",
|
|
342
|
+
region="region",
|
|
343
|
+
voice_name="voice_name",
|
|
344
|
+
),
|
|
345
|
+
),
|
|
346
|
+
llm=StartAgentsRequestPropertiesLlm(
|
|
347
|
+
url="https://api.openai.com/v1/chat/completions",
|
|
348
|
+
api_key="<your_llm_key>",
|
|
349
|
+
system_messages=[
|
|
350
|
+
{"role": "system", "content": "You are a helpful chatbot."}
|
|
351
|
+
],
|
|
352
|
+
params={"model": "gpt-4o-mini"},
|
|
353
|
+
max_history=32,
|
|
354
|
+
greeting_message="Hello, how can I assist you today?",
|
|
355
|
+
failure_message="Please hold on a second.",
|
|
356
|
+
),
|
|
357
|
+
),
|
|
358
|
+
)
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
## Async Client
|
|
362
|
+
|
|
363
|
+
The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
|
|
364
|
+
|
|
365
|
+
```python
|
|
366
|
+
import asyncio
|
|
367
|
+
|
|
368
|
+
from agora_agent import AsyncAgora, MicrosoftTtsParams, Tts_Microsoft
|
|
369
|
+
from agora_agent.agents import (
|
|
370
|
+
StartAgentsRequestProperties,
|
|
371
|
+
StartAgentsRequestPropertiesAsr,
|
|
372
|
+
StartAgentsRequestPropertiesLlm,
|
|
373
|
+
)
|
|
374
|
+
|
|
375
|
+
client = AsyncAgora(
|
|
376
|
+
authorization="YOUR_AUTHORIZATION",
|
|
377
|
+
username="YOUR_USERNAME",
|
|
378
|
+
password="YOUR_PASSWORD",
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
async def main() -> None:
|
|
383
|
+
await client.agents.start(
|
|
384
|
+
appid="appid",
|
|
385
|
+
name="unique_name",
|
|
386
|
+
properties=StartAgentsRequestProperties(
|
|
387
|
+
channel="channel_name",
|
|
388
|
+
token="token",
|
|
389
|
+
agent_rtc_uid="1001",
|
|
390
|
+
remote_rtc_uids=["1002"],
|
|
391
|
+
idle_timeout=120,
|
|
392
|
+
asr=StartAgentsRequestPropertiesAsr(
|
|
393
|
+
language="en-US",
|
|
394
|
+
),
|
|
395
|
+
tts=Tts_Microsoft(
|
|
396
|
+
params=MicrosoftTtsParams(
|
|
397
|
+
key="key",
|
|
398
|
+
region="region",
|
|
399
|
+
voice_name="voice_name",
|
|
400
|
+
),
|
|
401
|
+
),
|
|
402
|
+
llm=StartAgentsRequestPropertiesLlm(
|
|
403
|
+
url="https://api.openai.com/v1/chat/completions",
|
|
404
|
+
api_key="<your_llm_key>",
|
|
405
|
+
system_messages=[
|
|
406
|
+
{"role": "system", "content": "You are a helpful chatbot."}
|
|
407
|
+
],
|
|
408
|
+
params={"model": "gpt-4o-mini"},
|
|
409
|
+
max_history=32,
|
|
410
|
+
greeting_message="Hello, how can I assist you today?",
|
|
411
|
+
failure_message="Please hold on a second.",
|
|
412
|
+
),
|
|
413
|
+
),
|
|
414
|
+
)
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
asyncio.run(main())
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
## Exception Handling
|
|
421
|
+
|
|
422
|
+
When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
|
|
423
|
+
will be thrown.
|
|
424
|
+
|
|
425
|
+
```python
|
|
426
|
+
from agora_agent.core.api_error import ApiError
|
|
427
|
+
|
|
428
|
+
try:
|
|
429
|
+
client.agents.start(...)
|
|
430
|
+
except ApiError as e:
|
|
431
|
+
print(e.status_code)
|
|
432
|
+
print(e.body)
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
## Pagination
|
|
436
|
+
|
|
437
|
+
Paginated requests will return a `SyncPager` or `AsyncPager`, which can be used as generators for the underlying object.
|
|
438
|
+
|
|
439
|
+
```python
|
|
440
|
+
from agora_agent import Agora
|
|
441
|
+
|
|
442
|
+
client = Agora(
|
|
443
|
+
authorization="YOUR_AUTHORIZATION",
|
|
444
|
+
username="YOUR_USERNAME",
|
|
445
|
+
password="YOUR_PASSWORD",
|
|
446
|
+
)
|
|
447
|
+
response = client.agents.list(
|
|
448
|
+
appid="appid",
|
|
449
|
+
)
|
|
450
|
+
for item in response:
|
|
451
|
+
yield item
|
|
452
|
+
# alternatively, you can paginate page-by-page
|
|
453
|
+
for page in response.iter_pages():
|
|
454
|
+
yield page
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
```python
|
|
458
|
+
# You can also iterate through pages and access the typed response per page
|
|
459
|
+
pager = client.agents.list(...)
|
|
460
|
+
for page in pager.iter_pages():
|
|
461
|
+
print(page.response) # access the typed response for each page
|
|
462
|
+
for item in page:
|
|
463
|
+
print(item)
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
## Advanced
|
|
467
|
+
|
|
468
|
+
### Access Raw Response Data
|
|
469
|
+
|
|
470
|
+
The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
|
|
471
|
+
The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
|
|
472
|
+
|
|
473
|
+
```python
|
|
474
|
+
from agora_agent import Agora
|
|
475
|
+
|
|
476
|
+
client = Agora(
|
|
477
|
+
...,
|
|
478
|
+
)
|
|
479
|
+
response = client.agents.with_raw_response.start(...)
|
|
480
|
+
print(response.headers) # access the response headers
|
|
481
|
+
print(response.data) # access the underlying object
|
|
482
|
+
pager = client.agents.list(...)
|
|
483
|
+
print(pager.response) # access the typed response for the first page
|
|
484
|
+
for item in pager:
|
|
485
|
+
print(item) # access the underlying object(s)
|
|
486
|
+
for page in pager.iter_pages():
|
|
487
|
+
print(page.response) # access the typed response for each page
|
|
488
|
+
for item in page:
|
|
489
|
+
print(item) # access the underlying object(s)
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
### Retries
|
|
493
|
+
|
|
494
|
+
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
|
|
495
|
+
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
|
|
496
|
+
retry limit (default: 2).
|
|
497
|
+
|
|
498
|
+
A request is deemed retryable when any of the following HTTP status codes is returned:
|
|
499
|
+
|
|
500
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
501
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
502
|
+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
|
|
503
|
+
|
|
504
|
+
Use the `max_retries` request option to configure this behavior.
|
|
505
|
+
|
|
506
|
+
```python
|
|
507
|
+
client.agents.start(..., request_options={
|
|
508
|
+
"max_retries": 1
|
|
509
|
+
})
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
### Timeouts
|
|
513
|
+
|
|
514
|
+
The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
|
|
515
|
+
|
|
516
|
+
```python
|
|
517
|
+
|
|
518
|
+
from agora_agent import Agora
|
|
519
|
+
|
|
520
|
+
client = Agora(
|
|
521
|
+
...,
|
|
522
|
+
timeout=20.0,
|
|
523
|
+
)
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
# Override timeout for a specific method
|
|
527
|
+
client.agents.start(..., request_options={
|
|
528
|
+
"timeout_in_seconds": 1
|
|
529
|
+
})
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
### Custom Client
|
|
533
|
+
|
|
534
|
+
You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
|
|
535
|
+
and transports.
|
|
536
|
+
|
|
537
|
+
```python
|
|
538
|
+
import httpx
|
|
539
|
+
from agora_agent import Agora
|
|
540
|
+
|
|
541
|
+
client = Agora(
|
|
542
|
+
...,
|
|
543
|
+
httpx_client=httpx.Client(
|
|
544
|
+
proxy="http://my.test.proxy.example.com",
|
|
545
|
+
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
|
|
546
|
+
),
|
|
547
|
+
)
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
## Contributing
|
|
551
|
+
|
|
552
|
+
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
553
|
+
Additions made directly to this library would have to be moved over to our generation code,
|
|
554
|
+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
|
|
555
|
+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
|
|
556
|
+
an issue first to discuss with us!
|
|
557
|
+
|
|
558
|
+
On the other hand, contributions to the README are always very welcome!
|
|
559
|
+
|