@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
|
@@ -96,7 +96,7 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
96
96
|
} | null | undefined;
|
|
97
97
|
codeExecutionResult?: {
|
|
98
98
|
outcome: string;
|
|
99
|
-
output
|
|
99
|
+
output?: string | null | undefined;
|
|
100
100
|
} | null | undefined;
|
|
101
101
|
text?: string | null | undefined;
|
|
102
102
|
thought?: boolean | null | undefined;
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -96,7 +96,7 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
96
96
|
} | null | undefined;
|
|
97
97
|
codeExecutionResult?: {
|
|
98
98
|
outcome: string;
|
|
99
|
-
output
|
|
99
|
+
output?: string | null | undefined;
|
|
100
100
|
} | null | undefined;
|
|
101
101
|
text?: string | null | undefined;
|
|
102
102
|
thought?: boolean | null | undefined;
|
package/dist/internal/index.js
CHANGED
|
@@ -845,7 +845,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
845
845
|
};
|
|
846
846
|
}
|
|
847
847
|
async doGenerate(options) {
|
|
848
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
848
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
849
849
|
const { args, warnings, providerOptionsName } = await this.getArgs(options);
|
|
850
850
|
const mergedHeaders = (0, import_provider_utils4.combineHeaders)(
|
|
851
851
|
await (0, import_provider_utils4.resolve)(this.config.headers),
|
|
@@ -890,7 +890,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
890
890
|
toolName: "code_execution",
|
|
891
891
|
result: {
|
|
892
892
|
outcome: part.codeExecutionResult.outcome,
|
|
893
|
-
output: part.codeExecutionResult.output
|
|
893
|
+
output: (_d = part.codeExecutionResult.output) != null ? _d : ""
|
|
894
894
|
}
|
|
895
895
|
});
|
|
896
896
|
lastCodeExecutionToolCallId = void 0;
|
|
@@ -929,10 +929,10 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
929
929
|
});
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
|
-
const sources = (
|
|
932
|
+
const sources = (_e = extractSources({
|
|
933
933
|
groundingMetadata: candidate.groundingMetadata,
|
|
934
934
|
generateId: this.config.generateId
|
|
935
|
-
})) != null ?
|
|
935
|
+
})) != null ? _e : [];
|
|
936
936
|
for (const source of sources) {
|
|
937
937
|
content.push(source);
|
|
938
938
|
}
|
|
@@ -946,16 +946,16 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
946
946
|
(part) => part.type === "tool-call" && !part.providerExecuted
|
|
947
947
|
)
|
|
948
948
|
}),
|
|
949
|
-
raw: (
|
|
949
|
+
raw: (_f = candidate.finishReason) != null ? _f : void 0
|
|
950
950
|
},
|
|
951
951
|
usage: convertGoogleGenerativeAIUsage(usageMetadata),
|
|
952
952
|
warnings,
|
|
953
953
|
providerMetadata: {
|
|
954
954
|
[providerOptionsName]: {
|
|
955
|
-
promptFeedback: (
|
|
956
|
-
groundingMetadata: (
|
|
957
|
-
urlContextMetadata: (
|
|
958
|
-
safetyRatings: (
|
|
955
|
+
promptFeedback: (_g = response.promptFeedback) != null ? _g : null,
|
|
956
|
+
groundingMetadata: (_h = candidate.groundingMetadata) != null ? _h : null,
|
|
957
|
+
urlContextMetadata: (_i = candidate.urlContextMetadata) != null ? _i : null,
|
|
958
|
+
safetyRatings: (_j = candidate.safetyRatings) != null ? _j : null,
|
|
959
959
|
usageMetadata: usageMetadata != null ? usageMetadata : null
|
|
960
960
|
}
|
|
961
961
|
},
|
|
@@ -1004,7 +1004,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1004
1004
|
controller.enqueue({ type: "stream-start", warnings });
|
|
1005
1005
|
},
|
|
1006
1006
|
transform(chunk, controller) {
|
|
1007
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
1007
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1008
1008
|
if (options.includeRawChunks) {
|
|
1009
1009
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
1010
1010
|
}
|
|
@@ -1056,7 +1056,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1056
1056
|
toolName: "code_execution",
|
|
1057
1057
|
result: {
|
|
1058
1058
|
outcome: part.codeExecutionResult.outcome,
|
|
1059
|
-
output: part.codeExecutionResult.output
|
|
1059
|
+
output: (_d = part.codeExecutionResult.output) != null ? _d : ""
|
|
1060
1060
|
}
|
|
1061
1061
|
});
|
|
1062
1062
|
lastCodeExecutionToolCallId = void 0;
|
|
@@ -1176,10 +1176,10 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1176
1176
|
};
|
|
1177
1177
|
providerMetadata = {
|
|
1178
1178
|
[providerOptionsName]: {
|
|
1179
|
-
promptFeedback: (
|
|
1180
|
-
groundingMetadata: (
|
|
1181
|
-
urlContextMetadata: (
|
|
1182
|
-
safetyRatings: (
|
|
1179
|
+
promptFeedback: (_e = value.promptFeedback) != null ? _e : null,
|
|
1180
|
+
groundingMetadata: (_f = candidate.groundingMetadata) != null ? _f : null,
|
|
1181
|
+
urlContextMetadata: (_g = candidate.urlContextMetadata) != null ? _g : null,
|
|
1182
|
+
safetyRatings: (_h = candidate.safetyRatings) != null ? _h : null
|
|
1183
1183
|
}
|
|
1184
1184
|
};
|
|
1185
1185
|
if (usageMetadata != null) {
|
|
@@ -1385,7 +1385,7 @@ var getContentSchema = () => import_v43.z.object({
|
|
|
1385
1385
|
}).nullish(),
|
|
1386
1386
|
codeExecutionResult: import_v43.z.object({
|
|
1387
1387
|
outcome: import_v43.z.string(),
|
|
1388
|
-
output: import_v43.z.string()
|
|
1388
|
+
output: import_v43.z.string().nullish()
|
|
1389
1389
|
}).nullish(),
|
|
1390
1390
|
text: import_v43.z.string().nullish(),
|
|
1391
1391
|
thought: import_v43.z.boolean().nullish(),
|