@ai-sdk/amazon-bedrock 4.0.10 → 4.0.12

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,18 @@
1
1
  # @ai-sdk/amazon-bedrock
2
2
 
3
+ ## 4.0.12
4
+
5
+ ### Patch Changes
6
+
7
+ - eff1cb6: fix(bedrock): map reasoningConfig to reasoning_effort for openai models
8
+
9
+ ## 4.0.11
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [de2399b]
14
+ - @ai-sdk/anthropic@3.0.9
15
+
3
16
  ## 4.0.10
4
17
 
5
18
  ### Patch Changes
package/dist/index.js CHANGED
@@ -844,16 +844,24 @@ var BedrockChatLanguageModel = class {
844
844
  });
845
845
  }
846
846
  const maxReasoningEffort = (_f = bedrockOptions.reasoningConfig) == null ? void 0 : _f.maxReasoningEffort;
847
+ const isOpenAIModel = this.modelId.startsWith("openai.");
847
848
  if (maxReasoningEffort != null && !isAnthropicModel) {
848
- bedrockOptions.additionalModelRequestFields = {
849
- ...bedrockOptions.additionalModelRequestFields,
850
- reasoningConfig: {
851
- ...((_g = bedrockOptions.reasoningConfig) == null ? void 0 : _g.type) != null && {
852
- type: bedrockOptions.reasoningConfig.type
853
- },
854
- maxReasoningEffort
855
- }
856
- };
849
+ if (isOpenAIModel) {
850
+ bedrockOptions.additionalModelRequestFields = {
851
+ ...bedrockOptions.additionalModelRequestFields,
852
+ reasoning_effort: maxReasoningEffort
853
+ };
854
+ } else {
855
+ bedrockOptions.additionalModelRequestFields = {
856
+ ...bedrockOptions.additionalModelRequestFields,
857
+ reasoningConfig: {
858
+ ...((_g = bedrockOptions.reasoningConfig) == null ? void 0 : _g.type) != null && {
859
+ type: bedrockOptions.reasoningConfig.type
860
+ },
861
+ maxReasoningEffort
862
+ }
863
+ };
864
+ }
857
865
  } else if (maxReasoningEffort != null && isAnthropicModel) {
858
866
  warnings.push({
859
867
  type: "unsupported",
@@ -1734,7 +1742,7 @@ var import_provider_utils7 = require("@ai-sdk/provider-utils");
1734
1742
  var import_aws4fetch = require("aws4fetch");
1735
1743
 
1736
1744
  // src/version.ts
1737
- var VERSION = true ? "4.0.10" : "0.0.0-test";
1745
+ var VERSION = true ? "4.0.12" : "0.0.0-test";
1738
1746
 
1739
1747
  // src/bedrock-sigv4-fetch.ts
1740
1748
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {