@@ -53,7 +53,7 @@ This SDK contains the APIs for expression measurement, empathic voice and custom
53
53
if you do not plan on using more than one API to start, the SDK provides easy access in
54
54
case you find additional APIs in the future.
55
55
56
- Each category is namespaced:
56
+ Each API is namespaced accordingly:
57
57
58
58
``` typescript
59
59
import { HumeClient } from " hume" ;
@@ -71,8 +71,8 @@ hume.emapthicVoice. // APIs specific to Empathic Voice
71
71
The SDK supports interacting with both WebSocket and REST APIs.
72
72
73
73
### Request-Reply
74
- The expression measurement SDK supports a request-reply pattern,
75
- where you can send text and wait till the model provides a result .
74
+ The SDK supports a request-reply pattern for the streaming expression measurement API.
75
+ You'll be able to pass an inference request and ` await ` till the response is received .
76
76
77
77
``` typescript
78
78
import { HumeClient } from " hume" ;
@@ -92,7 +92,9 @@ for (const sample of samples) {
92
92
```
93
93
94
94
### Empathic Voice
95
- The empathic voice API is also accessible via the SDK.
95
+ The SDK supports sending and receiving audio from Empathic Voice. If you're
96
+ running with Node.js you can also import our ` ffplay ` function which will
97
+ play the audio for you.
96
98
97
99
``` typescript
98
100
import { HumeClient , ffplay } from " hume" ;
@@ -123,7 +125,7 @@ a subclass of [HumeError](./src/errors/HumeError.ts) will be thrown:
123
125
import { HumeError , HumeTimeoutError } from " hume" ;
124
126
125
127
try {
126
- await hume .expressionMeasurement .batch .submitJob (/* ... */ );
128
+ await hume .expressionMeasurement .batch .startInferenceJob (/* ... */ );
127
129
} catch (err ) {
128
130
if (err instanceof HumeTimeoutError ) {
129
131
console .log (" Request timed out" , err );
@@ -142,7 +144,7 @@ try {
142
144
You can use the maxRetries option to configure this behavior:
143
145
144
146
``` typescript
145
- await hume .expressionMeasurement .batch .submitJob (... , {
147
+ await hume .expressionMeasurement .batch .startInferenceJob (... , {
146
148
maxRetries: 0 , // disable retries
147
149
});
148
150
```
@@ -153,7 +155,7 @@ By default, the SDK has a timeout of 60s. You can use the `timeoutInSeconds` opt
153
155
this behavior
154
156
155
157
``` typescript
156
- await hume .expressionMeasurement .batch .submitJob (... , {
158
+ await hume .expressionMeasurement .batch .startInferenceJob (... , {
157
159
timeoutInSeconds: 10 , // timeout after 10 seconds
158
160
});
159
161
```
0 commit comments