@mastra/voice-google-gemini-live 0.14.0-alpha.0 → 0.14.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/CHANGELOG.md +36 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +11 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @mastra/voice-google-gemini-live
|
|
2
2
|
|
|
3
|
+
## 0.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added `sendContext()` method to `GeminiLiveVoice` for seeding conversation history into a fresh voice session without triggering a model response. This lets apps replay prior turns from Mastra Memory (or any external store) on a cold connect so the model has full context before the user speaks — enabling seamless handoff between text chat and voice on a shared thread. ([#18286](https://github.com/mastra-ai/mastra/pull/18286))
|
|
8
|
+
|
|
9
|
+
**Usage:**
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
await voice.connect();
|
|
13
|
+
|
|
14
|
+
await voice.sendContext([
|
|
15
|
+
{ role: 'user', content: 'What is the weather?' },
|
|
16
|
+
{ role: 'assistant', content: 'It is 72°F in San Francisco.' },
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
// Model stays silent until the user actually speaks
|
|
20
|
+
await voice.send(micStream);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Fix resumeSession() always timing out. Session resumption now works end-to-end: new sessions request server-issued tokens, inbound handles are stored and emitted, and resuming reconnects with the correct handle in the setup frame. ([#18190](https://github.com/mastra-ai/mastra/pull/18190))
|
|
26
|
+
|
|
27
|
+
- Fix sendContext() being rejected (WS 1007) on gemini-3.1-flash-live-preview by emitting `history_config: { initial_history_in_client_content: true }` in the setup frame. Also exposes `initialHistoryInClientContent` on `GeminiSessionConfig` so callers can opt out explicitly. ([#18368](https://github.com/mastra-ai/mastra/pull/18368))
|
|
28
|
+
|
|
29
|
+
- Fixed realtime audio streaming being immediately rejected by the Gemini Live API. Audio frames now use the current API format, replacing a deprecated payload shape that caused the connection to close on the first frame. ([#18291](https://github.com/mastra-ai/mastra/pull/18291))
|
|
30
|
+
|
|
31
|
+
The `session` event for disconnections now includes `code` and `reason` fields, so consumers can see why the server closed the connection.
|
|
32
|
+
|
|
33
|
+
## 0.14.0-alpha.1
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Fix sendContext() being rejected (WS 1007) on gemini-3.1-flash-live-preview by emitting `history_config: { initial_history_in_client_content: true }` in the setup frame. Also exposes `initialHistoryInClientContent` on `GeminiSessionConfig` so callers can opt out explicitly. ([#18368](https://github.com/mastra-ai/mastra/pull/18368))
|
|
38
|
+
|
|
3
39
|
## 0.14.0-alpha.0
|
|
4
40
|
|
|
5
41
|
### Minor Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-voice-google-gemini-live
|
|
|
3
3
|
description: Documentation for @mastra/voice-google-gemini-live. Use when working with @mastra/voice-google-gemini-live APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/voice-google-gemini-live"
|
|
6
|
-
version: "0.14.0
|
|
6
|
+
version: "0.14.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
package/dist/index.cjs
CHANGED
|
@@ -2853,6 +2853,17 @@ var GeminiLiveVoice = class _GeminiLiveVoice extends MastraVoice {
|
|
|
2853
2853
|
// { handle } resumes a previous session. Only included when enableResumption is set.
|
|
2854
2854
|
...this.options.sessionConfig?.enableResumption && {
|
|
2855
2855
|
session_resumption: this.isResuming && this.sessionHandle ? { handle: this.sessionHandle } : {}
|
|
2856
|
+
},
|
|
2857
|
+
// history_config opts the session into send_client_content-based history seeding.
|
|
2858
|
+
// Required by gemini-3.1-flash-live-preview (and later 3.x models) for sendContext() to
|
|
2859
|
+
// succeed — without this field in the setup frame the server closes the WebSocket with
|
|
2860
|
+
// code 1007 ("Request contains an invalid argument."). Defaults to true so that
|
|
2861
|
+
// sendContext() works out of the box; set initialHistoryInClientContent: false on
|
|
2862
|
+
// sessionConfig to opt out explicitly.
|
|
2863
|
+
...this.options.sessionConfig?.initialHistoryInClientContent !== false && {
|
|
2864
|
+
history_config: {
|
|
2865
|
+
initial_history_in_client_content: true
|
|
2866
|
+
}
|
|
2856
2867
|
}
|
|
2857
2868
|
}
|
|
2858
2869
|
};
|