Do I need to use the SessionProvider class to send...
# ask-ai
i
Do I need to use the SessionProvider class to send an rpc command to an agent? I am currently using the LivekitRoom class.
t
Thanks for reaching out, Andres. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're asking whether you must use
SessionProvider
to send an RPC to an agent while you're currently using
LiveKitRoom
. You do not need
SessionProvider
.
LiveKitRoom
(or the room instance from
@livekit/components-react
) gives you access to participants; you can find the agent participant and call
performRpc
on them. For example:
Copy code
const room = useRoom();
const participants = useParticipants();
const agent = participants.find(p => p.kind === 'agent');

if (agent) {
  const response = await agent.localParticipant?.performRpc({
    destinationIdentity: agent.identity,
    method: 'myMethod',
    payload: 'myPayload',
  });
}
If
SessionProvider
is present in your codebase, it’s likely a custom/third‑party wrapper — not required for sending RPCs. If you want, tell me which SDK/component version you’re using or share the code where you access the room/participants and I’ll point out exactly where to call
performRpc
. Sources: server-sdk-js | livekit/livekit_composite | DeepWiki | Client SDKs | livekit/livekit_composite | DeepWiki | Web and mobile frontends | LiveKit docs
i
Can I change the log level for my agent so that it shows debug logs when I run lk agent logs
t
You're asking whether you can change an agent's log level so
lk agent logs
shows debug output. Yes — set the agent's log level to DEBUG when you start or deploy it.
lk agent logs
streams whatever the running agent outputs; it does not change the running agent's log level dynamically. Options: • Start the agent with a log-level flag: ◦ Python example:
uv run agent.py start --log-level=DEBUG
◦ Node example:
pnpm run start --log-level=debug
• Or set the agent's log level via its deployment/startup configuration (environment variable or service config) so debug logs are produced. • Some plugins use plugin-specific env vars (e.g.,
LK_ULTRAVOX_DEBUG=true
) to enable debug logging. If you tell me which agent runtime (Python, Node) or how you deploy it, I can give the exact command or config snippet to enable DEBUG logs. Sources: Agent server options | LiveKit docs | Ultravox plugin guide | LiveKit docs