livekit / agents

Build real-time multimodal AI applications 🤖🎙️📹
https://docs.livekit.io/agents
Apache License 2.0
1.71k stars 248 forks source link

FunctionContext should have access to room / participant information #769

Open jezell opened 2 weeks ago

jezell commented 2 weeks ago

At the moment when invoking a function call, the function call does not appear to have access to the room or participant information to make contextual decisions based on who is connected. This is potentially very important information for the function call to have access to. Imagine a scenario such as "do I have any outstanding tasks?" without access to some contextual information, such as the participant who is making the call, you cannot create an appropriate response.

cangnduc commented 1 week ago

I put email in identity when generate access token for users, when they connect to the room, you should have their info in participant.identity. then you can look up in database for info needed.

jezell commented 4 days ago

I ended up ditching the scheduler and stopped using the JobContext to start things up. Easier when you have full control over the lifecycle to do whatever you need.