@ai-sdk/google 4.0.0-beta.33 → 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 +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 +1 -1
- package/src/google-generative-ai-language-model.ts +27 -20
- package/src/google-generative-ai-options.ts +3 -2
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
30
30
|
var import_provider_utils17 = require("@ai-sdk/provider-utils");
|
|
31
31
|
|
|
32
32
|
// src/version.ts
|
|
33
|
-
var VERSION = true ? "4.0.0-beta.
|
|
33
|
+
var VERSION = true ? "4.0.0-beta.34" : "0.0.0-test";
|
|
34
34
|
|
|
35
35
|
// src/google-generative-ai-embedding-model.ts
|
|
36
36
|
var import_provider = require("@ai-sdk/provider");
|
|
@@ -872,9 +872,10 @@ var googleLanguageModelOptions = (0, import_provider_utils5.lazySchema)(
|
|
|
872
872
|
/**
|
|
873
873
|
* Optional. When set to true, function call arguments will be streamed
|
|
874
874
|
* incrementally via partialArgs in streaming responses. Only supported
|
|
875
|
-
* on the Vertex AI API (not the Gemini API)
|
|
875
|
+
* on the Vertex AI API (not the Gemini API) and only for Gemini 3+
|
|
876
|
+
* models.
|
|
876
877
|
*
|
|
877
|
-
* @default
|
|
878
|
+
* @default false
|
|
878
879
|
*
|
|
879
880
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling#streaming-fc
|
|
880
881
|
*/
|
|
@@ -1417,7 +1418,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1417
1418
|
toolChoice,
|
|
1418
1419
|
reasoning,
|
|
1419
1420
|
providerOptions
|
|
1420
|
-
}) {
|
|
1421
|
+
}, { isStreaming = false } = {}) {
|
|
1421
1422
|
var _a, _b;
|
|
1422
1423
|
const warnings = [];
|
|
1423
1424
|
const providerOptionsName = this.config.provider.includes("vertex") ? "vertex" : "google";
|
|
@@ -1473,7 +1474,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1473
1474
|
warnings
|
|
1474
1475
|
});
|
|
1475
1476
|
const thinkingConfig = (googleOptions == null ? void 0 : googleOptions.thinkingConfig) || resolvedThinking ? { ...resolvedThinking, ...googleOptions == null ? void 0 : googleOptions.thinkingConfig } : void 0;
|
|
1476
|
-
const streamFunctionCallArguments = isVertexProvider ? (_a = googleOptions == null ? void 0 : googleOptions.streamFunctionCallArguments) != null ? _a :
|
|
1477
|
+
const streamFunctionCallArguments = isStreaming && isVertexProvider ? (_a = googleOptions == null ? void 0 : googleOptions.streamFunctionCallArguments) != null ? _a : false : void 0;
|
|
1477
1478
|
const toolConfig = googleToolConfig || streamFunctionCallArguments || (googleOptions == null ? void 0 : googleOptions.retrievalConfig) ? {
|
|
1478
1479
|
...googleToolConfig,
|
|
1479
1480
|
...streamFunctionCallArguments && {
|
|
@@ -1711,7 +1712,10 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1711
1712
|
};
|
|
1712
1713
|
}
|
|
1713
1714
|
async doStream(options) {
|
|
1714
|
-
const { args, warnings, providerOptionsName } = await this.getArgs(
|
|
1715
|
+
const { args, warnings, providerOptionsName } = await this.getArgs(
|
|
1716
|
+
options,
|
|
1717
|
+
{ isStreaming: true }
|
|
1718
|
+
);
|
|
1715
1719
|
const headers = (0, import_provider_utils6.combineHeaders)(
|
|
1716
1720
|
await (0, import_provider_utils6.resolve)(this.config.headers),
|
|
1717
1721
|
options.headers
|