
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@pipecat-ai/gemini-live-websocket-transport
Advanced tools
Pipecat Gemini Multimodal Live Transport Package
A real-time websocket transport implementation for interacting with Google's Gemini Multimodal Live API, supporting bidirectional audio and unidirectional text communication.
npm install @pipecat-ai/client-js @pipecat-ai/real-time-websocket-transport @pipecat-ai/gemini-live-websocket-transport
The GeminiLiveWebsocketTransport
class extends the RealTimeWebsocketTransport
to implement a fully functional RTVI Transport
. It provides a framework for implementing real-time communication directly with the Gemini Multimodal Live voice-to-voice service. It handles media device management, audio/video streams, and state management for the connection.
import { GeminiLiveWebsocketTransport, GeminiLLMServiceOptions } from '@pipecat-ai/gemini-live-websocket-transport';
const options: GeminiLLMServiceOptions = {
api_key: 'YOUR_API_KEY',
generation_config: {
temperature: 0.7,
maxOutput_tokens: 1000
}
};
const transport = new GeminiLiveWebsocketTransport(options);
let RTVIConfig: RTVIClientOptions = {
transport,
...
};
interface GeminiLLMServiceOptions {
api_key: string; // Required: Your Gemini API key
initial_messages?: Array<{ // Optional: Initial conversation context
content: string;
role: string;
}>;
generation_config?: { // Optional: Generation parameters
candidate_count?: number;
maxOutput_tokens?: number;
temperature?: number;
top_p?: number;
top_k?: number;
presence_penalty?: number;
frequency_penalty?: number;
response_modalities?: string;
speech_config?: {
voice_config?: {
prebuilt_voice_config?: {
voice_name: "Puck" | "Charon" | "Kore" | "Fenrir" | "Aoede";
};
};
};
};
}
// Send text prompt message
rtviClient.sendMessage({
type: 'send-text',
data: 'Hello, Gemini!'
});
The transport implements the various RTVI event handlers. Check out the docs or samples for more info.
initialize()
: Set up the transport and establish connectionsendMessage(message)
: Send a text messagehandleUserAudioStream(data)
: Stream audio data to the modeldisconnectLLM()
: Close the connectionsendReadyMessage()
: Signal ready stateThe transport can be in one of the following states:
The transport includes comprehensive error handling for:
BSD-2 Clause
Feel free to submit issues and pull requests for improvements or bug fixes. Be nice :)
FAQs
Pipecat Gemini Multimodal Live Transport Package
The npm package @pipecat-ai/gemini-live-websocket-transport receives a total of 76 weekly downloads. As such, @pipecat-ai/gemini-live-websocket-transport popularity was classified as not popular.
We found that @pipecat-ai/gemini-live-websocket-transport demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.