@ai-sdk/amazon-bedrock 4.0.90 → 4.0.92

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/amazon-bedrock
2
2
 
3
+ ## 4.0.92
4
+
5
+ ### Patch Changes
6
+
7
+ - d42076d: Add AI Gateway hint to provider READMEs
8
+ - Updated dependencies [d42076d]
9
+ - @ai-sdk/anthropic@3.0.68
10
+
11
+ ## 4.0.91
12
+
13
+ ### Patch Changes
14
+
15
+ - ac80bc7: fix(amazon-bedrock): preserve empty text blocks when reasoning content is present
16
+
3
17
  ## 4.0.90
4
18
 
5
19
  ### Patch Changes
package/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  The **[Amazon Bedrock provider](https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock)** for the [AI SDK](https://ai-sdk.dev/docs)
4
4
  contains language model support for the Amazon Bedrock [converse API](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html).
5
5
 
6
+ > **Deploying to Vercel?** With Vercel's AI Gateway you can access Amazon Bedrock (and hundreds of models from other providers) — no additional packages, API keys, or extra cost. [Get started with AI Gateway](https://vercel.com/ai-gateway).
7
+
6
8
  ## Setup
7
9
 
8
10
  The Amazon Bedrock provider is available in the `@ai-sdk/amazon-bedrock` module. You can install it with
@@ -35,7 +35,7 @@ var import_provider_utils = require("@ai-sdk/provider-utils");
35
35
  var import_aws4fetch = require("aws4fetch");
36
36
 
37
37
  // src/version.ts
38
- var VERSION = true ? "4.0.90" : "0.0.0-test";
38
+ var VERSION = true ? "4.0.92" : "0.0.0-test";
39
39
 
40
40
  // src/bedrock-sigv4-fetch.ts
41
41
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
@@ -24,7 +24,7 @@ import {
24
24
  import { AwsV4Signer } from "aws4fetch";
25
25
 
26
26
  // src/version.ts
27
- var VERSION = true ? "4.0.90" : "0.0.0-test";
27
+ var VERSION = true ? "4.0.92" : "0.0.0-test";
28
28
 
29
29
  // src/bedrock-sigv4-fetch.ts
30
30
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
package/dist/index.js CHANGED
@@ -574,12 +574,15 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
574
574
  const message = block.messages[j];
575
575
  const isLastMessage = j === block.messages.length - 1;
576
576
  const { content } = message;
577
+ const hasReasoningBlocks = content.some(
578
+ (part) => part.type === "reasoning"
579
+ );
577
580
  for (let k = 0; k < content.length; k++) {
578
581
  const part = content[k];
579
582
  const isLastContentPart = k === content.length - 1;
580
583
  switch (part.type) {
581
584
  case "text": {
582
- if (!part.text.trim()) {
585
+ if (!part.text.trim() && !hasReasoningBlocks) {
583
586
  break;
584
587
  }
585
588
  bedrockContent.push({
@@ -1066,7 +1069,7 @@ var BedrockChatLanguageModel = class {
1066
1069
  const content = [];
1067
1070
  let isJsonResponseFromTool = false;
1068
1071
  for (const part of response.output.message.content) {
1069
- if (part.text) {
1072
+ if (part.text != null) {
1070
1073
  content.push({ type: "text", text: part.text });
1071
1074
  }
1072
1075
  if (part.reasoningContent) {
@@ -1968,7 +1971,7 @@ var import_provider_utils7 = require("@ai-sdk/provider-utils");
1968
1971
  var import_aws4fetch = require("aws4fetch");
1969
1972
 
1970
1973
  // src/version.ts
1971
- var VERSION = true ? "4.0.90" : "0.0.0-test";
1974
+ var VERSION = true ? "4.0.92" : "0.0.0-test";
1972
1975
 
1973
1976
  // src/bedrock-sigv4-fetch.ts
1974
1977
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {