@mastra/voice-google-gemini-live 0.0.0-monorepo-binary-20251013210052 → 0.0.0-partial-response-backport-20251204204441

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/CHANGELOG.md CHANGED
@@ -1,6 +1,98 @@
1
1
  # @mastra/voice-google-gemini-live
2
2
 
3
- ## 0.0.0-monorepo-binary-20251013210052
3
+ ## 0.0.0-partial-response-backport-20251204204441
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`5cc85aa`](https://github.com/mastra-ai/mastra/commit/5cc85aa4329773cac8314f3aa0146227b6b158e4), [`386ab43`](https://github.com/mastra-ai/mastra/commit/386ab4350cf2a814fb4ac0a5fc6983ca93158ffe), [`2b62302`](https://github.com/mastra-ai/mastra/commit/2b623027a9d65c1dbc963bf651e9e6a9d09da1fa), [`7d85da4`](https://github.com/mastra-ai/mastra/commit/7d85da42a5fab56009a959a9c20328558d14f4b5), [`31b381e`](https://github.com/mastra-ai/mastra/commit/31b381efb48e031c0ecc46bc6e410ae6e67b88e5), [`54cc99c`](https://github.com/mastra-ai/mastra/commit/54cc99cb99483b9e08ec41fa1502f43b71b4c351), [`e77a5f9`](https://github.com/mastra-ai/mastra/commit/e77a5f9718dc418e29e3c8a389299ed6dc0a6401), [`b069af5`](https://github.com/mastra-ai/mastra/commit/b069af514c4dcfc4fdcb164303569bfff1c26e3d), [`7dc8304`](https://github.com/mastra-ai/mastra/commit/7dc830420296db516b86dcec663e54d0309b8fb8), [`62d13f4`](https://github.com/mastra-ai/mastra/commit/62d13f4d1db1c16742831f210fe4c2caf8a26d57)]:
8
+ - @mastra/core@0.0.0-partial-response-backport-20251204204441
9
+
10
+ ## 0.11.1
11
+
12
+ ### Patch Changes
13
+
14
+ - fix(voice): Fix Vertex AI WebSocket connection failures in GeminiLiveVoice ([#10292](https://github.com/mastra-ai/mastra/pull/10292))
15
+
16
+ - Updated dependencies [[`7491cc0`](https://github.com/mastra-ai/mastra/commit/7491cc0350b2ba067f98c4915bf607119bd0150f), [`0d10ac7`](https://github.com/mastra-ai/mastra/commit/0d10ac7b8efa03c2f0c330eb2520148bfa6091e9), [`e3e899c`](https://github.com/mastra-ai/mastra/commit/e3e899c650f4c435445303bd97a66f5840a52a1e)]:
17
+ - @mastra/core@0.24.3
18
+
19
+ ## 0.11.1-alpha.0
20
+
21
+ ### Patch Changes
22
+
23
+ - fix(voice): Fix Vertex AI WebSocket connection failures in GeminiLiveVoice ([#10292](https://github.com/mastra-ai/mastra/pull/10292))
24
+
25
+ - Updated dependencies [[`7491cc0`](https://github.com/mastra-ai/mastra/commit/7491cc0350b2ba067f98c4915bf607119bd0150f), [`0d10ac7`](https://github.com/mastra-ai/mastra/commit/0d10ac7b8efa03c2f0c330eb2520148bfa6091e9), [`e3e899c`](https://github.com/mastra-ai/mastra/commit/e3e899c650f4c435445303bd97a66f5840a52a1e)]:
26
+ - @mastra/core@0.24.3-alpha.0
27
+
28
+ ## 0.11.0
29
+
30
+ ### Minor Changes
31
+
32
+ - Backport gemini fix to 0.x ([#10234](https://github.com/mastra-ai/mastra/pull/10234))
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies [[`eebb7bb`](https://github.com/mastra-ai/mastra/commit/eebb7bb407c57342a3be3a2efbe68c696589feeb), [`c6e6d07`](https://github.com/mastra-ai/mastra/commit/c6e6d071ecf346a80dceab410af2c567c7e66a57), [`0e6df8f`](https://github.com/mastra-ai/mastra/commit/0e6df8f66340992cb1b319834657deb17368de52), [`6295fd7`](https://github.com/mastra-ai/mastra/commit/6295fd783d49075d5bf2c18ff9486e94d36aaa56), [`d813cf7`](https://github.com/mastra-ai/mastra/commit/d813cf7251695d85cc60469058384ffa74974484)]:
37
+ - @mastra/core@0.24.2
38
+
39
+ ## 0.11.0-alpha.0
40
+
41
+ ### Minor Changes
42
+
43
+ - Backport gemini fix to 0.x ([#10234](https://github.com/mastra-ai/mastra/pull/10234))
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies [[`eebb7bb`](https://github.com/mastra-ai/mastra/commit/eebb7bb407c57342a3be3a2efbe68c696589feeb), [`c6e6d07`](https://github.com/mastra-ai/mastra/commit/c6e6d071ecf346a80dceab410af2c567c7e66a57), [`0e6df8f`](https://github.com/mastra-ai/mastra/commit/0e6df8f66340992cb1b319834657deb17368de52), [`6295fd7`](https://github.com/mastra-ai/mastra/commit/6295fd783d49075d5bf2c18ff9486e94d36aaa56), [`d813cf7`](https://github.com/mastra-ai/mastra/commit/d813cf7251695d85cc60469058384ffa74974484)]:
48
+ - @mastra/core@0.24.2-alpha.0
49
+
50
+ ## 0.10.18
51
+
52
+ ### Patch Changes
53
+
54
+ - update peerdeps ([`5ca1cca`](https://github.com/mastra-ai/mastra/commit/5ca1ccac61ffa7141e6d9fa8f22d3ad4d03bf5dc))
55
+
56
+ - Updated dependencies [[`5ca1cca`](https://github.com/mastra-ai/mastra/commit/5ca1ccac61ffa7141e6d9fa8f22d3ad4d03bf5dc), [`6d7e90d`](https://github.com/mastra-ai/mastra/commit/6d7e90db09713e6250f4d6c3d3cff1b4740e50f9), [`f78b908`](https://github.com/mastra-ai/mastra/commit/f78b9080e11af765969b36b4a619761056030840), [`23c2614`](https://github.com/mastra-ai/mastra/commit/23c26140fdbf04b8c59e8d7d52106d67dad962ec), [`e365eda`](https://github.com/mastra-ai/mastra/commit/e365eda45795b43707310531cac1e2ce4e5a0712)]:
57
+ - @mastra/core@0.24.0
58
+
59
+ ## 0.10.18-alpha.0
60
+
61
+ ### Patch Changes
62
+
63
+ - update peerdeps ([`5ca1cca`](https://github.com/mastra-ai/mastra/commit/5ca1ccac61ffa7141e6d9fa8f22d3ad4d03bf5dc))
64
+
65
+ - Updated dependencies [[`5ca1cca`](https://github.com/mastra-ai/mastra/commit/5ca1ccac61ffa7141e6d9fa8f22d3ad4d03bf5dc), [`6d7e90d`](https://github.com/mastra-ai/mastra/commit/6d7e90db09713e6250f4d6c3d3cff1b4740e50f9), [`f78b908`](https://github.com/mastra-ai/mastra/commit/f78b9080e11af765969b36b4a619761056030840), [`23c2614`](https://github.com/mastra-ai/mastra/commit/23c26140fdbf04b8c59e8d7d52106d67dad962ec), [`e365eda`](https://github.com/mastra-ai/mastra/commit/e365eda45795b43707310531cac1e2ce4e5a0712)]:
66
+ - @mastra/core@0.24.0-alpha.0
67
+
68
+ ## 0.10.17
69
+
70
+ ### Patch Changes
71
+
72
+ - Fix peerdependencies ([`eb7c1c8`](https://github.com/mastra-ai/mastra/commit/eb7c1c8c592d8fb16dfd250e337d9cdc73c8d5de))
73
+
74
+ - Updated dependencies []:
75
+ - @mastra/core@0.23.1
76
+
77
+ ## 0.10.16
78
+
79
+ ### Patch Changes
80
+
81
+ - Update peerdeps to 0.23.0-0 ([#9043](https://github.com/mastra-ai/mastra/pull/9043))
82
+
83
+ - Updated dependencies [[`c67ca32`](https://github.com/mastra-ai/mastra/commit/c67ca32e3c2cf69bfc146580770c720220ca44ac), [`efb5ed9`](https://github.com/mastra-ai/mastra/commit/efb5ed946ae7f410bc68c9430beb4b010afd25ec), [`dbc9e12`](https://github.com/mastra-ai/mastra/commit/dbc9e1216ba575ba59ead4afb727a01215f7de4f), [`99e41b9`](https://github.com/mastra-ai/mastra/commit/99e41b94957cdd25137d3ac12e94e8b21aa01b68), [`c28833c`](https://github.com/mastra-ai/mastra/commit/c28833c5b6d8e10eeffd7f7d39129d53b8bca240), [`8ea07b4`](https://github.com/mastra-ai/mastra/commit/8ea07b4bdc73e4218437dbb6dcb0f4b23e745a44), [`ba201b8`](https://github.com/mastra-ai/mastra/commit/ba201b8f8feac4c72350f2dbd52c13c7297ba7b0), [`f053e89`](https://github.com/mastra-ai/mastra/commit/f053e89160dbd0bd3333fc3492f68231b5c7c349), [`4fc4136`](https://github.com/mastra-ai/mastra/commit/4fc413652866a8d2240694fddb2562e9edbb70df), [`b78e04d`](https://github.com/mastra-ai/mastra/commit/b78e04d935a16ecb1e59c5c96e564903527edddd), [`d10baf5`](https://github.com/mastra-ai/mastra/commit/d10baf5a3c924f2a6654e23a3e318ed03f189b76), [`038c55a`](https://github.com/mastra-ai/mastra/commit/038c55a7090fc1b1513a966386d3072617f836ac), [`182f045`](https://github.com/mastra-ai/mastra/commit/182f0458f25bd70aa774e64fd923c8a483eddbf1), [`9a1a485`](https://github.com/mastra-ai/mastra/commit/9a1a4859b855e37239f652bf14b1ecd1029b8c4e), [`9257233`](https://github.com/mastra-ai/mastra/commit/9257233c4ffce09b2bedc2a9adbd70d7a83fa8e2), [`7620d2b`](https://github.com/mastra-ai/mastra/commit/7620d2bddeb4fae4c3c0a0b4e672969795fca11a), [`b2365f0`](https://github.com/mastra-ai/mastra/commit/b2365f038dd4c5f06400428b224af963f399ad50), [`0f1a4c9`](https://github.com/mastra-ai/mastra/commit/0f1a4c984fb4b104b2f0b63ba18c9fa77f567700), [`9029ba3`](https://github.com/mastra-ai/mastra/commit/9029ba34459c8859fed4c6b73efd8e2d0021e7ba), [`426cc56`](https://github.com/mastra-ai/mastra/commit/426cc561c85ae76a112ded2385532a91f9f9f074), [`00931fb`](https://github.com/mastra-ai/mastra/commit/00931fb1a21aa42c4fbc20c2c40dd62466b8fc8f), [`e473bfe`](https://github.com/mastra-ai/mastra/commit/e473bfe416c0b8e876973c2b6a6f13c394b7a93f), [`b78e04d`](https://github.com/mastra-ai/mastra/commit/b78e04d935a16ecb1e59c5c96e564903527edddd), [`2db6160`](https://github.com/mastra-ai/mastra/commit/2db6160e2022ff8827c15d30157e684683b934b5), [`8aeea37`](https://github.com/mastra-ai/mastra/commit/8aeea37efdde347c635a67fed56794943b7f74ec), [`02fe153`](https://github.com/mastra-ai/mastra/commit/02fe15351d6021d214da48ec982a0e9e4150bcee), [`648e2ca`](https://github.com/mastra-ai/mastra/commit/648e2ca42da54838c6ccbdaadc6fadd808fa6b86), [`74567b3`](https://github.com/mastra-ai/mastra/commit/74567b3d237ae3915cd0bca3cf55fa0a64e4e4a4), [`b65c5e0`](https://github.com/mastra-ai/mastra/commit/b65c5e0fe6f3c390a9a8bbcf69304d972c3a4afb), [`15a1733`](https://github.com/mastra-ai/mastra/commit/15a1733074cee8bd37370e1af34cd818e89fa7ac), [`fc2a774`](https://github.com/mastra-ai/mastra/commit/fc2a77468981aaddc3e77f83f0c4ad4a4af140da), [`4e08933`](https://github.com/mastra-ai/mastra/commit/4e08933625464dfde178347af5b6278fcf34188e)]:
84
+ - @mastra/core@0.22.0
85
+
86
+ ## 0.10.16-alpha.0
87
+
88
+ ### Patch Changes
89
+
90
+ - Update peerdeps to 0.23.0-0 ([#9043](https://github.com/mastra-ai/mastra/pull/9043))
91
+
92
+ - Updated dependencies [[`efb5ed9`](https://github.com/mastra-ai/mastra/commit/efb5ed946ae7f410bc68c9430beb4b010afd25ec), [`8ea07b4`](https://github.com/mastra-ai/mastra/commit/8ea07b4bdc73e4218437dbb6dcb0f4b23e745a44), [`ba201b8`](https://github.com/mastra-ai/mastra/commit/ba201b8f8feac4c72350f2dbd52c13c7297ba7b0), [`4fc4136`](https://github.com/mastra-ai/mastra/commit/4fc413652866a8d2240694fddb2562e9edbb70df), [`b78e04d`](https://github.com/mastra-ai/mastra/commit/b78e04d935a16ecb1e59c5c96e564903527edddd), [`d10baf5`](https://github.com/mastra-ai/mastra/commit/d10baf5a3c924f2a6654e23a3e318ed03f189b76), [`038c55a`](https://github.com/mastra-ai/mastra/commit/038c55a7090fc1b1513a966386d3072617f836ac), [`182f045`](https://github.com/mastra-ai/mastra/commit/182f0458f25bd70aa774e64fd923c8a483eddbf1), [`7620d2b`](https://github.com/mastra-ai/mastra/commit/7620d2bddeb4fae4c3c0a0b4e672969795fca11a), [`b2365f0`](https://github.com/mastra-ai/mastra/commit/b2365f038dd4c5f06400428b224af963f399ad50), [`9029ba3`](https://github.com/mastra-ai/mastra/commit/9029ba34459c8859fed4c6b73efd8e2d0021e7ba), [`426cc56`](https://github.com/mastra-ai/mastra/commit/426cc561c85ae76a112ded2385532a91f9f9f074), [`00931fb`](https://github.com/mastra-ai/mastra/commit/00931fb1a21aa42c4fbc20c2c40dd62466b8fc8f), [`e473bfe`](https://github.com/mastra-ai/mastra/commit/e473bfe416c0b8e876973c2b6a6f13c394b7a93f), [`b78e04d`](https://github.com/mastra-ai/mastra/commit/b78e04d935a16ecb1e59c5c96e564903527edddd), [`648e2ca`](https://github.com/mastra-ai/mastra/commit/648e2ca42da54838c6ccbdaadc6fadd808fa6b86), [`b65c5e0`](https://github.com/mastra-ai/mastra/commit/b65c5e0fe6f3c390a9a8bbcf69304d972c3a4afb)]:
93
+ - @mastra/core@0.22.0-alpha.1
94
+
95
+ ## 0.10.15
4
96
 
5
97
  ### Patch Changes
6
98
 
@@ -12,8 +104,8 @@
12
104
 
13
105
  - Update peer dependencies to match core package version bump (0.21.0) ([#8686](https://github.com/mastra-ai/mastra/pull/8686))
14
106
 
15
- - Updated dependencies [[`1ed9670`](https://github.com/mastra-ai/mastra/commit/1ed9670d3ca50cb60dc2e517738c5eef3968ed27), [`b5a66b7`](https://github.com/mastra-ai/mastra/commit/b5a66b748a14fc8b3f63b04642ddb9621fbcc9e0), [`158381d`](https://github.com/mastra-ai/mastra/commit/158381d39335be934b81ef8a1947bccace492c25), [`37a2314`](https://github.com/mastra-ai/mastra/commit/37a23148e0e5a3b40d4f9f098b194671a8a49faf), [`7b1ef57`](https://github.com/mastra-ai/mastra/commit/7b1ef57fc071c2aa2a2e32905b18cd88719c5a39), [`05a9dee`](https://github.com/mastra-ai/mastra/commit/05a9dee3d355694d28847bfffb6289657fcf7dfa), [`ee68e82`](https://github.com/mastra-ai/mastra/commit/ee68e8289ea4408d29849e899bc6e78b3bd4e843), [`228228b`](https://github.com/mastra-ai/mastra/commit/228228b0b1de9291cb8887587f5cea1a8757ebad), [`ea33930`](https://github.com/mastra-ai/mastra/commit/ea339301e82d6318257720d811b043014ee44064), [`b5a66b7`](https://github.com/mastra-ai/mastra/commit/b5a66b748a14fc8b3f63b04642ddb9621fbcc9e0), [`135d6f2`](https://github.com/mastra-ai/mastra/commit/135d6f22a326ed1dffff858700669dff09d2c9eb), [`59d036d`](https://github.com/mastra-ai/mastra/commit/59d036d4c2706b430b0e3f1f1e0ee853ce16ca04)]:
16
- - @mastra/core@0.0.0-monorepo-binary-20251013210052
107
+ - Updated dependencies [[`1ed9670`](https://github.com/mastra-ai/mastra/commit/1ed9670d3ca50cb60dc2e517738c5eef3968ed27), [`b5a66b7`](https://github.com/mastra-ai/mastra/commit/b5a66b748a14fc8b3f63b04642ddb9621fbcc9e0), [`f59fc1e`](https://github.com/mastra-ai/mastra/commit/f59fc1e406b8912e692f6bff6cfd4754cc8d165c), [`158381d`](https://github.com/mastra-ai/mastra/commit/158381d39335be934b81ef8a1947bccace492c25), [`a1799bc`](https://github.com/mastra-ai/mastra/commit/a1799bcc1b5a1cdc188f2ac0165f17a1c4ac6f7b), [`6ff6094`](https://github.com/mastra-ai/mastra/commit/6ff60946f4ecfebdeef6e21d2b230c2204f2c9b8), [`fb703b9`](https://github.com/mastra-ai/mastra/commit/fb703b9634eeaff1a6eb2b5531ce0f9e8fb04727), [`37a2314`](https://github.com/mastra-ai/mastra/commit/37a23148e0e5a3b40d4f9f098b194671a8a49faf), [`7b1ef57`](https://github.com/mastra-ai/mastra/commit/7b1ef57fc071c2aa2a2e32905b18cd88719c5a39), [`05a9dee`](https://github.com/mastra-ai/mastra/commit/05a9dee3d355694d28847bfffb6289657fcf7dfa), [`e3c1077`](https://github.com/mastra-ai/mastra/commit/e3c107763aedd1643d3def5df450c235da9ff76c), [`1908ca0`](https://github.com/mastra-ai/mastra/commit/1908ca0521f90e43779cc29ab590173ca560443c), [`1bccdb3`](https://github.com/mastra-ai/mastra/commit/1bccdb33eb90cbeba2dc5ece1c2561fb774b26b6), [`5ef944a`](https://github.com/mastra-ai/mastra/commit/5ef944a3721d93105675cac2b2311432ff8cc393), [`d6b186f`](https://github.com/mastra-ai/mastra/commit/d6b186fb08f1caf1b86f73d3a5ee88fb999ca3be), [`ee68e82`](https://github.com/mastra-ai/mastra/commit/ee68e8289ea4408d29849e899bc6e78b3bd4e843), [`228228b`](https://github.com/mastra-ai/mastra/commit/228228b0b1de9291cb8887587f5cea1a8757ebad), [`ea33930`](https://github.com/mastra-ai/mastra/commit/ea339301e82d6318257720d811b043014ee44064), [`65493b3`](https://github.com/mastra-ai/mastra/commit/65493b31c36f6fdb78f9679f7e1ecf0c250aa5ee), [`a998b8f`](https://github.com/mastra-ai/mastra/commit/a998b8f858091c2ec47683e60766cf12d03001e4), [`b5a66b7`](https://github.com/mastra-ai/mastra/commit/b5a66b748a14fc8b3f63b04642ddb9621fbcc9e0), [`8a37bdd`](https://github.com/mastra-ai/mastra/commit/8a37bddb6d8614a32c5b70303d583d80c620ea61), [`135d6f2`](https://github.com/mastra-ai/mastra/commit/135d6f22a326ed1dffff858700669dff09d2c9eb)]:
108
+ - @mastra/core@0.21.0
17
109
 
18
110
  ## 0.10.15-alpha.0
19
111
 
package/dist/index.cjs CHANGED
@@ -1511,7 +1511,8 @@ var GeminiLiveVoice = class _GeminiLiveVoice extends voice.MastraVoice {
1511
1511
  let wsUrl;
1512
1512
  let headers = {};
1513
1513
  if (this.options.vertexAI) {
1514
- wsUrl = `wss://${this.options.location}-aiplatform.googleapis.com/ws/google.cloud.aiplatform.v1beta1.PredictionService.ServerStreamingPredict`;
1514
+ const location = this.getVertexLocation();
1515
+ wsUrl = `wss://${location}-aiplatform.googleapis.com/ws/google.cloud.aiplatform.v1beta1.LlmBidiService/BidiGenerateContent`;
1515
1516
  await this.authManager.initialize();
1516
1517
  const accessToken = await this.authManager.getAccessToken();
1517
1518
  headers = { headers: { Authorization: `Bearer ${accessToken}` } };
@@ -2269,6 +2270,18 @@ var GeminiLiveVoice = class _GeminiLiveVoice extends voice.MastraVoice {
2269
2270
  role: "assistant"
2270
2271
  });
2271
2272
  }
2273
+ if (part.functionCall) {
2274
+ this.log("Found function call in serverContent.modelTurn.parts", part.functionCall);
2275
+ const toolCallData = {
2276
+ toolCall: {
2277
+ name: part.functionCall.name,
2278
+ args: part.functionCall.args || {},
2279
+ id: part.functionCall.id || crypto.randomUUID()
2280
+ }
2281
+ };
2282
+ void this.handleToolCall(toolCallData);
2283
+ continue;
2284
+ }
2272
2285
  if (part.inlineData?.mimeType?.includes("audio") && typeof part.inlineData.data === "string") {
2273
2286
  try {
2274
2287
  const audioData = part.inlineData.data;
@@ -2343,9 +2356,24 @@ var GeminiLiveVoice = class _GeminiLiveVoice extends voice.MastraVoice {
2343
2356
  if (!data.toolCall) {
2344
2357
  return;
2345
2358
  }
2346
- const toolName = data.toolCall.name || "";
2347
- const toolArgs = data.toolCall.args || {};
2348
- const toolId = data.toolCall.id || crypto.randomUUID();
2359
+ let toolCalls = [];
2360
+ if (data.toolCall.functionCalls && Array.isArray(data.toolCall.functionCalls)) {
2361
+ toolCalls = data.toolCall.functionCalls;
2362
+ } else if (data.toolCall.name) {
2363
+ toolCalls = [{ name: data.toolCall.name, args: data.toolCall.args, id: data.toolCall.id }];
2364
+ }
2365
+ for (const toolCall of toolCalls) {
2366
+ const toolName = toolCall.name || "";
2367
+ const toolArgs = toolCall.args || {};
2368
+ const toolId = toolCall.id || crypto.randomUUID();
2369
+ await this.processSingleToolCall(toolName, toolArgs, toolId);
2370
+ }
2371
+ }
2372
+ /**
2373
+ * Process a single tool call
2374
+ * @private
2375
+ */
2376
+ async processSingleToolCall(toolName, toolArgs, toolId) {
2349
2377
  this.log("Processing tool call", { toolName, toolArgs, toolId });
2350
2378
  this.emit("toolCall", {
2351
2379
  name: toolName,
@@ -2378,23 +2406,31 @@ var GeminiLiveVoice = class _GeminiLiveVoice extends voice.MastraVoice {
2378
2406
  result = { error: "Tool has no execute function" };
2379
2407
  }
2380
2408
  const toolResultMessage = {
2381
- tool_result: {
2382
- tool_call_id: toolId,
2383
- result
2409
+ toolResponse: {
2410
+ functionResponses: [
2411
+ {
2412
+ id: toolId,
2413
+ response: result
2414
+ }
2415
+ ]
2384
2416
  }
2385
2417
  };
2386
- this.sendEvent("tool_result", toolResultMessage);
2418
+ this.sendEvent("toolResponse", toolResultMessage);
2387
2419
  this.log("Tool result sent", { toolName, toolId, result });
2388
2420
  } catch (error) {
2389
2421
  const errorMessage = error instanceof Error ? error.message : "Unknown error";
2390
2422
  this.log("Tool execution failed", { toolName, error: errorMessage });
2391
2423
  const errorResultMessage = {
2392
- tool_result: {
2393
- tool_call_id: toolId,
2394
- result: { error: errorMessage }
2424
+ toolResponse: {
2425
+ functionResponses: [
2426
+ {
2427
+ id: toolId,
2428
+ response: { error: errorMessage }
2429
+ }
2430
+ ]
2395
2431
  }
2396
2432
  };
2397
- this.sendEvent("tool_result", errorResultMessage);
2433
+ this.sendEvent("toolResponse", errorResultMessage);
2398
2434
  this.createAndEmitError("tool_execution_error" /* TOOL_EXECUTION_ERROR */, `Tool execution failed: ${errorMessage}`, {
2399
2435
  toolName,
2400
2436
  toolArgs,
@@ -2454,6 +2490,31 @@ var GeminiLiveVoice = class _GeminiLiveVoice extends voice.MastraVoice {
2454
2490
  }
2455
2491
  return "text";
2456
2492
  }
2493
+ /**
2494
+ * Resolve Vertex AI location with sensible default
2495
+ * @private
2496
+ */
2497
+ getVertexLocation() {
2498
+ return this.options.location?.trim() || "us-central1";
2499
+ }
2500
+ /**
2501
+ * Resolve the correct model identifier for Gemini API or Vertex AI
2502
+ * @private
2503
+ */
2504
+ resolveModelIdentifier() {
2505
+ const model = this.options.model ?? DEFAULT_MODEL;
2506
+ if (!this.options.vertexAI) {
2507
+ return `models/${model}`;
2508
+ }
2509
+ if (!this.options.project) {
2510
+ throw this.createAndEmitError(
2511
+ "project_id_missing" /* PROJECT_ID_MISSING */,
2512
+ "Google Cloud project ID is required when using Vertex AI."
2513
+ );
2514
+ }
2515
+ const location = this.getVertexLocation();
2516
+ return `projects/${this.options.project}/locations/${location}/publishers/google/models/${model}`;
2517
+ }
2457
2518
  /**
2458
2519
  * Send initial configuration to Gemini Live API
2459
2520
  * @private
@@ -2464,7 +2525,7 @@ var GeminiLiveVoice = class _GeminiLiveVoice extends voice.MastraVoice {
2464
2525
  }
2465
2526
  const setupMessage = {
2466
2527
  setup: {
2467
- model: `models/${this.options.model}`
2528
+ model: this.resolveModelIdentifier()
2468
2529
  }
2469
2530
  };
2470
2531
  if (this.options.instructions) {
@@ -2613,6 +2674,8 @@ var GeminiLiveVoice = class _GeminiLiveVoice extends voice.MastraVoice {
2613
2674
  message = data;
2614
2675
  } else if (type === "realtime_input" && data.realtime_input) {
2615
2676
  message = data;
2677
+ } else if (type === "toolResponse" && data.toolResponse) {
2678
+ message = data;
2616
2679
  } else if (type === "session.update" && data.session) {
2617
2680
  message = data;
2618
2681
  } else {