> ## Documentation Index
> Fetch the complete documentation index at: https://daily-main.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini Live WebSocket Transport

> GeminiLiveWebsocketTransport for the JavaScript SDK: connect directly to Google's Gemini Live service over WebSocket.

<Warning>
  **Deprecated:** This transport connects directly from the browser to a
  third-party LLM API rather than through a Pipecat server, so it can't use
  most Pipecat server-side features and drifts out of sync with that API over
  time. It is no longer supported and will not receive further updates.
  Published npm versions will remain installable, but since this transport
  depends directly on a third-party API that changes over time, it may stop
  working correctly as that API evolves.

  For production applications, use a server-friendly transport like the
  [DailyTransport](./daily) with a Pipecat server component to securely handle
  API keys and access the full Pipecat feature set.
</Warning>

## Overview

The `GeminiLiveWebsocketTransport` class implements a fully functional [Pipecat `Transport`](./transport), providing a framework for implementing real-time communication directly with the [Gemini Live](https://ai.google.dev/gemini-api/docs/live-api) service. Like all transports, it handles media device management, audio/video streams, and state management for the connection.

## Usage

### Basic Setup

```javascript theme={null}
import {
  GeminiLiveWebsocketTransport,
  GeminiLLMServiceOptions,
} from "@pipecat-ai/gemini-live-websocket-transport";
import { PipecatClient } from "@pipecat-ai/client-js";

const options: GeminiLLMServiceOptions = {
  api_key: "YOUR_API_KEY",
  initial_messages: [
    // Set up initial system and user messages.
    // Without the user message, the bot will not respond immediately
    // and wait for the user to speak first.
    {
      role: "model",
      content: "You are a confused jellyfish.",
    },
    { role: "user", content: "Blub blub!" },
  ],
  settings: {
    temperature: 0.7,
    maxOutput_tokens: 1000,
  },
};

const transport = new GeminiLiveWebsocketTransport(options);
let pcClient = new PipecatClient({
  transport: new GeminiLiveWebsocketTransport(options),
  callbacks: {
    // Event handlers
  },
});
pcClient.connect();
```

## API Reference

### Constructor Options

#### `GeminiLLMServiceOptions`

```typescript theme={null}
interface GeminiLLMServiceOptions {
  api_key: string; // Required: Your Gemini API key
  initial_messages?: Array<{
    // Optional: Initial conversation context
    content: string;
    role: string;
  }>;
  settings?: {
    // 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";
        };
      };
    };
  };
}
```

### TransportConnectionParams

`connect()` optionally takes a partial `GeminiLLMServiceOptions`, which is merged over the configuration given to the constructor — useful for supplying the API key or overriding `generation_config` per session. Omit it and the transport connects with the constructor's configuration as-is.

### Events

The GeminiLiveWebSocketTransport implements the various [PipecatClient event handlers](/api-reference/client/js/callbacks). Check out the docs or samples for more info.

## More Information

<CardGroup cols={2}>
  <Card horizontal title="Demo" icon="play" href="https://github.com/pipecat-ai/pipecat-client-web-transports/tree/main/examples/directToLLMTransports">
    Gemini Live Basic Demo
  </Card>

  <Card horizontal title="Source" icon="github" href="https://github.com/pipecat-ai/pipecat-client-web-transports/tree/main/transports/gemini-live-websocket-transport">
    `GeminiLiveWebsocketTransport`
  </Card>
</CardGroup>

<Card horizontal title="Package" icon="browser" href="https://www.npmjs.com/package/@pipecat-ai/gemini-live-websocket-transport">
  `@pipecat-ai/gemini-live-websocket-transport`
</Card>
