@speeq/core 0.2.0 → 0.3.0
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/dist/index.d.cts +16 -1
- package/dist/index.d.ts +16 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -205,8 +205,14 @@ interface LLMProvider {
|
|
|
205
205
|
interface SpeechInputHandlers {
|
|
206
206
|
/** Partial transcript while the user is speaking. */
|
|
207
207
|
onInterim?(transcript: string): void;
|
|
208
|
-
/**
|
|
208
|
+
/**
|
|
209
|
+
* Final transcript. In single-utterance mode this is called once when recognition ends. In
|
|
210
|
+
* {@link SpeechInputOptions.continuous} mode it is called for every finished phrase while
|
|
211
|
+
* recognition keeps running.
|
|
212
|
+
*/
|
|
209
213
|
onFinal(transcript: string): void;
|
|
214
|
+
/** Sound that looks like speech was detected (before any transcript exists). Optional. */
|
|
215
|
+
onSpeechStart?(): void;
|
|
210
216
|
/** Recognition failed (no permission, no speech, network). */
|
|
211
217
|
onError?(error: {
|
|
212
218
|
code: "not-allowed" | "no-speech" | "network" | "aborted" | "unsupported" | "other";
|
|
@@ -221,6 +227,11 @@ interface SpeechInputOptions {
|
|
|
221
227
|
language: string;
|
|
222
228
|
/** Emit interim transcripts. Default `true`. */
|
|
223
229
|
interimResults?: boolean;
|
|
230
|
+
/**
|
|
231
|
+
* Keep listening after a pause and deliver each finished phrase through `onFinal`. Used for
|
|
232
|
+
* hands-free calls. Default `false` (one utterance, then recognition ends).
|
|
233
|
+
*/
|
|
234
|
+
continuous?: boolean;
|
|
224
235
|
}
|
|
225
236
|
/** Speech-to-text. The default implementation uses the browser Web Speech API. */
|
|
226
237
|
interface SpeechInput {
|
|
@@ -247,6 +258,10 @@ interface SpeechOutput {
|
|
|
247
258
|
speak(text: string, options: SpeakOptions): Promise<void>;
|
|
248
259
|
/** Stops speaking and clears the queue. */
|
|
249
260
|
cancel(): void;
|
|
261
|
+
/** Pauses the current utterance so that `resume()` can continue from the same spot. Optional. */
|
|
262
|
+
pause?(): void;
|
|
263
|
+
/** Continues after `pause()`. Optional. */
|
|
264
|
+
resume?(): void;
|
|
250
265
|
}
|
|
251
266
|
|
|
252
267
|
/** A tool call as recorded on an assistant message. */
|
package/dist/index.d.ts
CHANGED
|
@@ -205,8 +205,14 @@ interface LLMProvider {
|
|
|
205
205
|
interface SpeechInputHandlers {
|
|
206
206
|
/** Partial transcript while the user is speaking. */
|
|
207
207
|
onInterim?(transcript: string): void;
|
|
208
|
-
/**
|
|
208
|
+
/**
|
|
209
|
+
* Final transcript. In single-utterance mode this is called once when recognition ends. In
|
|
210
|
+
* {@link SpeechInputOptions.continuous} mode it is called for every finished phrase while
|
|
211
|
+
* recognition keeps running.
|
|
212
|
+
*/
|
|
209
213
|
onFinal(transcript: string): void;
|
|
214
|
+
/** Sound that looks like speech was detected (before any transcript exists). Optional. */
|
|
215
|
+
onSpeechStart?(): void;
|
|
210
216
|
/** Recognition failed (no permission, no speech, network). */
|
|
211
217
|
onError?(error: {
|
|
212
218
|
code: "not-allowed" | "no-speech" | "network" | "aborted" | "unsupported" | "other";
|
|
@@ -221,6 +227,11 @@ interface SpeechInputOptions {
|
|
|
221
227
|
language: string;
|
|
222
228
|
/** Emit interim transcripts. Default `true`. */
|
|
223
229
|
interimResults?: boolean;
|
|
230
|
+
/**
|
|
231
|
+
* Keep listening after a pause and deliver each finished phrase through `onFinal`. Used for
|
|
232
|
+
* hands-free calls. Default `false` (one utterance, then recognition ends).
|
|
233
|
+
*/
|
|
234
|
+
continuous?: boolean;
|
|
224
235
|
}
|
|
225
236
|
/** Speech-to-text. The default implementation uses the browser Web Speech API. */
|
|
226
237
|
interface SpeechInput {
|
|
@@ -247,6 +258,10 @@ interface SpeechOutput {
|
|
|
247
258
|
speak(text: string, options: SpeakOptions): Promise<void>;
|
|
248
259
|
/** Stops speaking and clears the queue. */
|
|
249
260
|
cancel(): void;
|
|
261
|
+
/** Pauses the current utterance so that `resume()` can continue from the same spot. Optional. */
|
|
262
|
+
pause?(): void;
|
|
263
|
+
/** Continues after `pause()`. Optional. */
|
|
264
|
+
resume?(): void;
|
|
250
265
|
}
|
|
251
266
|
|
|
252
267
|
/** A tool call as recorded on an assistant message. */
|