can i send some custom json payload to the agent u...
# ask-ai
b
can i send some custom json payload to the agent ui along with transcript. Eg - User says something , voice agent replies with a text and audio but with the text it reponds with a button as well. When user clicks on the button the user is redirected to a new page/ the user can see a bot sharing its screen and showing a demo
t
Thanks for reaching out, Ranjeet. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to share that LiveKit supports sending custom JSON payloads to the agent UI using the RPC system. This is a great way to include interactive elements, like buttons or notifications, that show up alongside the transcript. These elements aren’t embedded directly in the transcript but are triggered and managed separately by the frontend, which helps keep things organized and user-friendly. For instance, you can send a JSON payload with details about an interactive element, and the frontend will take care of displaying it. This opens up possibilities for fun and useful features like quizzes, flashcards, or toast notifications that work seamlessly with the transcript. If you'd like, I’m here to help with specific implementation examples or any other details you might need. Just let me know! Sources: Tool definition and use | LiveKit Docs | web/src/hooks/use-agent.tsx | avatars/tavus/tavus.py
b
I have a use case where a person joins a call with the bot and starts interacting with the bot. In some cases I want the bot to show a live demo of my product. This live demo would be generated using pupetteer (headless browser). How do I demo this browser on the call. And I want the bot to keep talking about the demo
t
I'd be happy to help you share a live demo generated with Puppeteer during a LiveKit call while the bot continues to talk about it. Here are a few approaches you can consider: • Screen Sharing with Puppeteer: You can run Puppeteer in non-headless mode and use LiveKit's built-in screen sharing feature to share the browser window as a video track. This is probably the easiest way to get your live demo going. • Screenshot-to-Video Stream: Another option is to capture screenshots from Puppeteer at regular intervals, convert them into a video stream, and then publish that stream to the LiveKit room. This gives you more control over the process if you want to customize things. • LiveKit Browser Plugin: You might also want to try the LiveKit browser plugin, which offers smoother integration. It lets you capture browser content as video frames and publish them directly to the LiveKit room, making things a bit more seamless and removing the need to handle screenshots manually. For the bot's commentary, you can sync its speech with the demo actions by triggering it to describe features as they happen in the browser. This way, everything feels connected and engaging. If you'd like, I can walk you through detailed steps for any of these methods—just let me know, and I’m here to help! Sources: livekit-plugins/livekit-plugins-browser/livekit/plugins/browser/proc_main.p... | Screen sharing | LiveKit Docs | Web Applications & Integration Examples | livekit/livekit_composite | DeepW...