@ai-sdk/google 3.0.22 → 3.0.23
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 +8 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -17
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +1 -1
- package/dist/internal/index.d.ts +1 -1
- package/dist/internal/index.js +16 -16
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +16 -16
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/google-generative-ai-language-model.ts +3 -3
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "@ai-sdk/provider-utils";
|
|
8
8
|
|
|
9
9
|
// src/version.ts
|
|
10
|
-
var VERSION = true ? "3.0.
|
|
10
|
+
var VERSION = true ? "3.0.23" : "0.0.0-test";
|
|
11
11
|
|
|
12
12
|
// src/google-generative-ai-embedding-model.ts
|
|
13
13
|
import {
|
|
@@ -1010,7 +1010,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1010
1010
|
};
|
|
1011
1011
|
}
|
|
1012
1012
|
async doGenerate(options) {
|
|
1013
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1013
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
1014
1014
|
const { args, warnings, providerOptionsName } = await this.getArgs(options);
|
|
1015
1015
|
const mergedHeaders = combineHeaders2(
|
|
1016
1016
|
await resolve2(this.config.headers),
|
|
@@ -1055,7 +1055,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1055
1055
|
toolName: "code_execution",
|
|
1056
1056
|
result: {
|
|
1057
1057
|
outcome: part.codeExecutionResult.outcome,
|
|
1058
|
-
output: part.codeExecutionResult.output
|
|
1058
|
+
output: (_d = part.codeExecutionResult.output) != null ? _d : ""
|
|
1059
1059
|
}
|
|
1060
1060
|
});
|
|
1061
1061
|
lastCodeExecutionToolCallId = void 0;
|
|
@@ -1094,10 +1094,10 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1094
1094
|
});
|
|
1095
1095
|
}
|
|
1096
1096
|
}
|
|
1097
|
-
const sources = (
|
|
1097
|
+
const sources = (_e = extractSources({
|
|
1098
1098
|
groundingMetadata: candidate.groundingMetadata,
|
|
1099
1099
|
generateId: this.config.generateId
|
|
1100
|
-
})) != null ?
|
|
1100
|
+
})) != null ? _e : [];
|
|
1101
1101
|
for (const source of sources) {
|
|
1102
1102
|
content.push(source);
|
|
1103
1103
|
}
|
|
@@ -1111,16 +1111,16 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1111
1111
|
(part) => part.type === "tool-call" && !part.providerExecuted
|
|
1112
1112
|
)
|
|
1113
1113
|
}),
|
|
1114
|
-
raw: (
|
|
1114
|
+
raw: (_f = candidate.finishReason) != null ? _f : void 0
|
|
1115
1115
|
},
|
|
1116
1116
|
usage: convertGoogleGenerativeAIUsage(usageMetadata),
|
|
1117
1117
|
warnings,
|
|
1118
1118
|
providerMetadata: {
|
|
1119
1119
|
[providerOptionsName]: {
|
|
1120
|
-
promptFeedback: (
|
|
1121
|
-
groundingMetadata: (
|
|
1122
|
-
urlContextMetadata: (
|
|
1123
|
-
safetyRatings: (
|
|
1120
|
+
promptFeedback: (_g = response.promptFeedback) != null ? _g : null,
|
|
1121
|
+
groundingMetadata: (_h = candidate.groundingMetadata) != null ? _h : null,
|
|
1122
|
+
urlContextMetadata: (_i = candidate.urlContextMetadata) != null ? _i : null,
|
|
1123
|
+
safetyRatings: (_j = candidate.safetyRatings) != null ? _j : null,
|
|
1124
1124
|
usageMetadata: usageMetadata != null ? usageMetadata : null
|
|
1125
1125
|
}
|
|
1126
1126
|
},
|
|
@@ -1169,7 +1169,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1169
1169
|
controller.enqueue({ type: "stream-start", warnings });
|
|
1170
1170
|
},
|
|
1171
1171
|
transform(chunk, controller) {
|
|
1172
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
1172
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1173
1173
|
if (options.includeRawChunks) {
|
|
1174
1174
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
1175
1175
|
}
|
|
@@ -1221,7 +1221,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1221
1221
|
toolName: "code_execution",
|
|
1222
1222
|
result: {
|
|
1223
1223
|
outcome: part.codeExecutionResult.outcome,
|
|
1224
|
-
output: part.codeExecutionResult.output
|
|
1224
|
+
output: (_d = part.codeExecutionResult.output) != null ? _d : ""
|
|
1225
1225
|
}
|
|
1226
1226
|
});
|
|
1227
1227
|
lastCodeExecutionToolCallId = void 0;
|
|
@@ -1341,10 +1341,10 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1341
1341
|
};
|
|
1342
1342
|
providerMetadata = {
|
|
1343
1343
|
[providerOptionsName]: {
|
|
1344
|
-
promptFeedback: (
|
|
1345
|
-
groundingMetadata: (
|
|
1346
|
-
urlContextMetadata: (
|
|
1347
|
-
safetyRatings: (
|
|
1344
|
+
promptFeedback: (_e = value.promptFeedback) != null ? _e : null,
|
|
1345
|
+
groundingMetadata: (_f = candidate.groundingMetadata) != null ? _f : null,
|
|
1346
|
+
urlContextMetadata: (_g = candidate.urlContextMetadata) != null ? _g : null,
|
|
1347
|
+
safetyRatings: (_h = candidate.safetyRatings) != null ? _h : null
|
|
1348
1348
|
}
|
|
1349
1349
|
};
|
|
1350
1350
|
if (usageMetadata != null) {
|
|
@@ -1550,7 +1550,7 @@ var getContentSchema = () => z5.object({
|
|
|
1550
1550
|
}).nullish(),
|
|
1551
1551
|
codeExecutionResult: z5.object({
|
|
1552
1552
|
outcome: z5.string(),
|
|
1553
|
-
output: z5.string()
|
|
1553
|
+
output: z5.string().nullish()
|
|
1554
1554
|
}).nullish(),
|
|
1555
1555
|
text: z5.string().nullish(),
|
|
1556
1556
|
thought: z5.boolean().nullish(),
|