@mastra/voice-openai-realtime 0.14.4 → 0.14.5
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/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-voice-voice.addInstructions.md +1 -1
- package/dist/docs/references/reference-voice-voice.addTools.md +1 -1
- package/dist/docs/references/reference-voice-voice.answer.md +1 -1
- package/dist/docs/references/reference-voice-voice.close.md +1 -1
- package/dist/docs/references/reference-voice-voice.listen.md +1 -1
- package/dist/docs/references/reference-voice-voice.off.md +1 -1
- package/dist/docs/references/reference-voice-voice.on.md +1 -1
- package/dist/docs/references/reference-voice-voice.send.md +2 -2
- package/dist/docs/references/reference-voice-voice.updateConfig.md +1 -1
- package/package.json +5 -5
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-voice-openai-realtime
|
|
|
3
3
|
description: Documentation for @mastra/voice-openai-realtime. Use when working with @mastra/voice-openai-realtime APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/voice-openai-realtime"
|
|
6
|
-
version: "0.14.
|
|
6
|
+
version: "0.14.5"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -54,7 +54,7 @@ This method doesn't return a value.
|
|
|
54
54
|
|
|
55
55
|
- Instructions are most effective when they're clear, specific, and relevant to the voice interaction
|
|
56
56
|
- This method is primarily used with real-time voice providers that maintain conversation context
|
|
57
|
-
- If called on a voice provider that doesn't support instructions, it will
|
|
57
|
+
- If called on a voice provider that doesn't support instructions, it will do nothing
|
|
58
58
|
- Instructions added with this method are typically combined with any instructions provided by an associated Agent
|
|
59
59
|
- For best results, add instructions before starting a conversation (before calling `connect()`)
|
|
60
60
|
- Multiple calls to `addInstructions()` may either replace or append to existing instructions, depending on the provider implementation
|
|
@@ -64,7 +64,7 @@ This method doesn't return a value.
|
|
|
64
64
|
|
|
65
65
|
- Tools must follow the Mastra tool format with name, description, input schema, and execute function
|
|
66
66
|
- This method is primarily used with real-time voice providers that support function calling
|
|
67
|
-
- If called on a voice provider that doesn't support tools, it will
|
|
67
|
+
- If called on a voice provider that doesn't support tools, it will do nothing
|
|
68
68
|
- Tools added with this method are typically combined with any tools provided by an associated Agent
|
|
69
69
|
- For best results, add tools before starting a conversation (before calling `connect()`)
|
|
70
70
|
- The voice provider will automatically handle the invocation of tool handlers when the model decides to use them
|
|
@@ -52,7 +52,7 @@ Returns a `Promise<void>` that resolves when the response has been triggered.
|
|
|
52
52
|
## Notes
|
|
53
53
|
|
|
54
54
|
- This method is only implemented by real-time voice providers that support speech-to-speech capabilities
|
|
55
|
-
- If called on a voice provider that doesn't support this functionality, it will log a
|
|
55
|
+
- If called on a voice provider that doesn't support this functionality, it will log a debug message and resolve immediately
|
|
56
56
|
- The response audio will typically be emitted through the 'speaking' event rather than returned directly
|
|
57
57
|
- For providers that support it, you can use this method to send a specific response instead of having the AI generate one
|
|
58
58
|
- This method is commonly used in conjunction with `send()` to create a conversational flow
|
|
@@ -51,5 +51,5 @@ This method doesn't return a value.
|
|
|
51
51
|
- Always call `close()` when you're done with a real-time voice session to free up resources
|
|
52
52
|
- After calling `close()`, you'll need to call `connect()` again if you want to start a new session
|
|
53
53
|
- This method is primarily used with real-time voice providers that maintain persistent connections
|
|
54
|
-
- If called on a voice provider that doesn't support real-time connections, it will log a
|
|
54
|
+
- If called on a voice provider that doesn't support real-time connections, it will log a debug message and do nothing
|
|
55
55
|
- Failing to close connections can lead to resource leaks and potential billing issues with voice service providers
|
|
@@ -8,7 +8,7 @@ The `listen()` method is a core function available in all Mastra voice providers
|
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
11
|
-
**audioStream** (`NodeJS.ReadableStream`): Audio
|
|
11
|
+
**audioStream** (`NodeJS.ReadableStream | unknown`): Audio to transcribe. This is usually a file stream or a microphone stream; some realtime providers accept other audio input types.
|
|
12
12
|
|
|
13
13
|
**options** (`object`): Provider-specific options for speech recognition
|
|
14
14
|
|
|
@@ -54,5 +54,5 @@ This method doesn't return a value.
|
|
|
54
54
|
- The callback passed to `off()` must be the same function reference that was passed to `on()`
|
|
55
55
|
- If the callback isn't found, the method will have no effect
|
|
56
56
|
- This method is primarily used with real-time voice providers that support event-based communication
|
|
57
|
-
- If called on a voice provider that doesn't support events, it will log a
|
|
57
|
+
- If called on a voice provider that doesn't support events, it will log a debug message and do nothing
|
|
58
58
|
- Removing event listeners is important for preventing memory leaks in long-running applications
|
|
@@ -107,7 +107,7 @@ voice.on('speaker', stream => {
|
|
|
107
107
|
## Notes
|
|
108
108
|
|
|
109
109
|
- This method is primarily used with real-time voice providers that support event-based communication
|
|
110
|
-
- If called on a voice provider that doesn't support events, it will log a
|
|
110
|
+
- If called on a voice provider that doesn't support events, it will log a debug message and do nothing
|
|
111
111
|
- Event listeners should be registered before calling methods that might emit events
|
|
112
112
|
- To remove an event listener, use the [voice.off()](https://mastra.ai/reference/voice/voice.off) method with the same event name and callback function
|
|
113
113
|
- Multiple listeners can be registered for the same event
|
|
@@ -56,12 +56,12 @@ await voice.send(audioBuffer)
|
|
|
56
56
|
|
|
57
57
|
## Return value
|
|
58
58
|
|
|
59
|
-
Returns a `Promise<void
|
|
59
|
+
Returns a `Promise<void>`. For providers that support real-time audio, it resolves when the provider has accepted the audio data. The default implementation sends nothing and resolves immediately.
|
|
60
60
|
|
|
61
61
|
## Notes
|
|
62
62
|
|
|
63
63
|
- This method is only implemented by real-time voice providers that support speech-to-speech capabilities
|
|
64
|
-
- If called on a voice provider that doesn't support this functionality, it will log a
|
|
64
|
+
- If called on a voice provider that doesn't support this functionality, it will log a debug message and resolve immediately
|
|
65
65
|
- You must call `connect()` before using `send()` to establish the WebSocket connection
|
|
66
66
|
- The audio format requirements depend on the specific voice provider
|
|
67
67
|
- For continuous conversation, you typically call `send()` to transmit user audio, then `answer()` to trigger the AI response
|
|
@@ -57,7 +57,7 @@ Different voice providers support different configuration options:
|
|
|
57
57
|
|
|
58
58
|
## Notes
|
|
59
59
|
|
|
60
|
-
- The default implementation logs a
|
|
60
|
+
- The default implementation logs a debug message if the provider doesn't support this method
|
|
61
61
|
- Configuration updates are typically applied to subsequent operations, not ongoing ones
|
|
62
62
|
- Not all properties that can be set in the constructor can be updated at runtime
|
|
63
63
|
- The specific behavior depends on the voice provider implementation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/voice-openai-realtime",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.5",
|
|
4
4
|
"description": "Mastra OpenAI Realtime API integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"openai-realtime-api": "^1.0.8",
|
|
27
27
|
"ws": "^8.21.3",
|
|
28
|
-
"@mastra/schema-compat": "1.3.
|
|
28
|
+
"@mastra/schema-compat": "1.3.14"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "22.20.1",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"typescript": "^7.0.2",
|
|
39
39
|
"vitest": "4.1.11",
|
|
40
40
|
"zod": "^4.6.4",
|
|
41
|
-
"@internal/
|
|
42
|
-
"@internal/
|
|
43
|
-
"@internal/
|
|
41
|
+
"@internal/types-builder": "0.0.118",
|
|
42
|
+
"@internal/lint": "0.0.143",
|
|
43
|
+
"@internal/voice": "0.0.41"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"zod": "^3.25.0 || ^4.0.0"
|