shy-article-62777
09/02/2025, 11:32 AMtall-airline-16756
09/02/2025, 11:32 AMtall-airline-16756
09/02/2025, 11:33 AMnpm install @livekit/agents-plugin-google
2. Authenticate with Google Cloud and Enable Vertex AI:
◦ Make sure you have the Google Cloud CLI installed, then authenticate with gcloud auth application-default login.
◦ Don't forget to enable the Vertex AI API in your Google Cloud project.
◦ Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to your service account key file, or use another Google Cloud authentication method. Also, set GOOGLE_CLOUD_PROJECT and GOOGLE_GENAI_USE_VERTEXAI environment variables.
1. Configure the LLM Instance in Your Agent: Create your LLM instance with vertexai enabled and include your Google Cloud project ID. Here's a quick example:
import * as livekit from '@livekit/agents';
import { LLM } from '@livekit/agents-plugin-google';
const llm = new LLM({
model: 'gemini-1.5-pro',
vertexai: true,
project: 'your-project-id',
});
const agent = new livekit.VoicePipelineAgent({
llm: llm,
});
2. Optional Parameters: Feel free to tweak settings like temperature, maxOutputTokens, topP, and topK to get the behavior just right.
3. Troubleshooting and Prerequisites:
◦ The project parameter is a must when vertexai is true. If you don’t set it in code, make sure it’s in the GOOGLE_CLOUD_PROJECT environment variable.
◦ Remember to set GOOGLE_APPLICATION_CREDENTIALS to your service account key file for authentication.
◦ If the project ID is missing, you’ll see specific error messages that can help you figure out what’s wrong.
If you hit any bumps or have questions, just let me know—I’m here to help!
Sources: plugins/google/src/llm.ts | Google integration guide | LiveKit Docs | Large language model (LLM) integrations | LiveKit Docs | livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/realtime...shy-article-62777
09/02/2025, 11:41 AMtall-airline-16756
09/02/2025, 11:42 AMservice-account-key.json.
3. Set the Path in Your .env File: Open up your .env file and add this line to point to your key file:
GOOGLE_APPLICATION_CREDENTIALS=./service-account-key.json
4. Make Sure Other Variables Are Set: Also, don’t forget to include these in your .env file:
GOOGLE_CLOUD_PROJECT=your-project-id
GOOGLE_GENAI_USE_VERTEXAI=true
After that, your app will be all set to use those credentials to authenticate with Vertex AI. If anything’s unclear or you want to chat more about it, just let me know—I’m here to help!shy-article-62777
09/02/2025, 11:48 AMtall-airline-16756
09/02/2025, 11:48 AMshy-article-62777
09/02/2025, 11:49 AMtall-airline-16756
09/02/2025, 11:50 AMsip.callStatus participant attribute to see how SIP calls are doing. The status might be active, ringing, or hangup.
◦ Make use of the onParticipantConnected and onParticipantAttributesChanged event callbacks to catch when a SIP participant joins or their info changes.
◦ You can spot SIP participants by checking if Kind() == SIP.
• Tracking WebRTC Participants:
◦ Try the ListParticipants method to get a list of everyone in the WebRTC room.
◦ Keep an eye on participant events to know when folks come in or head out.
• Concurrency Management:
◦ Bring together the tracking of SIP and WebRTC participants to have a live count of who’s connected.
◦ Update your Supabase database by adding to the count when someone connects and subtracting when they leave.
◦ Use this info to keep concurrency limits in check or to trigger actions based on how many are active.
If you want me to walk you through any part or need more details, just let me know—I’m here to help!
Sources: LiveKit Server Components | livekit/livekit_composite | DeepWiki | pkg/stats/monitor.go | telephony/sip_lifecycle.py | LiveKit Pricing | Quotas and limits | LiveKit Docs