@depup/ai-sdk__google 4.0.70-depup.0 → 4.0.72-depup.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 +27 -0
- package/README.md +2 -2
- package/changes.json +1 -1
- package/dist/index.d.ts +35 -0
- package/dist/index.js +34 -5
- package/dist/index.js.map +1 -1
- package/docs/15-google.mdx +44 -0
- package/package.json +5 -5
- package/src/realtime/google-realtime-event-mapper.ts +63 -6
- package/src/realtime/google-realtime-model-options.ts +39 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 4.0.72
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4a994ad: feat(google): realtime session options for Gemini 3.8 Live
|
|
8
|
+
|
|
9
|
+
Add `thinkingConfig` (`thinkingLevel`, `thinkingBudget`, `includeThoughts`) and
|
|
10
|
+
`defaultToolBehavior` to `GoogleRealtimeModelOptions`. `thinkingConfig` is merged
|
|
11
|
+
into the Live `setup.generationConfig`. Background-reasoning Live models such as
|
|
12
|
+
`gemini-3.8-live-extended-thinking` require exactly one of `thinkingLevel` or
|
|
13
|
+
`thinkingBudget`, so the provider sends `thinkingLevel: 'low'` on those models
|
|
14
|
+
when neither is set. `defaultToolBehavior` stamps `behavior` on every function
|
|
15
|
+
declaration in the setup.
|
|
16
|
+
|
|
17
|
+
Forward the Live `interactionStatus` and `waitingForInput` server messages as
|
|
18
|
+
custom events so applications can tell when a background-reasoning model is idle,
|
|
19
|
+
since `turnComplete` alone no longer means that.
|
|
20
|
+
|
|
21
|
+
## 4.0.71
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [5c0054d]
|
|
26
|
+
- Updated dependencies [39535af]
|
|
27
|
+
- @ai-sdk/provider@4.0.15
|
|
28
|
+
- @ai-sdk/provider-utils@5.0.41
|
|
29
|
+
|
|
3
30
|
## 4.0.70
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/ai-sdk__google
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [@ai-sdk/google](https://www.npmjs.com/package/@ai-sdk/google) @ 4.0.
|
|
17
|
-
| Processed | 2026-09-
|
|
16
|
+
| Original | [@ai-sdk/google](https://www.npmjs.com/package/@ai-sdk/google) @ 4.0.72 |
|
|
17
|
+
| Processed | 2026-09-16 |
|
|
18
18
|
| Smoke test | failed |
|
|
19
19
|
| Deps updated | 0 |
|
|
20
20
|
|
package/changes.json
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -762,6 +762,41 @@ type GoogleRealtimeModelOptions = {
|
|
|
762
762
|
*/
|
|
763
763
|
echoTargetLanguage?: boolean;
|
|
764
764
|
};
|
|
765
|
+
/**
|
|
766
|
+
* Gemini Live thinking configuration.
|
|
767
|
+
*
|
|
768
|
+
* Supported by Live models with background reasoning (e.g.
|
|
769
|
+
* `gemini-3.8-live-extended-thinking`), which can process multi-step
|
|
770
|
+
* reasoning and function calls while streaming audio responses. Not
|
|
771
|
+
* supported by latency-optimized models (e.g. `gemini-3.8-live`).
|
|
772
|
+
*/
|
|
773
|
+
thinkingConfig?: {
|
|
774
|
+
/**
|
|
775
|
+
* Thinking effort level. Background-reasoning Live models require exactly
|
|
776
|
+
* one of `thinkingLevel` or `thinkingBudget`; when neither is set, the
|
|
777
|
+
* provider sends `thinkingLevel: 'low'` on those models.
|
|
778
|
+
*/
|
|
779
|
+
thinkingLevel?: 'low' | 'medium' | 'high';
|
|
780
|
+
/**
|
|
781
|
+
* Token budget for background thinking. Mutually exclusive with
|
|
782
|
+
* `thinkingLevel`; setting it suppresses the default level.
|
|
783
|
+
*/
|
|
784
|
+
thinkingBudget?: number;
|
|
785
|
+
/**
|
|
786
|
+
* Whether thought summaries should be included in the response.
|
|
787
|
+
*/
|
|
788
|
+
includeThoughts?: boolean;
|
|
789
|
+
};
|
|
790
|
+
/**
|
|
791
|
+
* Default `behavior` stamped onto every function declaration in the
|
|
792
|
+
* session setup.
|
|
793
|
+
*
|
|
794
|
+
* Gemini 3.8 Live models default to `NON_BLOCKING` (asynchronous) function
|
|
795
|
+
* calling. Set to `BLOCKING` for synchronous calls on models that support it
|
|
796
|
+
* (e.g. `gemini-3.8-live`); background-reasoning models accept only
|
|
797
|
+
* `NON_BLOCKING`.
|
|
798
|
+
*/
|
|
799
|
+
defaultToolBehavior?: 'BLOCKING' | 'NON_BLOCKING';
|
|
765
800
|
};
|
|
766
801
|
|
|
767
802
|
interface GoogleTranscriptionModelConfig {
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "@ai-sdk/provider-utils";
|
|
8
8
|
|
|
9
9
|
// src/version.ts
|
|
10
|
-
var VERSION = true ? "4.0.
|
|
10
|
+
var VERSION = true ? "4.0.72" : "0.0.0-test";
|
|
11
11
|
|
|
12
12
|
// src/google-embedding-model.ts
|
|
13
13
|
import {
|
|
@@ -8057,6 +8057,20 @@ var GoogleRealtimeEventMapper = class {
|
|
|
8057
8057
|
raw
|
|
8058
8058
|
});
|
|
8059
8059
|
}
|
|
8060
|
+
if (serverContent.interactionStatus != null) {
|
|
8061
|
+
events.push({
|
|
8062
|
+
type: "custom",
|
|
8063
|
+
rawType: "interactionStatus",
|
|
8064
|
+
raw
|
|
8065
|
+
});
|
|
8066
|
+
}
|
|
8067
|
+
if (serverContent.waitingForInput) {
|
|
8068
|
+
events.push({
|
|
8069
|
+
type: "custom",
|
|
8070
|
+
rawType: "waitingForInput",
|
|
8071
|
+
raw
|
|
8072
|
+
});
|
|
8073
|
+
}
|
|
8060
8074
|
if (serverContent.turnComplete) {
|
|
8061
8075
|
if (this.hasAudio) {
|
|
8062
8076
|
events.push({
|
|
@@ -8167,10 +8181,18 @@ async function serializeFunctionCallOutput(item) {
|
|
|
8167
8181
|
}
|
|
8168
8182
|
};
|
|
8169
8183
|
}
|
|
8184
|
+
function isThinkingLiveModel(modelId) {
|
|
8185
|
+
var _a, _b;
|
|
8186
|
+
const modelName = (_b = (_a = modelId.split("/").at(-1)) == null ? void 0 : _a.toLowerCase()) != null ? _b : "";
|
|
8187
|
+
return /^gemini-\d+\.\d+-live\b.*thinking/.test(modelName);
|
|
8188
|
+
}
|
|
8170
8189
|
function buildGoogleSessionConfig(config, modelId) {
|
|
8190
|
+
var _a, _b;
|
|
8171
8191
|
const setup = {
|
|
8172
8192
|
model: getModelPath(modelId)
|
|
8173
8193
|
};
|
|
8194
|
+
const { google: google2, ...restProviderOptions } = (_a = config == null ? void 0 : config.providerOptions) != null ? _a : {};
|
|
8195
|
+
const googleOptions = isRecord(google2) ? google2 : void 0;
|
|
8174
8196
|
const generationConfig = {};
|
|
8175
8197
|
if ((config == null ? void 0 : config.outputModalities) != null) {
|
|
8176
8198
|
generationConfig.responseModalities = config.outputModalities.map(
|
|
@@ -8200,7 +8222,8 @@ function buildGoogleSessionConfig(config, modelId) {
|
|
|
8200
8222
|
functionDeclarations: config.tools.map((tool) => ({
|
|
8201
8223
|
name: tool.name,
|
|
8202
8224
|
description: tool.description,
|
|
8203
|
-
parametersJsonSchema: tool.parameters
|
|
8225
|
+
parametersJsonSchema: tool.parameters,
|
|
8226
|
+
...(googleOptions == null ? void 0 : googleOptions.defaultToolBehavior) != null ? { behavior: googleOptions.defaultToolBehavior } : {}
|
|
8204
8227
|
}))
|
|
8205
8228
|
}
|
|
8206
8229
|
];
|
|
@@ -8211,12 +8234,17 @@ function buildGoogleSessionConfig(config, modelId) {
|
|
|
8211
8234
|
if ((config == null ? void 0 : config.outputAudioTranscription) != null) {
|
|
8212
8235
|
setup.outputAudioTranscription = {};
|
|
8213
8236
|
}
|
|
8237
|
+
const thinkingConfig = (_b = googleOptions == null ? void 0 : googleOptions.thinkingConfig) != null ? _b : isThinkingLiveModel(modelId) ? { thinkingLevel: "low" } : void 0;
|
|
8238
|
+
const applyThinkingConfig = () => {
|
|
8239
|
+
if (thinkingConfig == null) return;
|
|
8240
|
+
const target = isRecord(setup.generationConfig) ? setup.generationConfig : generationConfig;
|
|
8241
|
+
setup.generationConfig = { ...target, thinkingConfig };
|
|
8242
|
+
};
|
|
8214
8243
|
if ((config == null ? void 0 : config.providerOptions) == null) {
|
|
8244
|
+
applyThinkingConfig();
|
|
8215
8245
|
return setup;
|
|
8216
8246
|
}
|
|
8217
|
-
|
|
8218
|
-
Object.assign(setup, providerOptions);
|
|
8219
|
-
const googleOptions = isRecord(google2) ? google2 : void 0;
|
|
8247
|
+
Object.assign(setup, restProviderOptions);
|
|
8220
8248
|
if ((googleOptions == null ? void 0 : googleOptions.translationConfig) != null) {
|
|
8221
8249
|
const target = isRecord(setup.generationConfig) ? setup.generationConfig : generationConfig;
|
|
8222
8250
|
setup.generationConfig = {
|
|
@@ -8224,6 +8252,7 @@ function buildGoogleSessionConfig(config, modelId) {
|
|
|
8224
8252
|
translationConfig: googleOptions.translationConfig
|
|
8225
8253
|
};
|
|
8226
8254
|
}
|
|
8255
|
+
applyThinkingConfig();
|
|
8227
8256
|
return setup;
|
|
8228
8257
|
}
|
|
8229
8258
|
|