Skip to content

@vowel.to/client v0.3.3-beta


@vowel.to/client / react / VowelContextType

Interface: VowelContextType

Defined in: lib/vowel/components/VowelProviderSimple.tsx:39

Vowel Context type

Properties

PropertyTypeDescriptionDefined in
clientVowel | nullVowel client instance (null if not initialized)lib/vowel/components/VowelProviderSimple.tsx:41
stateVoiceSessionStateCurrent session statelib/vowel/components/VowelProviderSimple.tsx:44
startSession() => Promise<void>Start a voice sessionlib/vowel/components/VowelProviderSimple.tsx:47
stopSession() => voidStop the current sessionlib/vowel/components/VowelProviderSimple.tsx:50
toggleSession() => Promise<void>Toggle session on/offlib/vowel/components/VowelProviderSimple.tsx:53
clearTranscripts() => voidClear transcript historylib/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 inputlib/vowel/components/VowelProviderSimple.tsx:65
sendText(text) => Promise<void>Send text to the AI for processing Lower-level method for custom text interactionslib/vowel/components/VowelProviderSimple.tsx:73
updateContext(context) => voidUpdate the dynamic context that gets appended to system prompt. Context is stringified, wrapped in &lt;context&gt; 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> | nullGet current context value Example const { getContext } = useVowel(); const currentContext = getContext();lib/vowel/components/VowelProviderSimple.tsx:107