@mastra/voice-openai-realtime 0.2.0-alpha.4 → 0.2.0-alpha.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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +8 -0
- package/README.md +1 -0
- package/dist/index.cjs +11 -2
- package/dist/index.js +11 -2
- package/package.json +2 -2
- package/src/index.ts +15 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/voice-openai-realtime@0.2.0-alpha.
|
|
2
|
+
> @mastra/voice-openai-realtime@0.2.0-alpha.5 build /home/runner/work/mastra/mastra/voice/openai-realtime-api
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.4.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 9585ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[34mCLI[39m Target: es2022
|
|
12
12
|
Analysis will use the bundled TypeScript version 5.8.2
|
|
13
13
|
[36mWriting package typings: /home/runner/work/mastra/mastra/voice/openai-realtime-api/dist/_tsup-dts-rollup.d.ts[39m
|
|
14
14
|
Analysis will use the bundled TypeScript version 5.8.2
|
|
15
15
|
[36mWriting package typings: /home/runner/work/mastra/mastra/voice/openai-realtime-api/dist/_tsup-dts-rollup.d.cts[39m
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 11761ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
|
-
[32mESM[39m [1mdist/index.js [22m[
|
|
21
|
-
[32mESM[39m ⚡️ Build success in
|
|
22
|
-
[32mCJS[39m [1mdist/index.cjs [22m[
|
|
23
|
-
[32mCJS[39m ⚡️ Build success in
|
|
20
|
+
[32mESM[39m [1mdist/index.js [22m[32m19.06 KB[39m
|
|
21
|
+
[32mESM[39m ⚡️ Build success in 844ms
|
|
22
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m19.12 KB[39m
|
|
23
|
+
[32mCJS[39m ⚡️ Build success in 848ms
|
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -20,6 +20,7 @@ OPENAI_API_KEY=your_api_key
|
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
import { OpenAIRealtimeVoice } from '@mastra/voice-openai-realtime';
|
|
23
|
+
import { getMicrophoneStream } from '@mastra/node-audio';
|
|
23
24
|
|
|
24
25
|
// Create a voice instance with default configuration
|
|
25
26
|
const voice = new OpenAIRealtimeVoice();
|
package/dist/index.cjs
CHANGED
|
@@ -548,16 +548,25 @@ var OpenAIRealtimeVoice = class extends voice.MastraVoice {
|
|
|
548
548
|
console.warn(`Tool "${output.name}" not found`);
|
|
549
549
|
return;
|
|
550
550
|
}
|
|
551
|
+
if (tool?.execute) {
|
|
552
|
+
this.emit("tool-call-start", {
|
|
553
|
+
toolCallId: output.call_id,
|
|
554
|
+
toolName: output.name,
|
|
555
|
+
toolDescription: tool.description,
|
|
556
|
+
args: context
|
|
557
|
+
});
|
|
558
|
+
}
|
|
551
559
|
const result = await tool?.execute?.(
|
|
552
560
|
{ context },
|
|
553
561
|
{
|
|
554
|
-
toolCallId:
|
|
562
|
+
toolCallId: output.call_id,
|
|
555
563
|
messages: []
|
|
556
564
|
}
|
|
557
565
|
);
|
|
558
|
-
this.emit("tool-result", {
|
|
566
|
+
this.emit("tool-call-result", {
|
|
559
567
|
toolCallId: output.call_id,
|
|
560
568
|
toolName: output.name,
|
|
569
|
+
toolDescription: tool.description,
|
|
561
570
|
args: context,
|
|
562
571
|
result
|
|
563
572
|
});
|
package/dist/index.js
CHANGED
|
@@ -546,16 +546,25 @@ var OpenAIRealtimeVoice = class extends MastraVoice {
|
|
|
546
546
|
console.warn(`Tool "${output.name}" not found`);
|
|
547
547
|
return;
|
|
548
548
|
}
|
|
549
|
+
if (tool?.execute) {
|
|
550
|
+
this.emit("tool-call-start", {
|
|
551
|
+
toolCallId: output.call_id,
|
|
552
|
+
toolName: output.name,
|
|
553
|
+
toolDescription: tool.description,
|
|
554
|
+
args: context
|
|
555
|
+
});
|
|
556
|
+
}
|
|
549
557
|
const result = await tool?.execute?.(
|
|
550
558
|
{ context },
|
|
551
559
|
{
|
|
552
|
-
toolCallId:
|
|
560
|
+
toolCallId: output.call_id,
|
|
553
561
|
messages: []
|
|
554
562
|
}
|
|
555
563
|
);
|
|
556
|
-
this.emit("tool-result", {
|
|
564
|
+
this.emit("tool-call-result", {
|
|
557
565
|
toolCallId: output.call_id,
|
|
558
566
|
toolName: output.name,
|
|
567
|
+
toolDescription: tool.description,
|
|
559
568
|
args: context,
|
|
560
569
|
result
|
|
561
570
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/voice-openai-realtime",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.5",
|
|
4
4
|
"description": "Mastra OpenAI Realtime API integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"openai-realtime-api": "^1.0.7",
|
|
24
24
|
"ws": "^8.18.1",
|
|
25
25
|
"zod-to-json-schema": "^3.24.5",
|
|
26
|
-
"@mastra/core": "^0.
|
|
26
|
+
"@mastra/core": "^0.9.0-alpha.3"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@microsoft/api-extractor": "^7.52.2",
|
package/src/index.ts
CHANGED
|
@@ -627,19 +627,32 @@ export class OpenAIRealtimeVoice extends MastraVoice {
|
|
|
627
627
|
console.warn(`Tool "${output.name}" not found`);
|
|
628
628
|
return;
|
|
629
629
|
}
|
|
630
|
+
|
|
631
|
+
if (tool?.execute) {
|
|
632
|
+
this.emit('tool-call-start', {
|
|
633
|
+
toolCallId: output.call_id,
|
|
634
|
+
toolName: output.name,
|
|
635
|
+
toolDescription: tool.description,
|
|
636
|
+
args: context,
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
|
|
630
640
|
const result = await tool?.execute?.(
|
|
631
641
|
{ context },
|
|
632
642
|
{
|
|
633
|
-
toolCallId:
|
|
643
|
+
toolCallId: output.call_id,
|
|
634
644
|
messages: [],
|
|
635
645
|
},
|
|
636
646
|
);
|
|
637
|
-
|
|
647
|
+
|
|
648
|
+
this.emit('tool-call-result', {
|
|
638
649
|
toolCallId: output.call_id,
|
|
639
650
|
toolName: output.name,
|
|
651
|
+
toolDescription: tool.description,
|
|
640
652
|
args: context,
|
|
641
653
|
result,
|
|
642
654
|
});
|
|
655
|
+
|
|
643
656
|
this.sendEvent('conversation.item.create', {
|
|
644
657
|
item: {
|
|
645
658
|
type: 'function_call_output',
|