@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/dist/index.mjs CHANGED
@@ -840,16 +840,24 @@ var BedrockChatLanguageModel = class {
840
840
  });
841
841
  }
842
842
  const maxReasoningEffort = (_f = bedrockOptions.reasoningConfig) == null ? void 0 : _f.maxReasoningEffort;
843
+ const isOpenAIModel = this.modelId.startsWith("openai.");
843
844
  if (maxReasoningEffort != null && !isAnthropicModel) {
844
- bedrockOptions.additionalModelRequestFields = {
845
- ...bedrockOptions.additionalModelRequestFields,
846
- reasoningConfig: {
847
- ...((_g = bedrockOptions.reasoningConfig) == null ? void 0 : _g.type) != null && {
848
- type: bedrockOptions.reasoningConfig.type
849
- },
850
- maxReasoningEffort
851
- }
852
- };
845
+ if (isOpenAIModel) {
846
+ bedrockOptions.additionalModelRequestFields = {
847
+ ...bedrockOptions.additionalModelRequestFields,
848
+ reasoning_effort: maxReasoningEffort
849
+ };
850
+ } else {
851
+ bedrockOptions.additionalModelRequestFields = {
852
+ ...bedrockOptions.additionalModelRequestFields,
853
+ reasoningConfig: {
854
+ ...((_g = bedrockOptions.reasoningConfig) == null ? void 0 : _g.type) != null && {
855
+ type: bedrockOptions.reasoningConfig.type
856
+ },
857
+ maxReasoningEffort
858
+ }
859
+ };
860
+ }
853
861
  } else if (maxReasoningEffort != null && isAnthropicModel) {
854
862
  warnings.push({
855
863
  type: "unsupported",
@@ -1751,7 +1759,7 @@ import {
1751
1759
  import { AwsV4Signer } from "aws4fetch";
1752
1760
 
1753
1761
  // src/version.ts
1754
- var VERSION = true ? "4.0.10" : "0.0.0-test";
1762
+ var VERSION = true ? "4.0.12" : "0.0.0-test";
1755
1763
 
1756
1764
  // src/bedrock-sigv4-fetch.ts
1757
1765
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {