@mastra/voice-inworld 0.3.0 → 0.3.2
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/_types/@internal_voice/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +11 -8
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-voice-inworld-realtime.md +5 -5
- package/dist/docs/references/reference-voice-inworld.md +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +10 -9
|
@@ -1549,16 +1549,16 @@ declare interface EventSourceMessage {
|
|
|
1549
1549
|
* implementation in that browsers will default this to `message`, whereas this parser will
|
|
1550
1550
|
* leave this as `undefined` if not explicitly declared.
|
|
1551
1551
|
*/
|
|
1552
|
-
event?: string | undefined
|
|
1552
|
+
event?: string | undefined;
|
|
1553
1553
|
/**
|
|
1554
1554
|
* ID of the message, if any was provided by the server. Can be used by clients to keep the
|
|
1555
1555
|
* last received message ID in sync when reconnecting.
|
|
1556
1556
|
*/
|
|
1557
|
-
id?: string | undefined
|
|
1557
|
+
id?: string | undefined;
|
|
1558
1558
|
/**
|
|
1559
1559
|
* The data received for this message
|
|
1560
1560
|
*/
|
|
1561
|
-
data: string
|
|
1561
|
+
data: string;
|
|
1562
1562
|
}
|
|
1563
1563
|
|
|
1564
1564
|
/**
|
|
@@ -1582,8 +1582,11 @@ declare interface EventSourceMessage {
|
|
|
1582
1582
|
*
|
|
1583
1583
|
* @public
|
|
1584
1584
|
*/
|
|
1585
|
-
declare class EventSourceParserStream extends TransformStream<
|
|
1586
|
-
|
|
1585
|
+
declare class EventSourceParserStream extends TransformStream<
|
|
1586
|
+
string,
|
|
1587
|
+
EventSourceMessage
|
|
1588
|
+
> {
|
|
1589
|
+
constructor({ onError, onRetry, onComment }?: StreamOptions);
|
|
1587
1590
|
}
|
|
1588
1591
|
|
|
1589
1592
|
/**
|
|
@@ -6830,19 +6833,19 @@ declare interface StreamOptions {
|
|
|
6830
6833
|
*
|
|
6831
6834
|
* @defaultValue `undefined`
|
|
6832
6835
|
*/
|
|
6833
|
-
onError?: (
|
|
6836
|
+
onError?: ("terminate" | ((error: Error) => void)) | undefined;
|
|
6834
6837
|
/**
|
|
6835
6838
|
* Callback for when a reconnection interval is sent from the server.
|
|
6836
6839
|
*
|
|
6837
6840
|
* @param retry - The number of milliseconds to wait before reconnecting.
|
|
6838
6841
|
*/
|
|
6839
|
-
onRetry?: ((retry: number) => void) | undefined
|
|
6842
|
+
onRetry?: ((retry: number) => void) | undefined;
|
|
6840
6843
|
/**
|
|
6841
6844
|
* Callback for when a comment is encountered in the stream.
|
|
6842
6845
|
*
|
|
6843
6846
|
* @param comment - The comment encountered in the stream.
|
|
6844
6847
|
*/
|
|
6845
|
-
onComment?: ((comment: string) => void) | undefined
|
|
6848
|
+
onComment?: ((comment: string) => void) | undefined;
|
|
6846
6849
|
}
|
|
6847
6850
|
|
|
6848
6851
|
/**
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-voice-inworld
|
|
|
3
3
|
description: Documentation for @mastra/voice-inworld. Use when working with @mastra/voice-inworld APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/voice-inworld"
|
|
6
|
-
version: "0.3.
|
|
6
|
+
version: "0.3.2"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -54,7 +54,7 @@ await voice.send(microphoneStream)
|
|
|
54
54
|
voice.close()
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
> Inworld API keys ship pre-Basic-encoded. Paste them verbatim into `INWORLD_API_KEY`; the package
|
|
57
|
+
> Inworld API keys ship pre-Basic-encoded. Paste them verbatim into `INWORLD_API_KEY`; the package doesn't re-encode them.
|
|
58
58
|
|
|
59
59
|
## Constructor parameters
|
|
60
60
|
|
|
@@ -116,7 +116,7 @@ Use the typed `session` field for documented Inworld realtime options. Fields co
|
|
|
116
116
|
|
|
117
117
|
### `providerData` (Inworld extensions)
|
|
118
118
|
|
|
119
|
-
`providerData` is a typed object for Inworld-specific realtime extensions. It
|
|
119
|
+
`providerData` is a typed object for Inworld-specific realtime extensions. It's sent under `session.providerData` on every `session.update`, and composes with any `session.providerData` you set via the `session` field — the constructor `providerData` wins on key collisions.
|
|
120
120
|
|
|
121
121
|
It has five branches plus two session-level fields:
|
|
122
122
|
|
|
@@ -342,12 +342,12 @@ Any voice ID from [Inworld's voice catalog](https://docs.inworld.ai/quickstart-t
|
|
|
342
342
|
|
|
343
343
|
## Notes
|
|
344
344
|
|
|
345
|
-
- API keys can be provided via constructor options or the `INWORLD_API_KEY` environment variable. Keys are pre-Basic-encoded;
|
|
345
|
+
- API keys can be provided via constructor options or the `INWORLD_API_KEY` environment variable. Keys are pre-Basic-encoded; don't re-encode them.
|
|
346
346
|
- The WebSocket URL appends `?key=<sessionId>&protocol=realtime`. The model is configured via the initial `session.update`, not the URL.
|
|
347
|
-
- Per-call `speak(input, { speaker })` scopes the voice override to a single response (via the flat `response.voice` field) and
|
|
347
|
+
- Per-call `speak(input, { speaker })` scopes the voice override to a single response (via the flat `response.voice` field) and doesn't mutate the session.
|
|
348
348
|
- Audio output defaults to PCM16 at 24 kHz. Telephony `audio/pcmu` and `audio/pcma` at 8 kHz, and `audio/float32`, are also supported via `session.audio.output.format`.
|
|
349
349
|
- Use `connect()` before any send, speak, or listen call. Events sent before the WebSocket is open are queued and flushed once the server acknowledges `session.updated`.
|
|
350
350
|
- The voice instance must be closed with `close()` or `disconnect()` to release the WebSocket.
|
|
351
|
-
- `audio.input.turn_detection` defaults to semantic VAD when `session`
|
|
351
|
+
- `audio.input.turn_detection` defaults to semantic VAD when `session` doesn't supply it. Override with your own object, or pass `null` to disable turn detection entirely.
|
|
352
352
|
- `audio.input.transcription` defaults to `{ model: 'inworld/inworld-stt-1' }`, so user-side `writing` events fire out of the box. Override with your own object, or pass `null` to disable user-side transcription.
|
|
353
353
|
- `on()` and `off()` are typed against `InworldVoiceEventMap` — known event names yield a typed callback payload, unknown names fall back to `unknown`.
|
|
@@ -130,6 +130,6 @@ const speakers = await voice.getSpeakers()
|
|
|
130
130
|
## Notes
|
|
131
131
|
|
|
132
132
|
- The TTS endpoint uses progressive NDJSON streaming, so audio playback can begin before the full response is received.
|
|
133
|
-
- An API key can be provided via the `speechModel` or `listeningModel` config, or the `INWORLD_API_KEY` environment variable. TTS and STT keys are resolved independently: passing distinct `speechModel.apiKey` and `listeningModel.apiKey` values lets each service use its own credential. If only one is provided, it
|
|
133
|
+
- An API key can be provided via the `speechModel` or `listeningModel` config, or the `INWORLD_API_KEY` environment variable. TTS and STT keys are resolved independently: passing distinct `speechModel.apiKey` and `listeningModel.apiKey` values lets each service use its own credential. If only one is provided, it's reused for both services as a fallback before the env var.
|
|
134
134
|
- `inworld-tts-2` is the default flagship model. Use `deliveryMode` (`STABLE` | `BALANCED` | `CREATIVE`) to steer delivery style on this model. The `temperature` option is ignored on `inworld-tts-2`.
|
|
135
135
|
- The `inworld-tts-1.5-mini` model offers lower latency at the cost of reduced voice quality compared to `inworld-tts-1.5-max`.
|
package/dist/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ var zodToJsonSchema = require('zod-to-json-schema');
|
|
|
7
7
|
|
|
8
8
|
// src/index.ts
|
|
9
9
|
|
|
10
|
-
// ../../packages/_internal-core/dist/chunk-
|
|
10
|
+
// ../../packages/_internal-core/dist/chunk-3M4SEWMI.js
|
|
11
11
|
var RegisteredLogger = {
|
|
12
12
|
LLM: "LLM"};
|
|
13
13
|
var LogLevel = {
|
|
@@ -104,7 +104,7 @@ var ConsoleLogger = class _ConsoleLogger extends MastraLogger {
|
|
|
104
104
|
}
|
|
105
105
|
warn(message, ...args) {
|
|
106
106
|
if ((this.level === LogLevel.WARN || this.level === LogLevel.INFO || this.level === LogLevel.DEBUG) && this.shouldLog(LogLevel.WARN, message, args)) {
|
|
107
|
-
console.
|
|
107
|
+
console.warn(`${this.prefix()}${message}`, ...args);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
error(message, ...args) {
|