fresh-painting-88343
09/19/2025, 3:25 PMtall-airline-16756
09/19/2025, 3:25 PMtall-airline-16756
09/19/2025, 3:26 PMregisterRpcMethod on the localParticipant to set up handlers for the methods the backend will call. For example:
localParticipant.registerRpcMethod('updateField', async (data) => {
const payload = JSON.parse(data.payload);
formFields[payload.field] = payload.value;
return { status: 'success' };
});
1. Perform RPC Calls from the Backend: Then, on the backend, use performRpc on room.local_participant to call those frontend methods. Here’s an example:
await room.local_participant.perform_rpc(
destination_identity=client_participant.identity,
method="updateField",
payload=json.dumps({
"field": "currentRole",
"value": "Software Engineer"
})
)
If you’d like, I’m here to help with more details or tailor some examples just for your specific situation—feel free to ask!
Sources: Tool definition and use | LiveKit Docs | Remote method calls (RPC) | LiveKit Docs | Function calling with Voice Agents | LiveKit Docs | Web and mobile frontends | LiveKit Docs | Web and mobile frontends | LiveKit Docs