@ai-sdk/google 3.0.68 → 3.0.70

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 3.0.70
4
+
5
+ ### Patch Changes
6
+
7
+ - 4f3f564: fix(provider/google): fix lack of image consistency when using Interactions API in stateless mode
8
+
9
+ ## 3.0.69
10
+
11
+ ### Patch Changes
12
+
13
+ - bb377ba: fix(google): omit passing includeServerSideToolInvocations for Vertex tool_config
14
+ - Updated dependencies [f591416]
15
+ - @ai-sdk/provider-utils@4.0.27
16
+
3
17
  ## 3.0.68
4
18
 
5
19
  ### Patch Changes
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(index_exports);
30
30
  var import_provider_utils21 = require("@ai-sdk/provider-utils");
31
31
 
32
32
  // src/version.ts
33
- var VERSION = true ? "3.0.68" : "0.0.0-test";
33
+ var VERSION = true ? "3.0.70" : "0.0.0-test";
34
34
 
35
35
  // src/google-generative-ai-embedding-model.ts
36
36
  var import_provider = require("@ai-sdk/provider");
@@ -848,7 +848,8 @@ var import_provider3 = require("@ai-sdk/provider");
848
848
  function prepareTools({
849
849
  tools,
850
850
  toolChoice,
851
- modelId
851
+ modelId,
852
+ isVertexProvider = false
852
853
  }) {
853
854
  var _a, _b;
854
855
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
@@ -984,7 +985,9 @@ function prepareTools({
984
985
  }
985
986
  const combinedToolConfig = {
986
987
  functionCallingConfig: { mode: "VALIDATED" },
987
- includeServerSideToolInvocations: true
988
+ ...!isVertexProvider && {
989
+ includeServerSideToolInvocations: true
990
+ }
988
991
  };
989
992
  if (toolChoice != null) {
990
993
  switch (toolChoice.type) {
@@ -1424,7 +1427,8 @@ var GoogleGenerativeAILanguageModel = class {
1424
1427
  } = prepareTools({
1425
1428
  tools,
1426
1429
  toolChoice,
1427
- modelId: this.modelId
1430
+ modelId: this.modelId,
1431
+ isVertexProvider
1428
1432
  });
1429
1433
  const streamFunctionCallArguments = isStreaming && isVertexProvider ? (_a = googleOptions == null ? void 0 : googleOptions.streamFunctionCallArguments) != null ? _a : false : void 0;
1430
1434
  const toolConfig = googleToolConfig || streamFunctionCallArguments || (googleOptions == null ? void 0 : googleOptions.retrievalConfig) ? {
@@ -3746,6 +3750,15 @@ function convertToGoogleInteractionsInput({
3746
3750
  ...signature != null ? { signature } : {},
3747
3751
  summary: part.text.length > 0 ? [{ type: "text", text: part.text }] : void 0
3748
3752
  });
3753
+ } else if (part.type === "file") {
3754
+ const fileBlock = convertFilePartToContent({
3755
+ part,
3756
+ warnings,
3757
+ mediaResolution
3758
+ });
3759
+ if (fileBlock != null) {
3760
+ content.push(fileBlock);
3761
+ }
3749
3762
  } else if (part.type === "tool-call") {
3750
3763
  const signature = (_d = (_c = part.providerOptions) == null ? void 0 : _c.google) == null ? void 0 : _d.signature;
3751
3764
  const args = typeof part.input === "string" ? safeParseToolArgs(part.input) : (_e = part.input) != null ? _e : {};