# Gemini Live WebSocket notes

These notes capture the verified protocol target for the next implementation step.

## Verified target

Google AI documentation indicates Gemini Live supports:

- direct WebSocket sessions
- stateful sessions
- text and audio modalities
- JavaScript SDK usage via `@google/genai`
- raw WebSocket usage

## Verified endpoint shape

Raw WebSocket endpoint:

```text
wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent?key=YOUR_API_KEY
```

## Verified setup flow

The first client message must configure the session.

The documentation describes a first setup/config message and then subsequent turn content.

## Verified JS SDK direction

Docs show JavaScript examples using:

```ts
import { GoogleGenAI, Modality } from '@google/genai';
```

And a live connect flow shaped like:

```ts
const session = await ai.live.connect({
  model,
  callbacks,
  config,
});
```

## Verified model direction

Examples reference live-capable models such as:

- `gemini-3.1-flash-live-preview`

## Implication for this repo

The next implementation step should prefer:

1. adding `@google/genai`
2. implementing `GeminiLiveProvider` with `ai.live.connect(...)`
3. capturing streamed text/audio output into the local runtime event model

## Notes for runtime wiring

Desired mapping in this repo:

- incoming chat -> `GeminiLiveProvider.generateReply`
- Gemini streamed text -> reply text
- Gemini audio output -> OBS-capturable sink
- Gemini affect/prosody -> avatar action cues for OpenVT bridge

