@ai-sdk/google 3.0.61 → 3.0.62
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 +6 -0
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +9 -5
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +9 -5
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/google-generative-ai-language-model.ts +26 -19
- package/src/google-generative-ai-options.ts +3 -2
package/dist/internal/index.js
CHANGED
|
@@ -630,9 +630,10 @@ var googleLanguageModelOptions = (0, import_provider_utils3.lazySchema)(
|
|
|
630
630
|
/**
|
|
631
631
|
* Optional. When set to true, function call arguments will be streamed
|
|
632
632
|
* incrementally via partialArgs in streaming responses. Only supported
|
|
633
|
-
* on the Vertex AI API (not the Gemini API)
|
|
633
|
+
* on the Vertex AI API (not the Gemini API) and only for Gemini 3+
|
|
634
|
+
* models.
|
|
634
635
|
*
|
|
635
|
-
* @default
|
|
636
|
+
* @default false
|
|
636
637
|
*
|
|
637
638
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling#streaming-fc
|
|
638
639
|
*/
|
|
@@ -1174,7 +1175,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1174
1175
|
tools,
|
|
1175
1176
|
toolChoice,
|
|
1176
1177
|
providerOptions
|
|
1177
|
-
}) {
|
|
1178
|
+
}, { isStreaming = false } = {}) {
|
|
1178
1179
|
var _a, _b;
|
|
1179
1180
|
const warnings = [];
|
|
1180
1181
|
const providerOptionsName = this.config.provider.includes("vertex") ? "vertex" : "google";
|
|
@@ -1224,7 +1225,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1224
1225
|
toolChoice,
|
|
1225
1226
|
modelId: this.modelId
|
|
1226
1227
|
});
|
|
1227
|
-
const streamFunctionCallArguments = isVertexProvider ? (_a = googleOptions == null ? void 0 : googleOptions.streamFunctionCallArguments) != null ? _a :
|
|
1228
|
+
const streamFunctionCallArguments = isStreaming && isVertexProvider ? (_a = googleOptions == null ? void 0 : googleOptions.streamFunctionCallArguments) != null ? _a : false : void 0;
|
|
1228
1229
|
const toolConfig = googleToolConfig || streamFunctionCallArguments || (googleOptions == null ? void 0 : googleOptions.retrievalConfig) ? {
|
|
1229
1230
|
...googleToolConfig,
|
|
1230
1231
|
...streamFunctionCallArguments && {
|
|
@@ -1463,7 +1464,10 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1463
1464
|
};
|
|
1464
1465
|
}
|
|
1465
1466
|
async doStream(options) {
|
|
1466
|
-
const { args, warnings, providerOptionsName } = await this.getArgs(
|
|
1467
|
+
const { args, warnings, providerOptionsName } = await this.getArgs(
|
|
1468
|
+
options,
|
|
1469
|
+
{ isStreaming: true }
|
|
1470
|
+
);
|
|
1467
1471
|
const headers = (0, import_provider_utils4.combineHeaders)(
|
|
1468
1472
|
await (0, import_provider_utils4.resolve)(this.config.headers),
|
|
1469
1473
|
options.headers
|