@unith-ai/core-client 2.0.5 → 2.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/dist/lib.js +24245 -2
- package/dist/lib.js.map +1 -1
- package/dist/lib.module.js +24229 -2
- package/dist/lib.module.js.map +1 -1
- package/dist/lib.web.js +23970 -27023
- package/dist/lib.web.js.map +1 -1
- package/package.json +11 -10
- package/dist/index.d.ts +0 -88
- package/dist/index.d.ts.map +0 -1
- package/dist/modules/audio.d.ts +0 -18
- package/dist/modules/audio.d.ts.map +0 -1
- package/dist/modules/av.d.ts +0 -23
- package/dist/modules/av.d.ts.map +0 -1
- package/dist/modules/connection.d.ts +0 -21
- package/dist/modules/connection.d.ts.map +0 -1
- package/dist/modules/environment.d.ts +0 -4
- package/dist/modules/environment.d.ts.map +0 -1
- package/dist/modules/event.d.ts +0 -3
- package/dist/modules/event.d.ts.map +0 -1
- package/dist/modules/idle-video.d.ts +0 -9
- package/dist/modules/idle-video.d.ts.map +0 -1
- package/dist/modules/microphone.d.ts +0 -46
- package/dist/modules/microphone.d.ts.map +0 -1
- package/dist/modules/monitor.d.ts +0 -33
- package/dist/modules/monitor.d.ts.map +0 -1
- package/dist/modules/sync.d.ts +0 -15
- package/dist/modules/sync.d.ts.map +0 -1
- package/dist/modules/user.d.ts +0 -28
- package/dist/modules/user.d.ts.map +0 -1
- package/dist/modules/video.d.ts +0 -62
- package/dist/modules/video.d.ts.map +0 -1
- package/dist/modules/vp8.d.ts +0 -42
- package/dist/modules/vp8.d.ts.map +0 -1
- package/dist/types/Conversation.d.ts +0 -67
- package/dist/types/Conversation.d.ts.map +0 -1
- package/dist/types/User.d.ts +0 -44
- package/dist/types/User.d.ts.map +0 -1
- package/dist/types/audio.d.ts +0 -17
- package/dist/types/audio.d.ts.map +0 -1
- package/dist/types/chat.d.ts +0 -29
- package/dist/types/chat.d.ts.map +0 -1
- package/dist/types/connection.d.ts +0 -14
- package/dist/types/connection.d.ts.map +0 -1
- package/dist/types/environment.d.ts +0 -2
- package/dist/types/environment.d.ts.map +0 -1
- package/dist/types/event.d.ts +0 -142
- package/dist/types/event.d.ts.map +0 -1
- package/dist/types/idle-video.d.ts +0 -8
- package/dist/types/idle-video.d.ts.map +0 -1
- package/dist/types/microphone.d.ts +0 -26
- package/dist/types/microphone.d.ts.map +0 -1
- package/dist/types/sync.d.ts +0 -24
- package/dist/types/sync.d.ts.map +0 -1
- package/dist/types/vp8.d.ts +0 -49
- package/dist/types/vp8.d.ts.map +0 -1
- package/dist/utils/audio.d.ts +0 -9
- package/dist/utils/audio.d.ts.map +0 -1
- package/dist/utils/microphone.d.ts +0 -21
- package/dist/utils/microphone.d.ts.map +0 -1
- package/dist/utils/storage.d.ts +0 -5
- package/dist/utils/storage.d.ts.map +0 -1
- package/dist/utils/sync.d.ts +0 -3
- package/dist/utils/sync.d.ts.map +0 -1
- package/dist/utils/worklet-loader.d.ts +0 -2
- package/dist/utils/worklet-loader.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -70,8 +70,10 @@ const conversation = await Conversation.startDigitalHuman({
|
|
|
70
70
|
- **language** - Language code for the conversation (default: browser language)
|
|
71
71
|
- **allowWakeLock** - Prevent screen from sleeping during conversation (default: true)
|
|
72
72
|
- **microphoneProvider** - Provider for the microphone - `"azure" | "eleven_labs"`
|
|
73
|
+
- **voiceInterruptions** - Flag to enable response interruption when voice signal is recognized. - `boolean` (default: `false`)
|
|
73
74
|
- **microphoneOptions** - Callbacks for microphone events
|
|
74
75
|
- **onMicrophoneSpeechRecognitionResult ({ transcript: string })** - Called when microphone recognizes your user's speech. This returns a transcript. Ideal behavior is to call the `.sendMessage` method with your transcript as microphone doesn't automatically commit / send users text to our AI.
|
|
76
|
+
- **onMicrophonePartialSpeechRecognitionResult ()** - Called when microphone recognizes that the user is trying to speak. This **doesn't** returns a transcript. Ideal behavior is to check if digital human is currently responding (`speaking`) and trigger the stop response method (`.stopResponse`).
|
|
75
77
|
- **onMicrophoneStatusChange ({status})** Called when microphone status changes
|
|
76
78
|
- **status** `"ON" | "OFF" | "PROCESSING"` Shows current status of microphone.
|
|
77
79
|
- **onMicrophoneError ({ message: string })** - Called when microphone has an error with the error message.
|
|
@@ -81,6 +83,7 @@ const conversation = await Conversation.startDigitalHuman({
|
|
|
81
83
|
- **vadThreshold `Number`**
|
|
82
84
|
- **minSpeechDurationMs `Number`**
|
|
83
85
|
- **minSilenceDurationMs `Number`**
|
|
86
|
+
- **disableDynamicSpeechRecognition `Boolean`** - This disables ElevenLabs dynamic speech recognition language detection and uses the language specified during digital human creation.
|
|
84
87
|
|
|
85
88
|
#### Callbacks
|
|
86
89
|
|
|
@@ -111,6 +114,8 @@ Register callbacks to handle various events:
|
|
|
111
114
|
- **onTimeoutWarning** - Called before the session times out. This event warns you that the customers session is going to end in a bit. You can call the `keepSession` method to extend the customers session.
|
|
112
115
|
- **onKeepSession** - Called when a keep-alive request is processed
|
|
113
116
|
- **onError** - Called when an error occurs
|
|
117
|
+
- **onStoppingStart** - Called immediately when a stop request is initiated
|
|
118
|
+
- **onStoppingEnd** - Called once the current response stops playing
|
|
114
119
|
|
|
115
120
|
### Getting Background Video
|
|
116
121
|
|
|
@@ -186,6 +191,17 @@ Get the current user's ID:
|
|
|
186
191
|
const userId = conversation.getUserId();
|
|
187
192
|
```
|
|
188
193
|
|
|
194
|
+
#### stopResponse()
|
|
195
|
+
|
|
196
|
+
Stops the ongoing response and notifies you via two callbacks:
|
|
197
|
+
|
|
198
|
+
- `onStoppingStart()` - Called immediately when stop is initiated.
|
|
199
|
+
- `onStoppingEnd()` - Called once the current response is stopped.
|
|
200
|
+
|
|
201
|
+
```js
|
|
202
|
+
await conversation.stopResponse();
|
|
203
|
+
```
|
|
204
|
+
|
|
189
205
|
#### endSession()
|
|
190
206
|
|
|
191
207
|
End the conversation session and clean up resources:
|