@vowel.to/client / index / SessionManager
Class: SessionManager
Defined in: lib/vowel/managers/SessionManager.ts:123
Session Manager class Manages realtime voice session lifecycle (multi-provider)
Constructors
Constructor
new SessionManager(config): SessionManager;Defined in: lib/vowel/managers/SessionManager.ts:158
Parameters
| Parameter | Type |
|---|---|
config | SessionConfig |
Returns
SessionManager
Methods
isActive()
isActive(): boolean;Defined in: lib/vowel/managers/SessionManager.ts:289
Check if session is active
Returns
boolean
getProvider()
getProvider(): RealtimeProvider | null;Defined in: lib/vowel/managers/SessionManager.ts:296
Get the underlying provider
Returns
RealtimeProvider | null
connect()
connect(toolContext, restoreState?): Promise<void>;Defined in: lib/vowel/managers/SessionManager.ts:909
Connect to Gemini Live session
Parameters
| Parameter | Type | Description |
|---|---|---|
toolContext | ToolContext | Tool execution context |
restoreState? | Partial<VoiceSessionState> | Optional state to restore (injects conversation history into system prompt) |
Returns
Promise<void>
disconnect()
disconnect(): Promise<void>;Defined in: lib/vowel/managers/SessionManager.ts:1181
Disconnect from session and reset state
Returns
Promise<void>
pauseVAD()
pauseVAD(): void;Defined in: lib/vowel/managers/SessionManager.ts:1219
Pause VAD (for session pause)
Returns
void
resumeVAD()
resumeVAD(): void;Defined in: lib/vowel/managers/SessionManager.ts:1229
Resume VAD (for session resume)
Returns
void
updateConfig()
updateConfig(updates): void;Defined in: lib/vowel/managers/SessionManager.ts:1239
Update configuration (for dynamic updates)
Parameters
| Parameter | Type |
|---|---|
updates | Partial<SessionConfig> |
Returns
void
notifyEvent()
notifyEvent(eventDetails, context?): Promise<void>;Defined in: lib/vowel/managers/SessionManager.ts:1262
Send a text notification to the AI without user speech input This allows programmatic triggering of AI responses for app events
Parameters
| Parameter | Type | Description |
|---|---|---|
eventDetails | any | Description of the event that occurred, or abstract JSON payload |
context? | Record<string, any> | Optional context object to provide additional information |
Returns
Promise<void>
Example
// Notify AI about a timer expiry
await sessionManager.notifyEvent('Timer expired - 5 minutes are up!');
// Notify with additional context
await sessionManager.notifyEvent(
'New message received',
{ from: 'John', preview: 'Hello!' }
);sendText()
sendText(text): Promise<void>;Defined in: lib/vowel/managers/SessionManager.ts:1310
Send raw text input to the AI Lower-level method for custom text-based interactions
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | Text to send to the AI |
Returns
Promise<void>
Example
await sessionManager.sendText('What products are on sale?');sendImage()
sendImage(imageUrl): Promise<void>;Defined in: lib/vowel/managers/SessionManager.ts:1346
Send an image to the AI for processing Enables multimodal interactions where the AI can see and respond to images
Parameters
| Parameter | Type | Description |
|---|---|---|
imageUrl | string | URL or data URI of the image to send |
Returns
Promise<void>
Example
// Send an image URL
await sessionManager.sendImage('https://example.com/product.jpg');
// Send a data URI
await sessionManager.sendImage('data:image/png;base64,iVBORw0KGgo...');