@ai-sdk/amazon-bedrock 4.0.180 → 4.0.182

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
@@ -1041,7 +1041,10 @@ var BedrockChatLanguageModel = class {
1041
1041
  const isOpenAIModel = openAIModelId != null;
1042
1042
  const isOpenAIGptOssModel = (_d = openAIModelId == null ? void 0 : openAIModelId.startsWith("openai.gpt-oss-")) != null ? _d : false;
1043
1043
  const isThinkingEnabled = ((_e = bedrockOptions.reasoningConfig) == null ? void 0 : _e.type) === "enabled" || ((_f = bedrockOptions.reasoningConfig) == null ? void 0 : _f.type) === "adaptive";
1044
- const { supportsStructuredOutput: modelSupportsStructuredOutput } = getModelCapabilities(this.modelId);
1044
+ const {
1045
+ supportsStructuredOutput: modelSupportsStructuredOutput,
1046
+ rejectsForcedToolUse
1047
+ } = getModelCapabilities(this.modelId);
1045
1048
  const structuredOutputMode = (_h = (_g = bedrockOptions.structuredOutputMode) != null ? _g : anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _h : "auto";
1046
1049
  if (structuredOutputMode === "jsonTool") {
1047
1050
  const additionalModelRequestFields = {
@@ -1061,7 +1064,7 @@ var BedrockChatLanguageModel = class {
1061
1064
  }
1062
1065
  const modelSupportsNativeStructuredOutput = supportsNativeStructuredOutput(this.modelId) && (modelSupportsStructuredOutput || isThinkingEnabled || this.config.modelFamily === "anthropic");
1063
1066
  const useNativeStructuredOutput = isAnthropicModel2 && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && (structuredOutputMode === "outputFormat" || structuredOutputMode === "auto" && modelSupportsNativeStructuredOutput);
1064
- const useJsonInstructionForStructuredOutput = !useNativeStructuredOutput && structuredOutputMode !== "jsonTool" && isAnthropicModel2 && !supportsStrictTools(this.modelId) && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && tools != null && tools.length > 0;
1067
+ const useJsonInstructionForStructuredOutput = !useNativeStructuredOutput && isAnthropicModel2 && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && (rejectsForcedToolUse || structuredOutputMode !== "jsonTool" && !supportsStrictTools(this.modelId) && tools != null && tools.length > 0);
1065
1068
  const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useNativeStructuredOutput && !useJsonInstructionForStructuredOutput ? {
1066
1069
  type: "function",
1067
1070
  name: "json",
@@ -2378,7 +2381,7 @@ import {
2378
2381
  import { AwsV4Signer } from "aws4fetch";
2379
2382
 
2380
2383
  // src/version.ts
2381
- var VERSION = true ? "4.0.180" : "0.0.0-test";
2384
+ var VERSION = true ? "4.0.182" : "0.0.0-test";
2382
2385
 
2383
2386
  // src/bedrock-sigv4-fetch.ts
2384
2387
  function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {