@@ -152,7 +152,9 @@ async def perform_greeting(room: rtc.Room):
152152 print ("[Caller] Letting the greeter know that I've arrived" )
153153 try :
154154 response = await room .local_participant .perform_rpc (
155- "greeter" , "arrival" , "Hello"
155+ destination_identity = "greeter" ,
156+ method = "arrival" ,
157+ payload = "Hello"
156158 )
157159 print (f'[Caller] That\' s nice, the greeter said: "{ response } "' )
158160 except Exception as error :
@@ -164,7 +166,9 @@ async def perform_square_root(room: rtc.Room):
164166 print ("[Caller] What's the square root of 16?" )
165167 try :
166168 response = await room .local_participant .perform_rpc (
167- "math-genius" , "square-root" , json .dumps ({"number" : 16 })
169+ destination_identity = "math-genius" ,
170+ method = "square-root" ,
171+ payload = json .dumps ({"number" : 16 })
168172 )
169173 parsed_response = json .loads (response )
170174 print (f"[Caller] Nice, the answer was { parsed_response ['result' ]} " )
@@ -177,7 +181,9 @@ async def perform_quantum_hypergeometric_series(room: rtc.Room):
177181 print ("[Caller] What's the quantum hypergeometric series of 42?" )
178182 try :
179183 response = await room .local_participant .perform_rpc (
180- "math-genius" , "quantum-hypergeometric-series" , json .dumps ({"number" : 42 })
184+ destination_identity = "math-genius" ,
185+ method = "quantum-hypergeometric-series" ,
186+ payload = json .dumps ({"number" : 42 })
181187 )
182188 parsed_response = json .loads (response )
183189 print (f"[Caller] genius says { parsed_response ['result' ]} !" )
@@ -196,7 +202,9 @@ async def perform_divide(room: rtc.Room):
196202 print ("[Caller] Let's divide 10 by 0." )
197203 try :
198204 response = await room .local_participant .perform_rpc (
199- "math-genius" , "divide" , json .dumps ({"dividend" : 10 , "divisor" : 0 })
205+ destination_identity = "math-genius" ,
206+ method = "divide" ,
207+ payload = json .dumps ({"dividend" : 10 , "divisor" : 0 })
200208 )
201209 parsed_response = json .loads (response )
202210 print (f"[Caller] The result is { parsed_response ['result' ]} " )
@@ -215,9 +223,9 @@ async def perform_long_calculation(room: rtc.Room):
215223 print ("[Caller] Giving the math genius 10s to complete a long calculation" )
216224 try :
217225 response = await room .local_participant .perform_rpc (
218- "math-genius" ,
219- "long-calculation" ,
220- json .dumps ({}),
226+ destination_identity = "math-genius" ,
227+ method = "long-calculation" ,
228+ payload = json .dumps ({}),
221229 response_timeout = 10
222230 )
223231 parsed_response = json .loads (response )
0 commit comments