@ai-sdk/google 4.0.0-canary.80 → 4.0.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 +159 -0
- package/dist/index.d.ts +23 -1
- package/dist/index.js +45 -13
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +22 -4
- package/dist/internal/index.js.map +1 -1
- package/docs/15-google.mdx +41 -2
- package/package.json +4 -4
- package/src/google-json-accumulator.ts +39 -4
- package/src/google-video-model.ts +8 -4
- package/src/index.ts +4 -0
- package/src/interactions/google-interactions-language-model.ts +0 -11
- package/src/realtime/google-realtime-event-mapper.ts +30 -2
- package/src/realtime/google-realtime-model-options.ts +21 -1
- package/src/realtime/index.ts +4 -0
package/dist/internal/index.js
CHANGED
|
@@ -1255,11 +1255,25 @@ function parsePath(rawPath) {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
return segments;
|
|
1257
1257
|
}
|
|
1258
|
+
var hasOwn = Object.prototype.hasOwnProperty;
|
|
1259
|
+
function hasOwnProperty(obj, key) {
|
|
1260
|
+
return hasOwn.call(obj, key);
|
|
1261
|
+
}
|
|
1262
|
+
function defineOwnProperty(obj, key, value) {
|
|
1263
|
+
Object.defineProperty(obj, key, {
|
|
1264
|
+
value,
|
|
1265
|
+
enumerable: true,
|
|
1266
|
+
configurable: true,
|
|
1267
|
+
writable: true
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1258
1270
|
function getNestedValue(obj, segments) {
|
|
1259
1271
|
let current = obj;
|
|
1260
1272
|
for (const pathSegment of segments) {
|
|
1261
1273
|
if (current == null || typeof current !== "object") return void 0;
|
|
1262
|
-
|
|
1274
|
+
const currentRecord = current;
|
|
1275
|
+
if (!hasOwnProperty(currentRecord, pathSegment)) return void 0;
|
|
1276
|
+
current = currentRecord[pathSegment];
|
|
1263
1277
|
}
|
|
1264
1278
|
return current;
|
|
1265
1279
|
}
|
|
@@ -1268,12 +1282,16 @@ function setNestedValue(obj, segments, value) {
|
|
|
1268
1282
|
for (let i = 0; i < segments.length - 1; i++) {
|
|
1269
1283
|
const pathSegment = segments[i];
|
|
1270
1284
|
const nextSeg = segments[i + 1];
|
|
1271
|
-
if (current[pathSegment] == null) {
|
|
1272
|
-
|
|
1285
|
+
if (!hasOwnProperty(current, pathSegment) || current[pathSegment] == null) {
|
|
1286
|
+
defineOwnProperty(
|
|
1287
|
+
current,
|
|
1288
|
+
pathSegment,
|
|
1289
|
+
typeof nextSeg === "number" ? [] : {}
|
|
1290
|
+
);
|
|
1273
1291
|
}
|
|
1274
1292
|
current = current[pathSegment];
|
|
1275
1293
|
}
|
|
1276
|
-
current
|
|
1294
|
+
defineOwnProperty(current, segments[segments.length - 1], value);
|
|
1277
1295
|
}
|
|
1278
1296
|
function resolvePartialArgValue(arg) {
|
|
1279
1297
|
var _a, _b;
|