@@ -36,42 +36,42 @@ Instantiate and use the client with the following:
3636
3737``` python
3838from agoraio import Agora
39- from agoraio.agent_management import (
40- StartAgentManagementRequestProperties ,
41- StartAgentManagementRequestPropertiesAdvancedFeatures ,
42- StartAgentManagementRequestPropertiesAsr ,
43- StartAgentManagementRequestPropertiesLlm ,
44- StartAgentManagementRequestPropertiesTts ,
39+ from agoraio.agents import (
40+ StartAgentsRequestProperties ,
41+ StartAgentsRequestPropertiesAdvancedFeatures ,
42+ StartAgentsRequestPropertiesAsr ,
43+ StartAgentsRequestPropertiesLlm ,
44+ StartAgentsRequestPropertiesTts ,
4545)
4646
4747client = Agora(
4848 username = " YOUR_USERNAME" ,
4949 password = " YOUR_PASSWORD" ,
5050)
51- client.agent_management .start(
51+ client.agents .start(
5252 appid = " appid" ,
5353 name = " unique_name" ,
54- properties = StartAgentManagementRequestProperties (
54+ properties = StartAgentsRequestProperties (
5555 channel = " channel_name" ,
5656 token = " token" ,
5757 agent_rtc_uid = " 1001" ,
5858 remote_rtc_uids = [" 1002" ],
5959 idle_timeout = 120 ,
60- advanced_features = StartAgentManagementRequestPropertiesAdvancedFeatures (
60+ advanced_features = StartAgentsRequestPropertiesAdvancedFeatures (
6161 enable_aivad = True ,
6262 ),
63- asr = StartAgentManagementRequestPropertiesAsr (
63+ asr = StartAgentsRequestPropertiesAsr (
6464 language = " en-US" ,
6565 ),
66- tts = StartAgentManagementRequestPropertiesTts (
66+ tts = StartAgentsRequestPropertiesTts (
6767 vendor = " microsoft" ,
6868 params = {
6969 " key" : " <your_tts_api_key>" ,
7070 " region" : " eastus" ,
7171 " voice_name" : " en-US-AndrewMultilingualNeural" ,
7272 },
7373 ),
74- llm = StartAgentManagementRequestPropertiesLlm (
74+ llm = StartAgentsRequestPropertiesLlm (
7575 url = " https://api.openai.com/v1/chat/completions" ,
7676 api_key = " <your_llm_key>" ,
7777 system_messages = [
@@ -94,12 +94,12 @@ The SDK also exports an `async` client so that you can make non-blocking calls t
9494import asyncio
9595
9696from agoraio import AsyncAgora
97- from agoraio.agent_management import (
98- StartAgentManagementRequestProperties ,
99- StartAgentManagementRequestPropertiesAdvancedFeatures ,
100- StartAgentManagementRequestPropertiesAsr ,
101- StartAgentManagementRequestPropertiesLlm ,
102- StartAgentManagementRequestPropertiesTts ,
97+ from agoraio.agents import (
98+ StartAgentsRequestProperties ,
99+ StartAgentsRequestPropertiesAdvancedFeatures ,
100+ StartAgentsRequestPropertiesAsr ,
101+ StartAgentsRequestPropertiesLlm ,
102+ StartAgentsRequestPropertiesTts ,
103103)
104104
105105client = AsyncAgora(
@@ -109,30 +109,30 @@ client = AsyncAgora(
109109
110110
111111async def main () -> None :
112- await client.agent_management .start(
112+ await client.agents .start(
113113 appid = " appid" ,
114114 name = " unique_name" ,
115- properties = StartAgentManagementRequestProperties (
115+ properties = StartAgentsRequestProperties (
116116 channel = " channel_name" ,
117117 token = " token" ,
118118 agent_rtc_uid = " 1001" ,
119119 remote_rtc_uids = [" 1002" ],
120120 idle_timeout = 120 ,
121- advanced_features = StartAgentManagementRequestPropertiesAdvancedFeatures (
121+ advanced_features = StartAgentsRequestPropertiesAdvancedFeatures (
122122 enable_aivad = True ,
123123 ),
124- asr = StartAgentManagementRequestPropertiesAsr (
124+ asr = StartAgentsRequestPropertiesAsr (
125125 language = " en-US" ,
126126 ),
127- tts = StartAgentManagementRequestPropertiesTts (
127+ tts = StartAgentsRequestPropertiesTts (
128128 vendor = " microsoft" ,
129129 params = {
130130 " key" : " <your_tts_api_key>" ,
131131 " region" : " eastus" ,
132132 " voice_name" : " en-US-AndrewMultilingualNeural" ,
133133 },
134134 ),
135- llm = StartAgentManagementRequestPropertiesLlm (
135+ llm = StartAgentsRequestPropertiesLlm (
136136 url = " https://api.openai.com/v1/chat/completions" ,
137137 api_key = " <your_llm_key>" ,
138138 system_messages = [
@@ -159,7 +159,7 @@ will be thrown.
159159from agoraio.core.api_error import ApiError
160160
161161try :
162- client.agent_management .start(... )
162+ client.agents .start(... )
163163except ApiError as e:
164164 print (e.status_code)
165165 print (e.body)
@@ -176,7 +176,7 @@ client = Agora(
176176 username = " YOUR_USERNAME" ,
177177 password = " YOUR_PASSWORD" ,
178178)
179- response = client.agent_management .list(
179+ response = client.agents .list(
180180 appid = " appid" ,
181181)
182182for item in response:
@@ -188,7 +188,7 @@ for page in response.iter_pages():
188188
189189``` python
190190# You can also iterate through pages and access the typed response per page
191- pager = client.agent_management .list(... )
191+ pager = client.agents .list(... )
192192for page in pager.iter_pages():
193193 print (page.response) # access the typed response for each page
194194 for item in page:
@@ -208,10 +208,10 @@ from agoraio import Agora
208208client = Agora(
209209 ... ,
210210)
211- response = client.agent_management .with_raw_response.start(... )
211+ response = client.agents .with_raw_response.start(... )
212212print (response.headers) # access the response headers
213213print (response.data) # access the underlying object
214- pager = client.agent_management .list(... )
214+ pager = client.agents .list(... )
215215print (pager.response) # access the typed response for the first page
216216for item in pager:
217217 print (item) # access the underlying object(s)
@@ -236,7 +236,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
236236Use the ` max_retries ` request option to configure this behavior.
237237
238238``` python
239- client.agent_management .start(... , request_options = {
239+ client.agents .start(... , request_options = {
240240 " max_retries" : 1
241241})
242242```
@@ -256,7 +256,7 @@ client = Agora(
256256
257257
258258# Override timeout for a specific method
259- client.agent_management .start(... , request_options = {
259+ client.agents .start(... , request_options = {
260260 " timeout_in_seconds" : 1
261261})
262262```
0 commit comments