Features
Voice, speech-to-text, feedback, and context passing
Passing Context
Pass key/value pairs to your agent. This context is available to the agent and any tools it invokes.
There are two ways to pass context. Both are merged together, with secure context taking priority if keys conflict.
Secure Context (via JWT)
Include context in the JWT token from your server. This is tamper-proof.
const token = jwt.sign({
sub: 'user-123',
context: {
name: "Ron Johnson",
email: "ron@ensembleapps.ai"
}
...
});Client Context (via Widget)
Pass context directly from the widget. Use for non-sensitive data.
<ChatWidget
...
dataContext={{
environment: "dev"
}}
...
/>Voice & Speech
<ChatWidget
voice={{
url: 'https://api.example.com/tts',
enabled: true,
headers: { Authorization: 'Bearer ...' },
payload: (text) => ({ text, voice: 'en-US' }),
autoplayLatest: true,
}}
speechToText={{
enabled: true,
language: 'en-US',
silenceTimeout: 2000,
onError: (msg) => console.error(msg),
}}
/>Feedback
<ChatWidget
feedback={{
enabled: true,
requireCommentForNegative: true,
}}
/>Shows thumbs up/down on assistant messages. Feedback posts to POST {baseUrl}/api/feedback.