@ai-sdk/google 4.0.0-beta.32 → 4.0.0-beta.34
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 +13 -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 +4 -4
- package/src/google-generative-ai-language-model.ts +27 -20
- package/src/google-generative-ai-options.ts +3 -2
package/dist/internal/index.js
CHANGED
|
@@ -680,9 +680,10 @@ var googleLanguageModelOptions = (0, import_provider_utils3.lazySchema)(
|
|
|
680
680
|
/**
|
|
681
681
|
* Optional. When set to true, function call arguments will be streamed
|
|
682
682
|
* incrementally via partialArgs in streaming responses. Only supported
|
|
683
|
-
* on the Vertex AI API (not the Gemini API)
|
|
683
|
+
* on the Vertex AI API (not the Gemini API) and only for Gemini 3+
|
|
684
|
+
* models.
|
|
684
685
|
*
|
|
685
|
-
* @default
|
|
686
|
+
* @default false
|
|
686
687
|
*
|
|
687
688
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling#streaming-fc
|
|
688
689
|
*/
|
|
@@ -1225,7 +1226,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1225
1226
|
toolChoice,
|
|
1226
1227
|
reasoning,
|
|
1227
1228
|
providerOptions
|
|
1228
|
-
}) {
|
|
1229
|
+
}, { isStreaming = false } = {}) {
|
|
1229
1230
|
var _a, _b;
|
|
1230
1231
|
const warnings = [];
|
|
1231
1232
|
const providerOptionsName = this.config.provider.includes("vertex") ? "vertex" : "google";
|
|
@@ -1281,7 +1282,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1281
1282
|
warnings
|
|
1282
1283
|
});
|
|
1283
1284
|
const thinkingConfig = (googleOptions == null ? void 0 : googleOptions.thinkingConfig) || resolvedThinking ? { ...resolvedThinking, ...googleOptions == null ? void 0 : googleOptions.thinkingConfig } : void 0;
|
|
1284
|
-
const streamFunctionCallArguments = isVertexProvider ? (_a = googleOptions == null ? void 0 : googleOptions.streamFunctionCallArguments) != null ? _a :
|
|
1285
|
+
const streamFunctionCallArguments = isStreaming && isVertexProvider ? (_a = googleOptions == null ? void 0 : googleOptions.streamFunctionCallArguments) != null ? _a : false : void 0;
|
|
1285
1286
|
const toolConfig = googleToolConfig || streamFunctionCallArguments || (googleOptions == null ? void 0 : googleOptions.retrievalConfig) ? {
|
|
1286
1287
|
...googleToolConfig,
|
|
1287
1288
|
...streamFunctionCallArguments && {
|
|
@@ -1519,7 +1520,10 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1519
1520
|
};
|
|
1520
1521
|
}
|
|
1521
1522
|
async doStream(options) {
|
|
1522
|
-
const { args, warnings, providerOptionsName } = await this.getArgs(
|
|
1523
|
+
const { args, warnings, providerOptionsName } = await this.getArgs(
|
|
1524
|
+
options,
|
|
1525
|
+
{ isStreaming: true }
|
|
1526
|
+
);
|
|
1523
1527
|
const headers = (0, import_provider_utils4.combineHeaders)(
|
|
1524
1528
|
await (0, import_provider_utils4.resolve)(this.config.headers),
|
|
1525
1529
|
options.headers
|