@humeai/voice-embed-react 0.0.0-beta.21 → 0.0.0-beta.23
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 +14 -16
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<img src="https://storage.googleapis.com/hume-public-logos/hume/hume-banner.png">
|
|
3
|
-
<h1>Hume AI Voice Embed</h1>
|
|
3
|
+
<h1>Hume AI Voice Embed React SDK</h1>
|
|
4
4
|
<p>
|
|
5
5
|
<strong>Integrate Hume's Empathic Voice Interface directly into your web application</strong>
|
|
6
6
|
</p>
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
## Overview
|
|
10
10
|
|
|
11
|
-
This package
|
|
11
|
+
This package enables you to integrate a widget that runs Hume's Empathic Voice Interface into your React application. It abstracts away the complexities of managing websocket connections, capturing user audio via the client's microphone, and handling the playback of the interface's audio responses. The widget is embedded into your web page through an iframe.
|
|
12
|
+
|
|
13
|
+
There are two packages needed to embed your own widget. Install this package to embed the widget to your application. Code for the widget itself can be found at [https://github.com/HumeAI/empathic-voice-embed-renderer](https://github.com/HumeAI/empathic-voice-embed-renderer).
|
|
12
14
|
|
|
13
15
|
## Prerequisites
|
|
14
16
|
|
|
@@ -70,22 +72,18 @@ function App() {
|
|
|
70
72
|
|
|
71
73
|
### Component Props
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
`EmbeddedVoice` accepts all props that are accepted by the VoiceProvider in the [@humeai/voice-react package](https://github.com/HumeAI/empathic-voice-api-js/blob/main/packages/react).
|
|
76
|
+
|
|
77
|
+
In addition, it accepts a few other props specific to creating a widget:
|
|
74
78
|
|
|
75
|
-
|
|
|
79
|
+
| Prop | Required | Description |
|
|
76
80
|
| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
| sampleRate | no | Sample rate of the input audio. |
|
|
83
|
-
| tts | no | Text-To-Speech service. If not provided this value will default to `"hume_ai"`, specifying Hume's text-to-speech service. Other options include: `"eleven_labs"` and `"play_ht"`. |
|
|
84
|
-
| reconnectAttempts | no | Number of times to attempt to reconnect to the API. If not provided this value will default to `30`. |
|
|
85
|
-
| debug | no | Enable debug mode. If not provided this value will default to `false`. |
|
|
86
|
-
| onMessage | no | Callback function to invoke upon receiving a message through the web socket. |
|
|
87
|
-
| onClose | no | Callback function to invoke upon the web socket connection being closed. |
|
|
81
|
+
| `isEmbedOpen` | yes | Determines the initial visibility of the widget. Assign `true` to render the widget as open on initial load, and `false` to start with the widget closed. While the widget's UI provides a trigger to toggle its visibility, this prop also enables external control over the widget's visibility state through a parent component. |
|
|
82
|
+
| rendererUrl | no | URL where the widget itself is hosted. If blank, this defaults the Hume AI widget, https://voice-widget.hume.ai. An example of this widget can be found at [http://hume.ai](http://hume.ai). |
|
|
83
|
+
| `onMessage` | no | Callback function to invoke upon receiving a message through the web socket. |
|
|
84
|
+
| `onClose` | no | Callback function to invoke upon the web socket connection being closed. |
|
|
85
|
+
| `openOnMount` | no | Boolean which indicates whether the widget should be initialized in an open or closed state. Set as `true` if you want it to be open. The default value is `false`. |
|
|
88
86
|
|
|
89
87
|
## Support
|
|
90
88
|
|
|
91
|
-
If you have questions or require assistance pertaining to this package, [reach out to us on Discord](https://
|
|
89
|
+
If you have questions or require assistance pertaining to this package, [reach out to us on Discord](https://hume.ai/discord)!
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@humeai/voice-embed-react",
|
|
3
|
-
"version": "0.0.0-beta.
|
|
3
|
+
"version": "0.0.0-beta.23",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"react": "^18.2.0",
|
|
22
22
|
"react-dom": "^18.2.0",
|
|
23
|
-
"@humeai/voice-embed": "0.0.0-beta.
|
|
23
|
+
"@humeai/voice-embed": "0.0.0-beta.23"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@testing-library/react": "^14.2.2",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"tsup": "^8.0.2",
|
|
39
39
|
"typescript": "^5.4.3",
|
|
40
40
|
"vitest": "^1.4.0",
|
|
41
|
-
"@humeai/
|
|
42
|
-
"@humeai/
|
|
41
|
+
"@humeai/eslint-config": "0.0.1",
|
|
42
|
+
"@humeai/typescript-config": "0.0.0"
|
|
43
43
|
},
|
|
44
44
|
"browserslist": [
|
|
45
45
|
"last 2 Chrome versions, last 2 iOS major versions, Firefox ESR, not dead"
|