@ai-sdk/google 4.0.0-canary.74 → 4.0.0-canary.76
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 +12 -0
- package/dist/index.d.ts +27 -4
- package/dist/index.js +638 -366
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +1 -1
- package/dist/internal/index.js +10 -10
- package/dist/internal/index.js.map +1 -1
- package/docs/15-google.mdx +78 -0
- package/package.json +1 -1
- package/src/google-embedding-model-options.ts +1 -0
- package/src/google-json-accumulator.ts +10 -10
- package/src/google-language-model-options.ts +2 -0
- package/src/google-provider.ts +23 -0
- package/src/google-speech-api.ts +36 -0
- package/src/google-speech-model-options.ts +48 -0
- package/src/google-speech-model.ts +286 -0
- package/src/index.ts +4 -0
- package/src/interactions/build-google-interactions-stream-transform.ts +7 -7
- package/src/interactions/extract-google-interactions-sources.ts +20 -13
- package/src/interactions/google-interactions-language-model.ts +50 -46
- package/src/interactions/stream-google-interactions.ts +8 -5
package/dist/internal/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE, Resolvable, FetchFunction, In
|
|
|
3
3
|
import { LanguageModelV4, JSONObject, LanguageModelV4CallOptions, LanguageModelV4GenerateResult, LanguageModelV4StreamResult } from '@ai-sdk/provider';
|
|
4
4
|
import { z } from 'zod/v4';
|
|
5
5
|
|
|
6
|
-
type GoogleModelId = 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-flash-lite-001' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-2.5-flash-native-audio-latest' | 'gemini-2.5-flash-native-audio-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-pro-preview-customtools' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.5-flash' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'deep-research-pro-preview-12-2025' | 'nano-banana-pro-preview' | 'aqa' | 'gemini-robotics-er-1.5-preview' | 'gemma-3-1b-it' | 'gemma-3-4b-it' | 'gemma-3n-e4b-it' | 'gemma-3n-e2b-it' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
|
|
6
|
+
type GoogleModelId = 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-flash-lite-001' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-2.5-flash-native-audio-latest' | 'gemini-2.5-flash-native-audio-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-pro-preview-customtools' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.5-flash' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'deep-research-pro-preview-12-2025' | 'deep-research-max-preview-04-2026' | 'deep-research-preview-04-2026' | 'nano-banana-pro-preview' | 'aqa' | 'gemini-robotics-er-1.5-preview' | 'gemma-3-1b-it' | 'gemma-3-4b-it' | 'gemma-3n-e4b-it' | 'gemma-3n-e2b-it' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
|
|
7
7
|
|
|
8
8
|
type GoogleConfig = {
|
|
9
9
|
provider: string;
|
package/dist/internal/index.js
CHANGED
|
@@ -1199,19 +1199,19 @@ var GoogleJSONAccumulator = class {
|
|
|
1199
1199
|
let fragment = "";
|
|
1200
1200
|
const startIdx = this.pathStack.length - 1;
|
|
1201
1201
|
for (let i = startIdx; i < targetContainer.length; i++) {
|
|
1202
|
-
const
|
|
1202
|
+
const pathSegment = targetContainer[i];
|
|
1203
1203
|
const parentEntry = this.pathStack[this.pathStack.length - 1];
|
|
1204
1204
|
if (parentEntry.childCount > 0) {
|
|
1205
1205
|
fragment += ",";
|
|
1206
1206
|
}
|
|
1207
1207
|
parentEntry.childCount++;
|
|
1208
|
-
if (typeof
|
|
1209
|
-
fragment += `${JSON.stringify(
|
|
1208
|
+
if (typeof pathSegment === "string") {
|
|
1209
|
+
fragment += `${JSON.stringify(pathSegment)}:`;
|
|
1210
1210
|
}
|
|
1211
1211
|
const childSeg = i + 1 < targetContainer.length ? targetContainer[i + 1] : leafSegment;
|
|
1212
1212
|
const isArray = typeof childSeg === "number";
|
|
1213
1213
|
fragment += isArray ? "[" : "{";
|
|
1214
|
-
this.pathStack.push({ segment:
|
|
1214
|
+
this.pathStack.push({ segment: pathSegment, isArray, childCount: 0 });
|
|
1215
1215
|
}
|
|
1216
1216
|
return fragment;
|
|
1217
1217
|
}
|
|
@@ -1257,21 +1257,21 @@ function parsePath(rawPath) {
|
|
|
1257
1257
|
}
|
|
1258
1258
|
function getNestedValue(obj, segments) {
|
|
1259
1259
|
let current = obj;
|
|
1260
|
-
for (const
|
|
1260
|
+
for (const pathSegment of segments) {
|
|
1261
1261
|
if (current == null || typeof current !== "object") return void 0;
|
|
1262
|
-
current = current[
|
|
1262
|
+
current = current[pathSegment];
|
|
1263
1263
|
}
|
|
1264
1264
|
return current;
|
|
1265
1265
|
}
|
|
1266
1266
|
function setNestedValue(obj, segments, value) {
|
|
1267
1267
|
let current = obj;
|
|
1268
1268
|
for (let i = 0; i < segments.length - 1; i++) {
|
|
1269
|
-
const
|
|
1269
|
+
const pathSegment = segments[i];
|
|
1270
1270
|
const nextSeg = segments[i + 1];
|
|
1271
|
-
if (current[
|
|
1272
|
-
current[
|
|
1271
|
+
if (current[pathSegment] == null) {
|
|
1272
|
+
current[pathSegment] = typeof nextSeg === "number" ? [] : {};
|
|
1273
1273
|
}
|
|
1274
|
-
current = current[
|
|
1274
|
+
current = current[pathSegment];
|
|
1275
1275
|
}
|
|
1276
1276
|
current[segments[segments.length - 1]] = value;
|
|
1277
1277
|
}
|