@vowel.to/client / react / VowelContextType
Interface: VowelContextType
Defined in: lib/vowel/components/VowelProviderSimple.tsx:39
Vowel Context type
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
client | Vowel | null | Vowel client instance (null if not initialized) | lib/vowel/components/VowelProviderSimple.tsx:41 |
state | VoiceSessionState | Current session state | lib/vowel/components/VowelProviderSimple.tsx:44 |
startSession | () => Promise<void> | Start a voice session | lib/vowel/components/VowelProviderSimple.tsx:47 |
stopSession | () => void | Stop the current session | lib/vowel/components/VowelProviderSimple.tsx:50 |
toggleSession | () => Promise<void> | Toggle session on/off | lib/vowel/components/VowelProviderSimple.tsx:53 |
clearTranscripts | () => void | Clear transcript history | lib/vowel/components/VowelProviderSimple.tsx:56 |
notifyEvent | (eventDetails, context?) => Promise<void> | Notify the AI about an app event Triggers an AI voice response without requiring user speech input | lib/vowel/components/VowelProviderSimple.tsx:65 |
sendText | (text) => Promise<void> | Send text to the AI for processing Lower-level method for custom text interactions | lib/vowel/components/VowelProviderSimple.tsx:73 |
updateContext | (context) => void | Update the dynamic context that gets appended to system prompt. Context is stringified, wrapped in <context> tags and sent via session.update. When context changes, a session.update event is automatically sent to update the system prompt so the AI knows about the current context. Example const { updateContext } = useVowel(); useEffect(() => { updateContext({ page: 'product', productId: 'iphone-15-pro' }); return () => updateContext(null); // Clear on unmount }, [product]); | lib/vowel/components/VowelProviderSimple.tsx:94 |
getContext | () => Record<string, unknown> | null | Get current context value Example const { getContext } = useVowel(); const currentContext = getContext(); | lib/vowel/components/VowelProviderSimple.tsx:107 |