How can I send a website URL from my Python LiveKi...
# agents
a
How can I send a website URL from my Python LiveKit agent to my React frontend so that React can automatically navigate the user to that website? I am using LiveKit with Python on the backend and React on the frontend. When the AI agent decides on a website (e.g.,
<https://example.com>
), I want to send that URL to the React app, and then React should navigate to that page. What is the proper way to send this data from the Python agent to the React LiveKit client?
l
You would have to do this in two steps: 1. Send a message from your agent to the front end over RPC. RPC is a generic messaging system, there is no specific message format or structure (i.e. there is no 'NAVIGATE' message). For example, https://github.com/livekit-examples/python-agents-examples/tree/main/complex-agents/drive-thru uses RPC to update the front end with the user's drive-thru order. You would send the URL or required page over RPC. 2. When you receive the message, you should navigate to the desired page using whichever mechanism you are using for navigation (e.g. React Router).